add linker flag to handle $ORIGIN on OpenBSD

pull/3320/merge
Jasper Lievisse Adriaanse 7 years ago committed by Nirbheek Chauhan
parent 2e0485bb9b
commit 3729e127ff
  1. 4
      mesonbuild/compilers/compilers.py
  2. 3
      mesonbuild/mesonlib.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')

@ -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

Loading…
Cancel
Save