summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorHans Kristian Rosbach <hk-git@circlestorm.org>2021-01-11 18:44:09 +0100
committerHans Kristian Rosbach <hk-github@circlestorm.org>2021-01-11 21:37:33 +0100
commit1f5890d760ffeb6a37d94e027e5eb0e1b865d607 (patch)
tree5e303b5cb584756af16b4d4e94aff94554e55f13 /configure
parent446c6974fec0d3b8a55eef7ce36a249a9eb601ea (diff)
Disallow semantic interposition in ELF shared libraries if supported by the compiler.
This disallows calls to our own exported functions being replaced by LD_PRELOAD, thus avoiding the potential bugs and allowing the compiler to optimize better.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure b/configure
index b5a4462..945f6ba 100755
--- a/configure
+++ b/configure
@@ -856,6 +856,18 @@ else
leave 1
fi
+# Check for -fno-semantic-interposition compiler support
+echo "" > test.c
+ cat > $test.c <<EOF
+int main() { return 0; }
+EOF
+if test "$gcc" -eq 1 && ($cc $CFLAGS -fno-semantic-interposition -c $test.c) >> configure.log 2>&1; then
+ echo "Checking for -no-semantic-interposition... Yes." | tee -a configure.log
+ SFLAGS="$SFLAGS -fno-semantic-interposition"
+else
+ echo "Checking for -no-semantic-interposition... No." | tee -a configure.log
+fi
+
# see if we can hide zlib internal symbols that are linked between separate source files using hidden
if test "$gcc" -eq 1; then
echo >> configure.log