Skip to content

Commit 1523262

Browse files
committed
build: Add missing flags for x86 asm support
1 parent 042473e commit 1523262

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

meson.build

+12-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ cpp_lib = '-lstdc++'
5757
libm_dep = cpp.find_library('m', required : false)
5858
deps += [libm_dep]
5959

60+
# https://github.com/cisco/openh264/issues/2534
61+
if cpu_family == 'x86'
62+
c_args += ['-DX86_32_PICASM']
63+
cpp_args += ['-DX86_32_PICASM']
64+
asm_args += ['-DX86_32_PICASM']
65+
endif
66+
6067
if ['linux', 'android', 'ios', 'darwin'].contains(system)
6168
asm_format32 = 'elf'
6269
asm_format64 = 'elf64'
@@ -199,11 +206,15 @@ subdir ('test')
199206

200207
libopenh264 = library('openh264',
201208
link_whole: [libcommon, libprocessing, libencoder, libdecoder],
209+
# failsafe for ASM relocations
210+
link_args: cpp.get_supported_link_arguments(['-Wl,-Bsymbolic', '-Wl,-z,notext']),
202211
install: true,
203212
soversion: major_version,
204213
version: meson.project_version(),
205214
vs_module_defs: 'openh264.def',
206-
dependencies: deps)
215+
dependencies: deps,
216+
pic: true
217+
)
207218

208219
openh264_dep = declare_dependency(
209220
link_with: libopenh264,

0 commit comments

Comments
 (0)