Skip to content

Commit f232c83

Browse files
evverxmrc0mmand
authored andcommitted
tests: link tests using fabs against libm explicitly
Some compiler wrappers like honggfuzz pass -fno-builtin explicitly and because of that the tests where fabs is used fail to compile with something like ``` FAILED: test-bus-marshal ... /usr/bin/ld: test-bus-marshal.p/src_libsystemd_sd-bus_test-bus-marshal.c.o: undefined reference to symbol 'fabs@@GLIBC_2.2.5' /usr/bin/ld: /usr/lib64/libm.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status ``` Fun fact: it took honggfuzz less than a minute to discover GHSA-gmc7-pqv9-966m used by systemd to compress/descompress some stuff.
1 parent 2581dbc commit f232c83

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/libsystemd/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ tests += [
222222
libglib,
223223
libgobject,
224224
libgio,
225-
libdbus]],
225+
libdbus,
226+
libm]],
226227

227228
[files('sd-bus/test-bus-signature.c'),
228229
[],

src/test/meson.build

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ tests += [
211211

212212
[files('test-mkdir.c')],
213213

214-
[files('test-json.c')],
214+
[files('test-json.c'),
215+
[],
216+
[libm]],
215217

216218
[files('test-modhex.c')],
217219

@@ -275,7 +277,9 @@ tests += [
275277

276278
[files('test-parse-helpers.c')],
277279

278-
[files('test-parse-util.c')],
280+
[files('test-parse-util.c'),
281+
[],
282+
[libm]],
279283

280284
[files('test-sysctl-util.c')],
281285

0 commit comments

Comments
 (0)