aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2019-08-02 20:27:06 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-08-04 21:45:40 +0300
commit32bd8a384779dcd8ef6d3b8815d8dac43d96b9eb (patch)
tree0529f1642bfa412704fcfd7db21fb74b1bf34823
parent8ba14057421928b15a485214ac7023d246bfab7c (diff)
downloadmeson-32bd8a384779dcd8ef6d3b8815d8dac43d96b9eb.zip
meson-32bd8a384779dcd8ef6d3b8815d8dac43d96b9eb.tar.gz
meson-32bd8a384779dcd8ef6d3b8815d8dac43d96b9eb.tar.bz2
Fix cross compilation on OSX
Do not set -Wl,-headerpad_max_install_names when compiling on OSX for another platform. It causes linker issues.
-rw-r--r--mesonbuild/compilers/compilers.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 3b61e61..179756a 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1050,7 +1050,7 @@ class Compiler:
if not rpath_paths and not install_rpath and not build_rpath:
return []
args = []
- if mesonlib.is_osx():
+ if get_compiler_is_osx_compiler(self):
# Ensure that there is enough space for install_name_tool in-place editing of large RPATHs
args.append('-Wl,-headerpad_max_install_names')
# @loader_path is the equivalent of $ORIGIN on macOS
@@ -1078,7 +1078,7 @@ class Compiler:
# linked against local libraries will fail to resolve them.
args.append('-Wl,-z,origin')
- if mesonlib.is_osx():
+ if get_compiler_is_osx_compiler(self):
# macOS does not support colon-separated strings in LC_RPATH,
# hence we have to pass each path component individually
args += ['-Wl,-rpath,' + rp for rp in all_paths]
@@ -1234,6 +1234,10 @@ def get_compiler_is_linuxlike(compiler):
compiler_type = getattr(compiler, 'compiler_type', None)
return compiler_type and compiler_type.is_standard_compiler
+def get_compiler_is_osx_compiler(compiler):
+ compiler_type = getattr(compiler, 'compiler_type', None)
+ return compiler_type and compiler_type.is_osx_compiler
+
def get_compiler_uses_gnuld(c):
# FIXME: Perhaps we should detect the linker in the environment?
# FIXME: Assumes that *BSD use GNU ld, but they might start using lld soon