Merge pull request #5917 from alanc/solaris-fixes

Solaris fixes
pull/5924/head
Jussi Pakkanen 5 years ago committed by GitHub
commit 9e04450eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      mesonbuild/environment.py
  2. 8
      mesonbuild/mesonlib.py
  3. 2
      test cases/common/131 generated assembly/square-x86_64.S.in
  4. 24
      test cases/linuxlike/14 static dynamic linkage/meson.build

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

@ -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()]

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

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

Loading…
Cancel
Save