aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Schmidt <github@mschmidt.me>2017-07-04 13:34:30 +0200
committerMichael Schmidt <github@mschmidt.me>2017-07-04 13:34:30 +0200
commit3767f3c0a7a18623db7a419f4a30c7f0c4898372 (patch)
treef86d0f94603f70886112474bfdc73c91861d9586
parent01bac827fe4731155e5e8f9f5e9702a6c4a2a128 (diff)
downloadcompcert-kvx-3767f3c0a7a18623db7a419f4a30c7f0c4898372.tar.gz
compcert-kvx-3767f3c0a7a18623db7a419f4a30c7f0c4898372.zip
add check for -no-pie at configure-time
-rwxr-xr-xconfigure30
1 files changed, 30 insertions, 0 deletions
diff --git a/configure b/configure
index 43109e04..0680e593 100755
--- a/configure
+++ b/configure
@@ -153,6 +153,7 @@ target=${target#[a-zA-Z0-9]*-}
# Per-target configuration
+clinker_needs_no_pie=true
asm_supports_cfi=""
casm_options=""
casmruntime=""
@@ -223,6 +224,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__"
@@ -305,6 +307,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=""
@@ -356,6 +359,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=""
@@ -423,6 +427,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
@@ -736,6 +765,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