diff options
author | L. E. Segovia <amy@amyspark.me> | 2022-10-30 13:05:40 +0000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2022-11-01 17:56:18 +0200 |
commit | 7e5b0760ce18666c7b1a42f97ca29ce03406e21b (patch) | |
tree | 1d38a4770efe0bd2be5da9bf67a712926d9f47a9 /mesonbuild | |
parent | 21f86fa90209538b1d9cc9aa3aaa1d8dc884137f (diff) | |
download | meson-7e5b0760ce18666c7b1a42f97ca29ce03406e21b.zip meson-7e5b0760ce18666c7b1a42f97ca29ce03406e21b.tar.gz meson-7e5b0760ce18666c7b1a42f97ca29ce03406e21b.tar.bz2 |
minstall: make do_strip run with -Sx for macOS targets
This commit also adds some extra symbol noise to lib.c, in order to aid
detection of the debug information with nm.
Fixes #10943
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/minstall.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py index 69763fa..8c74990 100644 --- a/mesonbuild/minstall.py +++ b/mesonbuild/minstall.py @@ -27,7 +27,7 @@ import typing as T from . import build from . import environment from .backend.backends import InstallData -from .mesonlib import MesonException, Popen_safe, RealPathAction, is_windows, setup_vsenv, pickle_load +from .mesonlib import MesonException, Popen_safe, RealPathAction, is_windows, setup_vsenv, pickle_load, is_osx from .scripts import depfixer, destdir_join from .scripts.meson_exe import run_exe try: @@ -566,7 +566,13 @@ class Installer: def do_strip(self, strip_bin: T.List[str], fname: str, outname: str) -> None: self.log(f'Stripping target {fname!r}.') - returncode, stdo, stde = self.Popen_safe(strip_bin + [outname]) + if is_osx(): + # macOS expects dynamic objects to be stripped with -x maximum. + #Â To also strip the debug info, -S must be added. + # See: https://www.unix.com/man-page/osx/1/strip/ + returncode, stdo, stde = self.Popen_safe(strip_bin + ['-S', '-x', outname]) + else: + returncode, stdo, stde = self.Popen_safe(strip_bin + [outname]) if returncode != 0: print('Could not strip file.\n') print(f'Stdout:\n{stdo}\n') |