[Lunar-commits] <moonbase> Revert "binutils: remove Reduce from lunar menu"

Dennis 'stumbles' Veatch stumbles at lunar-linux.org
Mon Feb 2 12:28:43 CET 2009


commit 089fe28af49413b139181f1db1d2f2589ee2582a
Author: Dennis 'stumbles' Veatch <stumbles at lunar-linux.org>
Date:   Mon Feb 2 06:28:43 2009 -0500

    Revert "binutils: remove Reduce from lunar menu"
    
    This reverts commit 1a6faf35d6b57a8c36136aaeed11870d4020082a.
    
    Because people are using unsafe optimizations, is not a reason to
    remove this. That is their own fault.
---
 devel/binutils/plugin.d/optimize-gnu_ld.plugin |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/devel/binutils/plugin.d/optimize-gnu_ld.plugin b/devel/binutils/plugin.d/optimize-gnu_ld.plugin
index 9a54c71..827ac02 100644
--- a/devel/binutils/plugin.d/optimize-gnu_ld.plugin
+++ b/devel/binutils/plugin.d/optimize-gnu_ld.plugin
@@ -20,6 +20,13 @@ plugin_gnu_ld_optimize()
       Optimize)
         LDFLAGS="$LDFLAGS -Wl,-O1"
       ;;
+      Reduce)
+        if echo $LDFLAGS | grep -q 'Wl,-O1' ; then
+          LDFLAGS="$LDFLAGS -Wl,-O1,--as-needed"
+        else
+          LDFLAGS="$LDFLAGS -Wl,--as-needed"
+        fi
+      ;;
       Combreloc)
         LDFLAGS="$LDFLAGS -z combreloc"
       ;;
@@ -69,6 +76,7 @@ EOF
     "Strip" "-s (RECOMMENDED)" $( echo ${LDF[@]} | grep -qw "Strip" && echo "on" || echo "off" ) "Strip all symbols"
     "StripDebug" "-S" $( echo ${LDF[@]} | grep -qw "StripDebug" && echo "on" || echo "off" ) "Strip debug symbols only"
     "Optimize" "-Wl,-O1" $( echo ${LDF[@]} | grep -qw "Optimize" && echo "on" || echo "off" ) "Optimize hash tables during linking"
+    "Reduce" "-Wl,--as-needed" $( echo ${LDF[@]} | grep -qw "Reduce" && echo "on" || echo "off" ) "Reduce the amount of linked libraries if possible"
     "Combreloc" "-z combreloc" $( echo ${LDF[@]} | grep -qw "Combreloc" && echo "on" || echo "off" ) "Combreloc"
     )
   RESULT=`$DIALOG --item-help --separate-output --checklist "Select linker optimizations. These options only apply to the link stage of binaries." 0 0 0 "${OPTIONS[@]}"`


More information about the Lunar-commits mailing list