diff options
-rwxr-xr-x | configure | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -157,6 +157,7 @@ target=${target#[a-zA-Z0-9]*-} # Per-target configuration +clinker_needs_no_pie=true asm_supports_cfi="" casm_options="" casmruntime="" @@ -227,6 +228,7 @@ if test "$arch" = "powerpc"; then casm="${toolprefix}das" casm_options="-Xalign-value" cc="${toolprefix}dcc" + clinker_needs_no_pie=false clinker="${toolprefix}dcc" cprepro="${toolprefix}dcc" cprepro_options="-E -D__GNUC__" @@ -309,6 +311,7 @@ if test "$arch" = "x86" -a "$bitsize" = "32"; then casm_options="-arch i386 -c" cc="${toolprefix}gcc -arch i386" clinker="${toolprefix}gcc" + clinker_needs_no_pie=false cprepro="${toolprefix}gcc" cprepro_options="-std=c99 -arch i386 -U__GNUC__ -U__clang__ -U__BLOCKS__ '-D__attribute__(x)=' '-D__asm(x)=' '-D_Nullable=' '-D_Nonnull=' -E" libmath="" @@ -360,6 +363,7 @@ if test "$arch" = "x86" -a "$bitsize" = "64"; then casm_options="-arch x86_64 -c" cc="${toolprefix}gcc -arch x86_64" clinker="${toolprefix}gcc" + clinker_needs_no_pie=false cprepro="${toolprefix}gcc" cprepro_options="-std=c99 -arch x86_64 -U__GNUC__ -U__clang__ -U__BLOCKS__ '-D__attribute__(x)=' '-D__asm(x)=' '-D_Nullable=' '-D_Nonnull=' -E" libmath="" @@ -427,6 +431,31 @@ fi # +# Test Availability of Option '-no-pie' +# +if ($clinker_needs_no_pie) then + echo "Testing linker support for '-no-pie' option... " | tr -d '\n' + fx=/tmp/compcert-configure-$$.elf + rm -f $fx + f=/tmp/compcert-configure-$$.c + rm -f $f + cat >> $f <<EOF +int main (void) +{ + return 0; +} +EOF + $cc -no-pie -o $fx $f >/dev/null 2>&1 + status=$? + if [ $status -eq 0 ] + then echo "yes"; clinker_options="${clinker_options} -no-pie" + else echo "no"; clinker_needs_no_pie=false + fi + rm -f $f $fx +fi + + +# # Test Availability of Required Tools # missingtools=false @@ -744,6 +773,7 @@ CompCert configuration: Assembler supports CFI........ $asm_supports_cfi Assembler for runtime lib..... $casmruntime Linker........................ $clinker + Linker needs '-no-pie'........ $clinker_needs_no_pie Math library.................. $libmath Binaries installed in......... $bindirexp Runtime library provided...... $has_runtime_lib |