commit
9e04450eb6
|
@ -745,7 +745,7 @@ class Environment:
|
||||||
else:
|
else:
|
||||||
i = 'GNU ld.bfd'
|
i = 'GNU ld.bfd'
|
||||||
linker = GnuDynamicLinker(compiler, for_machine, i, prefix, version=v)
|
linker = GnuDynamicLinker(compiler, for_machine, i, prefix, version=v)
|
||||||
elif 'Solaris' in e:
|
elif 'Solaris' in e or 'Solaris' in o:
|
||||||
linker = SolarisDynamicLinker(
|
linker = SolarisDynamicLinker(
|
||||||
compiler, for_machine, 'solaris', prefix,
|
compiler, for_machine, 'solaris', prefix,
|
||||||
version=search_version(e))
|
version=search_version(e))
|
||||||
|
|
|
@ -708,6 +708,14 @@ def get_library_dirs() -> typing.List[str]:
|
||||||
else:
|
else:
|
||||||
plat = ''
|
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
|
usr_platdir = Path('/usr/lib/') / plat
|
||||||
if usr_platdir.is_dir():
|
if usr_platdir.is_dir():
|
||||||
unixdirs += [str(x) for x in (usr_platdir).iterdir() if x.is_dir()]
|
unixdirs += [str(x) for x in (usr_platdir).iterdir() if x.is_dir()]
|
||||||
|
|
|
@ -19,7 +19,7 @@ END
|
||||||
.text
|
.text
|
||||||
.globl SYMBOL_NAME(square_unsigned)
|
.globl SYMBOL_NAME(square_unsigned)
|
||||||
/* Only supported with GAS */
|
/* 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
|
.type square_unsigned,@function
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,36 @@
|
||||||
project('static dynamic', 'c')
|
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')
|
cc = meson.get_compiler('c')
|
||||||
|
|
||||||
z_default = cc.find_library('z')
|
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)
|
z_dynamic = cc.find_library('z', static: false)
|
||||||
|
|
||||||
exe_default = executable('main_default', 'main.c', dependencies: [z_default])
|
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])
|
exe_dynamic = executable('main_dynamic', 'main.c', dependencies: [z_dynamic])
|
||||||
|
|
||||||
test('test default', exe_default)
|
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('test dynamic', exe_dynamic)
|
||||||
|
|
||||||
test('verify static linking', find_program('verify_static.py'),
|
if has_static
|
||||||
args: ['--platform=' + host_machine.system(), exe_static.full_path()])
|
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'),
|
test('verify dynamic linking', find_program('verify_static.py'),
|
||||||
args: ['--platform=' + host_machine.system(), exe_dynamic.full_path()],
|
args: ['--platform=' + host_machine.system(), exe_dynamic.full_path()],
|
||||||
should_fail: true)
|
should_fail: true)
|
||||||
|
|
Loading…
Reference in New Issue