Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add linker flag to handle $ORIGIN on OpenBSD #3530

Merged
merged 1 commit into from
May 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions mesonbuild/compilers/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,10 @@ def build_unix_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, i
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')
Expand Down
3 changes: 3 additions & 0 deletions mesonbuild/mesonlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down