libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Don't use linker_flags when running CC


From: Alexandre Oliva
Subject: Don't use linker_flags when running CC
Date: 19 Feb 2003 04:18:42 -0300
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

I ran into a problem in the old snapshot of libtool 1.5- used by GCC
on Solaris that was caused by our mis-use of $linker_flags as an
argument to $CC.  This patch fixes all occurrences of the problem I
could find in libtool mainline.  Ok to install?

Index: ChangeLog
from  Alexandre Oliva  <address@hidden>

        * libtool.m4: Replace $linker_flags with $compiler_flags wherever
        it is used as argument to $CC.

Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libtool.m4,v
retrieving revision 1.300
diff -u -p -r1.300 libtool.m4
--- libtool.m4 18 Feb 2003 05:15:03 -0000 1.300
+++ libtool.m4 19 Feb 2003 07:17:16 -0000
@@ -2769,7 +2769,7 @@ case $host_os in
     #        cross-compilation, but unfortunately the echo tests do not
     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
     #         `"' quotes if we put them in here... so don't!
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load 
-keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test 
.$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o 
$lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo 
-install_name $rpath/$soname $verstring)'
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load 
-keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test 
.$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o 
$lib ${lib}-master.o $deplibs$compiler_flags $(test .$module != .yes && echo 
-install_name $rpath/$soname $verstring)'
     # We need to add '_' to the symbols in $export_symbols first
     #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, 
$1)"' && strip -s $export_symbols'
     _LT_AC_TAGVAR(hardcode_direct, $1)=yes
@@ -2942,7 +2942,7 @@ case $host_os in
          if test "$with_gnu_ld" = no; then
            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname 
${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` 
${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
          else
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib 
$predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname 
$soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname 
$soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
          fi
        fi
        _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
@@ -3249,9 +3249,9 @@ case $host_os in
        if test "$GXX" = yes && test "$with_gnu_ld" = no; then
          _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
          if $CC --version | grep -v '^2\.7' > /dev/null; then
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS 
$predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h 
$wl$soname -o $lib'
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h 
$wl$soname -o $lib'
            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > 
$lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo 
"local: *; };" >> $lib.exp~
-               $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib 
$predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
+               $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
            # Commands to make compiler produce verbose output that lists
            # what "hidden" libraries, object files and flags are used when
@@ -3260,9 +3260,9 @@ case $host_os in
          else
            # g++ 2.7 appears to require `-G' NOT `-shared' on this
            # platform.
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS 
$predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h 
$wl$soname -o $lib'
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h 
$wl$soname -o $lib'
            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > 
$lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo 
"local: *; };" >> $lib.exp~
-               $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects 
$libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
+               $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects 
$libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
            # Commands to make compiler produce verbose output that lists
            # what "hidden" libraries, object files and flags are used when
@@ -5162,7 +5162,7 @@ EOF
       #        cross-compilation, but unfortunately the echo tests do not
       #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
       #               `"' quotes if we put them in here... so don't!
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load 
-keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test 
.$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o 
$lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo 
-install_name $rpath/$soname $verstring)'
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load 
-keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test 
.$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o 
$lib ${lib}-master.o $deplibs$compiler_flags $(test .$module != .yes && echo 
-install_name $rpath/$soname $verstring)'
       # We need to add '_' to the symbols in $export_symbols first
       #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, 
$1)"' && strip -s $export_symbols'
       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 address@hidden, gcc.gnu.org}
CS PhD student at IC-Unicamp        address@hidden, gnu.org}
Free Software Evangelist                Professional serial bug killer

reply via email to

[Prev in Thread] Current Thread [Next in Thread]