+1999-03-06 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * 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 <gvaughan@oranda.demon.co.uk>
* ltconfig.in (cygwin, old_archive_from_new_cmds): no longer
};
/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt_preloaded_symbols;
}
+#endif
#ifdef __cplusplus
}
"
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}%"`