From 655137a74b366a3c03df24cedeafa747787f15f5 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 12 Nov 2017 21:47:08 +0200 Subject: [PATCH] Add headerpad linker argument on OSX. --- mesonbuild/compilers/c.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 9e857127f..021f5d734 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -18,6 +18,7 @@ from .. import mlog from .. import coredata from ..mesonlib import EnvironmentException, version_compare, Popen_safe, listify from ..mesonlib import for_windows, for_darwin, for_cygwin +from . import compilers from .compilers import ( GCC_MINGW, @@ -811,6 +812,12 @@ class ClangCCompiler(ClangCompiler, CCompiler): def get_option_link_args(self, options): return [] + def get_linker_always_args(self): + basic = super().get_linker_always_args() + if self.clang_type == compilers.CLANG_OSX: + return basic + ['-Wl,-headerpad_max_install_names'] + return basic + class GnuCCompiler(GnuCompiler, CCompiler): def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None):