diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-09-14 05:50:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-14 05:50:41 +0300 |
commit | 9e04450eb694c91dcb097a388c7bf4ecc7290545 (patch) | |
tree | 1c12131fb21a3c26ab52447a6c14f0949affc169 | |
parent | 47bdea504067d00e9bed522e9575bd2416bfe4ee (diff) | |
parent | 3e0279ba9f3a5b7e9cf4f37bc7329a5b9f5f95ed (diff) | |
download | meson-9e04450eb694c91dcb097a388c7bf4ecc7290545.zip meson-9e04450eb694c91dcb097a388c7bf4ecc7290545.tar.gz meson-9e04450eb694c91dcb097a388c7bf4ecc7290545.tar.bz2 |
Merge pull request #5917 from alanc/solaris-fixes
Solaris fixes
-rw-r--r-- | mesonbuild/environment.py | 2 | ||||
-rw-r--r-- | mesonbuild/mesonlib.py | 8 | ||||
-rw-r--r-- | test cases/common/131 generated assembly/square-x86_64.S.in | 2 | ||||
-rw-r--r-- | test cases/linuxlike/14 static dynamic linkage/meson.build | 24 |
4 files changed, 29 insertions, 7 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index b3885b6..e67e744 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -745,7 +745,7 @@ class Environment: else: i = 'GNU ld.bfd' linker = GnuDynamicLinker(compiler, for_machine, i, prefix, version=v) - elif 'Solaris' in e: + elif 'Solaris' in e or 'Solaris' in o: linker = SolarisDynamicLinker( compiler, for_machine, 'solaris', prefix, version=search_version(e)) diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index d5646ed..03fbf02 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -708,6 +708,14 @@ def get_library_dirs() -> typing.List[str]: else: plat = '' + # Solaris puts 32-bit libraries in the main /lib & /usr/lib directories + # and 64-bit libraries in platform specific subdirectories. + if is_sunos(): + if machine == 'i86pc': + plat = 'amd64' + elif machine.startswith('sun4'): + plat = 'sparcv9' + usr_platdir = Path('/usr/lib/') / plat if usr_platdir.is_dir(): unixdirs += [str(x) for x in (usr_platdir).iterdir() if x.is_dir()] diff --git a/test cases/common/131 generated assembly/square-x86_64.S.in b/test cases/common/131 generated assembly/square-x86_64.S.in index 856af13..b2cf3eb 100644 --- a/test cases/common/131 generated assembly/square-x86_64.S.in +++ b/test cases/common/131 generated assembly/square-x86_64.S.in @@ -19,7 +19,7 @@ END .text .globl SYMBOL_NAME(square_unsigned) /* Only supported with GAS */ -# if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) +# if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun) .type square_unsigned,@function # endif diff --git a/test cases/linuxlike/14 static dynamic linkage/meson.build b/test cases/linuxlike/14 static dynamic linkage/meson.build index a529f33..fb0e353 100644 --- a/test cases/linuxlike/14 static dynamic linkage/meson.build +++ b/test cases/linuxlike/14 static dynamic linkage/meson.build @@ -1,22 +1,36 @@ project('static dynamic', 'c') +# Solaris does not ship static libraries +if host_machine.system() == 'sunos' + has_static = false +else + has_static = true +endif cc = meson.get_compiler('c') z_default = cc.find_library('z') -z_static = cc.find_library('z', static: true) +if has_static + z_static = cc.find_library('z', static: true) +endif z_dynamic = cc.find_library('z', static: false) exe_default = executable('main_default', 'main.c', dependencies: [z_default]) -exe_static = executable('main_static', 'main.c', dependencies: [z_static]) +if has_static + exe_static = executable('main_static', 'main.c', dependencies: [z_static]) +endif exe_dynamic = executable('main_dynamic', 'main.c', dependencies: [z_dynamic]) test('test default', exe_default) -test('test static', exe_static) +if has_static + test('test static', exe_static) +endif test('test dynamic', exe_dynamic) -test('verify static linking', find_program('verify_static.py'), - args: ['--platform=' + host_machine.system(), exe_static.full_path()]) +if has_static + test('verify static linking', find_program('verify_static.py'), + args: ['--platform=' + host_machine.system(), exe_static.full_path()]) +endif test('verify dynamic linking', find_program('verify_static.py'), args: ['--platform=' + host_machine.system(), exe_dynamic.full_path()], should_fail: true) |