aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2024-01-29 10:09:25 +0000
committerIain Sandoe <iain@sandoe.co.uk>2024-02-02 15:46:33 +0000
commit639bd5e9b759a6d733fadbd5f956889d965e9368 (patch)
tree3abfa66a8c03441aa7f8696da3c538ca9968a570 /gcc
parentae061a1757b2c76ddf4cc2c84b433fe1cd6dd7f7 (diff)
downloadgcc-639bd5e9b759a6d733fadbd5f956889d965e9368.zip
gcc-639bd5e9b759a6d733fadbd5f956889d965e9368.tar.gz
gcc-639bd5e9b759a6d733fadbd5f956889d965e9368.tar.bz2
testsuite, Darwin: Allow for undefined symbols in shared test.
Darwin's linker defaults to error on undefined (which makes it look as if we do not support shared, leading to tests being marked incorrectly as unsupported). This fixes the issue by allowing the symbols used in the target supports test to be undefined. gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_shared): Allow the external symbols referenced in the test to be undefined.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/lib/target-supports.exp9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 8aefb32..f66dcaa 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1385,6 +1385,13 @@ proc check_effective_target_aarch64_tlsle32 { } {
# emitted, 0 otherwise.
proc check_effective_target_shared { } {
+ # Darwin's linker defaults to error on undefined (which makes it look as
+ # if we do not support shared) but we can tell it to allow the symbols used
+ # here to be undefined.
+ set extra_flags ""
+ if { [istarget *-*-darwin\[912\]*] } {
+ set extra_flags "-Wl,-U,_foo,-U,_bar"
+ }
# Note that M68K has a multilib that supports -fpic but not
# -fPIC, so we need to check both. We test with a program that
# requires GOT references, and with a libc symbol that would
@@ -1397,7 +1404,7 @@ proc check_effective_target_shared { } {
char *baz (void) {
return foo () + (char*) malloc (bar);
}
- } "-shared -fpic"]
+ } "-shared -fpic $extra_flags"]
}
# Return 1 if -pie, -fpie and -fPIE are supported, 0 otherwise.