diff options
author | Jasper Lievisse Adriaanse <jasper@humppa.nl> | 2018-05-04 21:51:59 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-05-04 23:42:04 +0000 |
commit | 3729e127ffa078949bac358989cd54bd4a07825e (patch) | |
tree | fd3340633d1e896a5bb34b8aa0eafc0848d52e00 | |
parent | 2e0485bb9bc4f36783436b8a2e1689659ecaf52c (diff) | |
download | meson-3729e127ffa078949bac358989cd54bd4a07825e.tar.gz |
add linker flag to handle $ORIGIN on OpenBSD
-rw-r--r-- | mesonbuild/compilers/compilers.py | 4 | ||||
-rw-r--r-- | mesonbuild/mesonlib.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 02faed2ee..3d303c80d 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -909,10 +909,10 @@ class Compiler: else: paths = paths + ':' + padding args = [] - if mesonlib.is_dragonflybsd(): + if mesonlib.is_dragonflybsd() or mesonlib.is_openbsd(): # This argument instructs the compiler to record the value of # ORIGIN in the .dynamic section of the elf. On Linux this is done - # by default, but is not on dragonfly for some reason. Without this + # by default, but is not on dragonfly/openbsd for some reason. Without this # $ORIGIN in the runtime path will be undefined and any binaries # linked against local libraries will fail to resolve them. args.append('-Wl,-z,origin') diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 8a2b67c53..2a3b920be 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -308,6 +308,9 @@ def is_android(): def is_haiku(): return platform.system().lower() == 'haiku' +def is_openbsd(): + return platform.system().lower() == 'openbsd' + def is_windows(): platname = platform.system().lower() return platname == 'windows' or 'mingw' in platname |