Skip to content

Commit f8dbadf

Browse files
committed
Link the math library in the native test envs
Codec 2 is floating point throughout and pulls in expf, cosf, sqrtf, atan2f, log10f and sincosf. glibc keeps those in libm, so the native suites failed to link on Linux. MSYS2 folds them into libc, which is why it passed locally.
1 parent 38b2835 commit f8dbadf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

platformio.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
src_dir = src
1717

1818
[env]
19-
build_flags = -I src
19+
; -lm because glibc keeps the math library separate. Codec 2 is float throughout
20+
; and pulls in expf, cosf, sqrtf, atan2f, log10f and sincosf; MSYS2 folds those
21+
; into libc, so leaving it off still links on Windows and nowhere else.
22+
build_flags = -I src -lm
2023
; The library under test lives in src/; pio test skips src_dir without this.
2124
test_build_src = yes
2225

0 commit comments

Comments
 (0)