Hi Josselin, * Josselin Mouette wrote on Wed, May 17, 2006 at 01:54:30AM CEST: > The attached patch is applied to libgnome, to avoid argument reordering > for -Wl,--as-needed. > > It is only a hack, but it works. With it, libgnome has reduced > dependencies as expected.
It's not bad, but it's missing a few minor things: * "-Wl,--no-as-needed" should be treated in the same way. * In order to support multiple sequences of -Wl,--as-needed ... -Wl,--no-as-needed it is necessary to turn off duplicate removal in this loop (around line 3019): for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do ... case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; -Wl,*) new_libs="$deplib $new_libs" ;; *) # And here is the reason: when a library appears more ... done * In order for this to also work on non-Debian systems, more precisely, on systems without link_all_deplibs=no, the loop around line 2906, if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; ... fi needs to be treated similarly. Hope this helps. I haven't tested your patch in any way yet. Cheers, Ralf -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]