Skip to content

Commit 8077206

Browse files
committed
build: Add missing flags for x86 asm support
1 parent 8c7008a commit 8077206

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

meson.build

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ cpp_lib = '-lstdc++'
5959
libm_dep = cpp.find_library('m', required : false)
6060
deps += [libm_dep]
6161

62+
# https://github.com/cisco/openh264/issues/2534
63+
if cpu_family == 'x86'
64+
c_args += ['-DX86_32_PICASM']
65+
cpp_args += ['-DX86_32_PICASM']
66+
asm_args += ['-DX86_32_PICASM']
67+
endif
68+
6269
if ['linux', 'android', 'ios', 'darwin'].contains(system)
6370
asm_format32 = 'elf'
6471
asm_format64 = 'elf64'
@@ -195,11 +202,15 @@ subdir ('test')
195202

196203
libopenh264 = library('openh264',
197204
link_whole: [libcommon, libprocessing, libencoder, libdecoder],
205+
# failsafe for ASM relocations
206+
c_link_args: cpp.get_supported_link_arguments(['-Wl,-Bsymbolic', '-Wl,-z,notext']),
198207
install: true,
199208
soversion: major_version,
200209
version: meson.project_version(),
201210
vs_module_defs: 'openh264.def',
202-
dependencies: deps)
211+
dependencies: deps,
212+
pic: true
213+
)
203214

204215
openh264_dep = declare_dependency(
205216
link_with: libopenh264,

0 commit comments

Comments
 (0)