From: Alexandre Oliva Date: Sat, 6 Mar 1999 19:26:20 +0000 (+0000) Subject: * ltmain.in (freebsd): compile symbol table file with pic_flag X-Git-Tag: release-1-2f~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fadc0b85a8c2bffe0507e9f44eb6a42f9764e434;p=thirdparty%2Flibtool.git * ltmain.in (freebsd): compile symbol table file with pic_flag only on FreeBSD and when not static linking; it's been causing trouble on platforms such as OpenBSD. --- diff --git a/ChangeLog b/ChangeLog index 0726a38a1..5bff1d9ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-03-06 Alexandre Oliva + + * ltmain.in (freebsd): compile symbol table file with pic_flag + only on FreeBSD and when not static linking; it's been causing + trouble on platforms such as OpenBSD. + 1999-02-26 Gary V. Vaughan * libtool.m4 (cygwin): s/\\(mingw\\|cygwin\\)32/\\1/g. Must've diff --git a/ltmain.in b/ltmain.in index ac434d3d8..52cba89a0 100644 --- a/ltmain.in +++ b/ltmain.in @@ -2389,9 +2389,11 @@ lt_preloaded_symbols[] = }; /* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } +#endif #ifdef __cplusplus } @@ -2399,10 +2401,22 @@ static const void *lt_preloaded_setup() { " fi + pic_flag_for_symtable= + case "$host" in + # compiling the symbol table file with pic_flag works around a + # FreeBSD bug that causes programs to crash when -lm is linked + # before any other PIC object. But we must not use pic_flag + # when linking with -static. + *-*-freebsd*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; + esac + esac + # Now compile the dynamic symbol file. - # pic_flag works around a bug in FreeBSD linker - $show "(cd $objdir && $C_compiler -c$no_builtin_flag $pic_flag -DPIC \"$dlsyms\")" - $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag $pic_flag -DPIC "$dlsyms")' || exit $? + $show "(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`