Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.15: build fails because missing sqrt() detection #369

Closed
kloczek opened this issue Mar 11, 2023 · 4 comments
Closed

2.15: build fails because missing sqrt() detection #369

kloczek opened this issue Mar 11, 2023 · 4 comments

Comments

@kloczek
Copy link

kloczek commented Mar 11, 2023

[tkloczko@pers-jacek x86_64-redhat-linux-gnu]$ ninja
[1/4] Linking target utils/samples/roundtrip
FAILED: utils/samples/roundtrip
/usr/bin/gcc  -o utils/samples/roundtrip utils/samples/roundtrip.p/roundtrip.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none '-Wl,-rpath,$ORIGIN/../../src' -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/Little-CMS-lcms2.15/x86_64-redhat-linux-gnu/src -Wl,--start-group src/liblcms2.so.2.0.15 -Wl,--end-group
/usr/bin/ld: /tmp/cccFX0fz.lto.o: undefined reference to symbol 'sqrt@@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
[3/4] Linking target utils/samples/wtpt
FAILED: utils/samples/wtpt
/usr/bin/gcc  -o utils/samples/wtpt utils/samples/wtpt.p/wtpt.c.o utils/samples/wtpt.p/.._common_vprf.c.o utils/samples/wtpt.p/.._common_xgetopt.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none '-Wl,-rpath,$ORIGIN/../../src' -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/Little-CMS-lcms2.15/x86_64-redhat-linux-gnu/src -Wl,--start-group src/liblcms2.so.2.0.15 -Wl,--end-group
/usr/bin/ld: /tmp/ccJqTE6T.lto.o: undefined reference to symbol 'sqrt@@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
ninja: build stopped: subcommand failed.

IIRC some parts of the libm on *BSD have been moved to libc so it cannot be just simple libm detection ad add missing -lm on linking.
Best would be use something like AC_SEARCH_LIBS() from autoconf however I cannot find something simillar in case of meson.

@mm2
Copy link
Owner

mm2 commented Mar 14, 2023

Thanks for reporting. I assume this only affects to meson build, which is sort of experimental right now.

@kloczek
Copy link
Author

kloczek commented Mar 14, 2023

I did not check GNU autotools and yes in this case it is about meson.

@eli-schwartz
Copy link

IIRC some parts of the libm on *BSD have been moved to libc so it cannot be just simple libm detection ad add missing -lm on linking.

It literally can be. :)

This was already detected and fixed in #362, by adding m_dep to additional targets that need it (already defined by the meson equivalent of AC_SEARCH_LIBS).

@mm2
Copy link
Owner

mm2 commented Jan 22, 2024

Cannot reproduce anymore

@mm2 mm2 closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants