Skip to content

Commit

Permalink
meson: parse depends on pthread
Browse files Browse the repository at this point in the history
Fix link issue on Ubuntu 20.04

$ ninja
[32/33] Linking target parse.
FAILED: parse
cc  -o parse 'parse@exe/meson-generated_tokenparser.c.o' 'parse@exe/src_parse.c.o' 'parse@exe/src_debug.c.o' 'parse@exe/src_ccid_usb.c.o' 'parse@exe/src_sys_unix.c.o' 'parse@exe/src_strlcpy.c.o' 'parse@exe/src_simclist.c.o' -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group /usr/lib/x86_64-linux-gnu/libusb-1.0.so /usr/lib/x86_64-linux-gnu/libz.so -Wl,--end-group
/usr/bin/ld: parse@exe/src_ccid_usb.c.o: undefined reference to symbol 'pthread_join@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
[33/33] Generating Info.plist with a meson_exe.py custom command.
ninja: build stopped: subcommand failed.

Thanks to Peter Helcmanovsky for the bug report and patch.
  • Loading branch information
LudovicRousseau committed Jun 17, 2024
1 parent 583ca08 commit 7ae4a5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pcsc_dep = dependency('libpcsclite')
pcsc_cflags = pcsc_dep.partial_dependency(compile_args : true)
libusb_dep = dependency('libusb-1.0')
zlib_dep = dependency('zlib')
threads_dep = dependency('threads')

r = run_command('uname', check: true)
pcsc_arch = r.stdout().strip()
Expand Down Expand Up @@ -144,7 +145,7 @@ parse_src += gen_src
executable('parse',
parse_src,
include_directories : ['src'],
dependencies : [libusb_dep, pcsc_cflags, zlib_dep],
dependencies : [libusb_dep, pcsc_cflags, zlib_dep, threads_dep],
)

# scardcontrol
Expand Down

0 comments on commit 7ae4a5c

Please sign in to comment.