aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-25 08:01:21 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-26 23:16:04 +0530
commit4be8e71fb380a0541b69992539a0695ea29b3205 (patch)
tree7b3f63436bd5ad5d8af2b438399240068deafcc5 /mesonbuild/compilers.py
parenta06178f58fa91293d59a63313a733ac1bb043854 (diff)
downloadmeson-4be8e71fb380a0541b69992539a0695ea29b3205.zip
meson-4be8e71fb380a0541b69992539a0695ea29b3205.tar.gz
meson-4be8e71fb380a0541b69992539a0695ea29b3205.tar.bz2
has_function: Try to use the function being checked
Simply placing a reference to it isn't enough for the linker to try and think it's being used and do a symbol availability check with -Wl,-no_weak_imports on OS X ld.
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 7e73636..2a89cf0 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -920,9 +920,9 @@ int main(int argc, char **argv) {
"""
# Add the 'prefix', aka defines, includes, etc that the user provides
head = '#include <limits.h>\n{0}\n'
- # We don't know what the function takes or returns, so just add
- # a useless reference to it
- main = '\nint main() {{ {1}; }}'
+ # We don't know what the function takes or returns, so try to use it as
+ # a function pointer
+ main = '\nint main() {{ int a = (int) &{1}; }}'
return head, main
def has_function(self, funcname, prefix, env, extra_args=None, dependencies=None):