diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-03 09:06:55 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-03 09:06:55 +0000 |
commit | c3ce66b01e47e99e429d17fb6df311852d2d5fc5 (patch) | |
tree | 9086bda0149c0c0178acfce160ac6deb805491fd /gcc/configure | |
parent | 9fe0e1b8f7411a3eaa3e4f96db117498975d36d2 (diff) | |
download | gcc-c3ce66b01e47e99e429d17fb6df311852d2d5fc5.tar.gz |
* configure.in (HAVE_LD_PIE): Check for ld -pie.
* config.in: Rebuilt.
* configure: Rebuilt.
* toplev.c (flag_pie, flag_shlib): New variables.
(f_options): Add -fpie and -fPIE.
(parse_options_and_default_flags): Set flag_pic if -fpie/-fPIE.
Set flag_shlib if flag_pic and not -fpie/-fPIE.
* flags.h (flag_pic, flag_shlib): Add.
* varasm.c (default_binds_local_p): Use flag_shlib instead of
flag_pic.
* gcc.c (LINK_PIE_SPEC): Define.
(LINK_COMMAND_SPEC): Use LINK_PIE_SPEC.
(option_map): Add --pie -> -pie mapping.
* config/sol2.h (ASM_SPEC): Handle -fpie the same way as -fpic
and -fPIE the same way as -fPIC.
* config/openbsd.h (ASM_SPEC): Likewise.
* config/frv/frv.h (ASM_SPEC): Likewise.
* config/arm/linux-gas.h (SUBTARGET_CPP_SPEC): Likewise.
* config/arm/semi.h (ASM_SPEC): Likewise.
* config/arm/netbsd-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise.
* config/freebsd-spec.h (FBSD_CPP_SPEC): Likewise.
* config/i386/beos-elf.h (CC1_SPEC): Likewise.
* config/i386/freebsd-aout.h (ASM_SPEC): Likewise.
* config/m68k/linux.h (CPP_SPEC): Likewise.
* config/m68k/netbsd.h (ASM_SPEC): Likewise.
* config/m68k/openbsd.h (ASM_SPEC): Likewise.
* config/m68k/netbsd-elf.h (ASM_SPEC): Likewise.
* config/mips/linux.h (SUBTARGET_CPP_SPEC): Likewise.
* config/mips/openbsd.h (SUBTARGET_ASM_SPEC): Likewise.
* config/pa/pa-linux.h (CPP_SPEC): Likewise.
* config/netbsd-aout.h (ASM_SPEC): Likewise.
* config/rs6000/sysv4.h (ASM_SPEC, CPP_SYSV_SPEC): Likewise.
* config/rs6000/vxworks.h (CPP_SPEC): Likewise.
* config/sparc/linux.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise.
* config/sparc/linux64.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise.
* config/sparc/sparc.h (ASM_SPEC): Likewise.
* config/sparc/sp64-elf.h (ASM_SPEC): Likewise.
* config/sparc/sysv4.h (ASM_SPEC): Likewise.
* config/sparc/netbsd-elf.h (ASM_SPEC): Likewise.
* config/sparc/openbsd64.h (ASM_SPEC): Likewise.
* config/cris/linux.h (CRIS_ASM_SUBTARGET_SPEC): Likewise.
* config/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Handle -pie.
Simplify.
* config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/i386/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/ia64/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/rs6000/sysv4.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/rs6000/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/sparc/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/sparc/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* doc/invoke.texi: Document -pie, -fpie and -fPIE options.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67359 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/configure')
-rwxr-xr-x | gcc/configure | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/gcc/configure b/gcc/configure index fe5e6b39f7a..c03bd4d179a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -8838,11 +8838,32 @@ EOF fi echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6 +echo $ac_n "checking linker position independent executable support""... $ac_c" 1>&6 +echo "configure:8843: checking linker position independent executable support" >&5 +gcc_cv_ld_pie=no +if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then + gcc_cv_ld_pie=yes + fi +elif test x$gcc_cv_ld != x; then + # Check if linker supports -pie option + if $gcc_cv_ld --help 2>/dev/null | grep -- -pie > /dev/null; then + gcc_cv_ld_pie=yes + fi +fi +if test x"$gcc_cv_ld_pie" = xyes; then + cat >> confdefs.h <<\EOF +#define HAVE_LD_PIE 1 +EOF + +fi +echo "$ac_t""$gcc_cv_ld_pie" 1>&6 + # Miscellaneous target-specific checks. case "$target" in mips*-*-*) echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6 -echo "configure:8846: checking whether libgloss uses STARTUP directives consistently" >&5 +echo "configure:8867: checking whether libgloss uses STARTUP directives consistently" >&5 gcc_cv_mips_libgloss_startup=no gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss if test "x$exec_prefix" = xNONE; then @@ -8870,7 +8891,7 @@ EOF echo "$ac_t""$gcc_cv_mips_libgloss_startup" 1>&6 echo $ac_n "checking whether the assembler has explicit relocation support""... $ac_c" 1>&6 -echo "configure:8874: checking whether the assembler has explicit relocation support" >&5 +echo "configure:8895: checking whether the assembler has explicit relocation support" >&5 if test x$gcc_cv_mips_explicit_relocs = x; then gcc_cv_mips_explicit_relocs=no if test x$gcc_cv_as != x; then @@ -9065,7 +9086,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:9069: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:9090: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" |