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

0.19.0 - not compile with Clang: undefined symbol: __readlinkat_alias #260

Open
AngryPenguinPL opened this issue Dec 28, 2024 · 3 comments

Comments

@AngryPenguinPL
Copy link

I'm trying to compile umockdev 0.19.0 using Clang 19.1.6 on OpenMandriva Cooker and I'm getting the compilation error below.
It's worth noting that previous versions of umockdev 0.18.x compile correctly with Clang.
Version 0.19.0 also compiles correctly with GCC.

 [38/55] /usr/bin/cc  -o libumockdev-preload.so.0.0.0 libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o libumockdev-preload.so.0.0.0.p/src_debug.c.o libumockdev-preload.so.0.0.0.p/src_utils.c.o libumockdev-preload.so.0.0.0.p/src_ioctl_tree.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libumockdev-preload.so.0 -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -fstack-protector-all --param=ssp-buffer-size=4 -m64 -mtune=generic -flto -Wl,-O2 -Wl,--no-undefined -flto -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -m64 -mtune=generic -flto -Wl,--start-group -ldl -lpthread -Wl,--end-group
DEBUG util.py:463:  FAILED: libumockdev-preload.so.0.0.0 
DEBUG util.py:463:  /usr/bin/cc  -o libumockdev-preload.so.0.0.0 libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o libumockdev-preload.so.0.0.0.p/src_debug.c.o libumockdev-preload.so.0.0.0.p/src_utils.c.o libumockdev-preload.so.0.0.0.p/src_ioctl_tree.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libumockdev-preload.so.0 -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -fstack-protector-all --param=ssp-buffer-size=4 -m64 -mtune=generic -flto -Wl,-O2 -Wl,--no-undefined -flto -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -m64 -mtune=generic -flto -Wl,--start-group -ldl -lpthread -Wl,--end-group
DEBUG util.py:463:  ld.lld: error: undefined symbol: __readlinkat_alias
DEBUG util.py:463:  >>> referenced by unistd.h:104 (/usr/include/bits/unistd.h:104)
DEBUG util.py:463:  >>>               libumockdev-preload.so.0.0.0.lto.o:(__readlinkat_chk)
DEBUG util.py:463:  cc: error: linker command failed with exit code 1 (use -v to see invocation)
@martinpitt
Copy link
Owner

Hello @AngryPenguinPL ! To bisect, the last commit that touched the preload lib was commit 284dcf1 , but that is already in 0.18.4 and really didn't change anything that would touch include files or readlinkat(). The previous one was commit 8cb6255 which was a bit more intrusive, but also not related to readlink, and already in 0.18.3 (from May).

So I take it that 0.18.3 or .4 also fail to build in your environment now, and it's due to some change in the build env, not a code change? (Note that there of course could still be a bug, but it's not a recent regression then)

@AngryPenguinPL
Copy link
Author

I re-checked the older version and it does indeed not compile. You are right.

The question remains, what is to blame? Clang 19.1.6?

@martinpitt
Copy link
Owner

Thanks for confirming! It's not really a matter of "blaming", it's probably a combination of clang and glibc changes that the preload doesn't get along with -- I haven't yet encountered __readlinkat_alias().

I tested a build on Fedora 41 x86_64 with clang-19.1.5-1.fc41.x86_64 and glibc-2.40-12.fc41.x86_64 and that works. So I can't easily reproduce/investigate this.

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

2 participants