Basic support for PIE (position-independent executables).

* libltdl/config/ltmain.m4sh (func_generate_dlsyms):
Don't pass PIE flag for compilation of the symbol file object.
* NEWS: Updated.
This commit is contained in:
Ralf Wildenhues 2005-12-03 08:48:15 +00:00
parent 1ef097dbf6
commit 33c0290e19
3 changed files with 29 additions and 6 deletions

View File

@ -1,9 +1,18 @@
2005-12-03 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* libltdl/config/general.m4sh (func_show_eval):
Rewrite use the failure expression, because the exit status of
the previous command may not be preserved in the next `eval' by
some shells, such as pdksh.
Basic support for PIE (position-independent executables).
* libltdl/config/ltmain.m4sh (func_generate_dlsyms):
Don't pass PIE flag for compilation of the symbol file object.
(func_mode_compile): Pass PIE flag only for non-PIC objects.
* NEWS: Updated.
2005-12-03 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* libltdl/config/general.m4sh (func_show_eval): Rewrite use of
the failure expression, because the exit status of the previous
command may not be preserved in the next `eval' by some shells,
such as pdksh.
* libltdl/config/ltmain.m4sh (func_extract_an_archive):
Use func_show_eval correctly.
(func_mode_link): Likewise. Also, do not use `$status'.

1
NEWS
View File

@ -29,6 +29,7 @@ New in 1.9h: 2005-??-??; CVS version 2.1a, Libtool team:
* Fixed a branch-1-5/HEAD regression to only link uninstalled libraries
statically with `-static'.
* Support for Interix 3 (Windows SFU).
* Basic support for PIE (position-independent executables).
* Bug fixes.
New in 1.9f: 2004-10-23; CVS version 1.9e, Libtool team:

View File

@ -968,9 +968,16 @@ static const void *lt_preloaded_setup() {
esac
;;
esac
symtab_cflags=
for arg in $LTCFLAGS; do
case $arg in
-pie | -fpie | -fPIE) ;;
*) symtab_cflags="$symtab_cflags $arg" ;;
esac
done
# Now compile the dynamic symbol file.
func_show_eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
# Clean up the generated files.
func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
@ -1108,6 +1115,7 @@ func_mode_compile ()
arg_mode=normal
libobj=
later=
pie_flag=
for arg
do
@ -1134,6 +1142,11 @@ func_mode_compile ()
continue
;;
-pie | -fpie | -fPIE)
pie_flag="$pie_flag $arg"
continue
;;
-shared | -static | -prefer-pic | -prefer-non-pic)
later="$later $arg"
continue
@ -1423,7 +1436,7 @@ EOF
if test "$build_old_libs" = yes; then
if test "$pic_mode" != yes; then
# Don't build PIC code
command="$base_compile $qsrcfile"
command="$base_compile $qsrcfile$pie_flag"
else
command="$base_compile $qsrcfile $pic_flag"
fi