From 76d675ff0f045403f1016a2f80140ae1f96a1ffe Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 16 Nov 1998 08:10:45 +0000 Subject: [PATCH] * ltmain.in (C_compiler): copy $CC before it is overwritten with command-line compiler, so that we can use it to compile C sources generated during the build. This fixes the problem that showed up with -export-dynamic of C++ programs in egcs 1.1. * NEWS: ditto --- ChangeLog | 8 ++++++++ NEWS | 3 ++- ltmain.in | 11 ++++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbc866ad6..597a90acd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +1998-11-16 Alexandre Oliva + + * ltmain.in (C_compiler): copy $CC before it is overwritten with + command-line compiler, so that we can use it to compile C sources + generated during the build. This fixes the problem that showed up + with -export-dynamic of C++ programs in egcs 1.1. + * NEWS: ditto + 1998-11-12 Alexandre Oliva * PORTING: Porting instructions are in the libtool manual already diff --git a/NEWS b/NEWS index bb8b77beb..e27f2ad09 100644 --- a/NEWS +++ b/NEWS @@ -6,7 +6,8 @@ still much porting to do. See PORTING for details (some plans for the future in mail/deplibs in the CVS tree). * Initial support for portable dlopen()ing of modules (see mdemo). * New option -export-symbols to control symbol exporting when possible. -* New dlpreopen mechanism. +* Fixed -export-dynamic problem with C++ programs in egcs 1.1. +* New dlpreopen structure. * libtool now supports `-c -o' and subdirectories in sources and target object names even in platforms whose compilers do not support this. In this case, file locking occurs to avoid problems with diff --git a/ltmain.in b/ltmain.in index 3b80f0b63..60001ccc0 100644 --- a/ltmain.in +++ b/ltmain.in @@ -557,6 +557,7 @@ compiler." # libtool link mode link) modename="$modename: link" + C_compiler="$CC" # save it, to compile generated C sources CC="$nonopt" allow_undefined=yes compile_command="$CC" @@ -1337,7 +1338,7 @@ compiler." int main() { return 0; } EOF $rm a.out - $CC conftest.c $deplibs $extradeplibs + $C_compiler conftest.c $deplibs $extradeplibs if test $? -eq 0 ; then ldd_output=`ldd a.out` for i in $deplibs; do @@ -1365,7 +1366,7 @@ EOF # Error occured in the first compile. Let's try to salvage the situation: # 1) Is the error in the extradeplibs? $rm a.out - $CC conftest.c $extradeplibs + $C_compiler conftest.c $extradeplibs if test $? -ne 0 ; then echo echo "*** Warning! Not all libraries necessary to the dependent libraries are" @@ -1387,7 +1388,7 @@ EOF # If $name is empty we are operating on a -L argument. if test "$name" != "" ; then $rm a.out - $CC conftest.c $i $extradeplibs + $C_compiler conftest.c $i $extradeplibs # Did it work? if test $? -eq 0 ; then ldd_output=`ldd a.out` @@ -1838,8 +1839,8 @@ dld_preloaded_symbols[] = fi # Now compile the dynamic symbol file. - $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")" - $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $? + $show "(cd $objdir && $C_compiler -c$no_builtin_flag \"$dlsyms\")" + $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag "$dlsyms")' || exit $? # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"` -- 2.47.2