linker optimizations

Jasper Huijsmans jasper at lunar-linux.org
Thu Oct 7 13:39:37 UTC 2004


On Thu, Oct 07, 2004 at 02:34:19PM +0200, Jasper Huijsmans wrote:
> Hey,
> 
> I forgot to post this earlier, but I read a thread on the gnome list about
> optimizations and one of the posts mentioned a way to optimize loading time by
> adding -Wl,O1 to the LD_FLAGS:
> 
> http://mail.gnome.org/archives/desktop-devel-list/2004-September/msg00377.html
> 
> Could we add this option to lunar (or is it possible already)?
> 

Attached patch adds an  "Optimize" menu option to the linker optimization 
settings.

I just recompiled all of Xfce with it and it compiles fine (didn't run it
yet).

-------------- next part --------------
Index: var/lib/lunar/functions/optimize.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/optimize.lunar,v
retrieving revision 1.49
diff -u -r1.49 optimize.lunar
--- var/lib/lunar/functions/optimize.lunar	9 Jul 2004 19:43:25 -0000	1.49
+++ var/lib/lunar/functions/optimize.lunar	7 Oct 2004 13:10:47 -0000
@@ -673,6 +673,7 @@
 #                    ;;
          Combreloc) LDFLAGS="$LDFLAGS -z combreloc"
                     ;;
+	 Optimize)  LDFLAGS="$LDFLAGS -Wl,-O1"
       esac
    done
 }
Index: var/lib/lunar/menu/optimize.menu
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/menu/optimize.menu,v
retrieving revision 1.20
diff -u -r1.20 optimize.menu
--- var/lib/lunar/menu/optimize.menu	23 Jun 2004 13:24:24 -0000	1.20
+++ var/lib/lunar/menu/optimize.menu	7 Oct 2004 13:10:48 -0000
@@ -212,6 +212,7 @@
       Strip_HELP="Strip all symbols"
 #     Debug_HELP="Strip debug symbols only"
   Combreloc_HELP="Combreloc"
+  Optimize_HELP="Optimize linking"
                ;;
 
    # Addon help for extra programs
@@ -370,7 +371,8 @@
 ldf_options() {
    OPTIONS=( "Strip"      "-s"            $( echo ${LDF[@]} | grep -q "Strip" && echo "on" || echo "off" )     "$Strip_HELP"
 #            "Debug"      "-S"            $( echo ${LDF[@]} | grep -q "Debug" && echo "on" || echo "off" )     "$Debug_HELP"
-             "Combreloc"  "-z combreloc"  $( echo ${LDF[@]} | grep -q "Combreloc" && echo "on" || echo "off" ) "$Combreloc_HELP" )
+             "Combreloc"  "-z combreloc"  $( echo ${LDF[@]} | grep -q "Combreloc" && echo "on" || echo "off" ) "$Combreloc_HELP" 
+             "Optimize"  "-Wl,-O1"  $( echo ${LDF[@]} | grep -q "Optimize" && echo "on" || echo "off" ) "$Optimize_HELP" )
 
 }
 


More information about the Lunar-dev mailing list