Skip to content

does not compile with Clang on OpenMandriva Cooker: undefined symbol: __readlinkat_alias #260

Open

Description

@AngryPenguinPL

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)

Activity

  1. martinpitt commented on Dec 28, 2024

    @martinpitt
    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)

  2. AngryPenguinPL commented on Dec 29, 2024

    @AngryPenguinPL
    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?

  3. martinpitt commented on Dec 30, 2024

    @martinpitt
    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.

  4. martinpitt commented on Jan 5, 2025

    @martinpitt
    Owner

    Debian has clang 19.1.6 (Fedora 41 only has 19.1.5). But CC=clang meson setup c && meson test -C c also works. This is also glibc 2.40, similar to F41.

    What glibc version are you using? Do you have a reproducer in a container?

  5. changed the title [-]0.19.0 - not compile with Clang: undefined symbol: __readlinkat_alias[/-] [+]does not compile with Clang on OpenMandriva Cooker: undefined symbol: __readlinkat_alias[/+] on Jan 5, 2025
  6. RossComputerGuy commented on Jan 19, 2025

    @RossComputerGuy

    This is reproducible with Nixpkgs / NixOS via running nix build github:NixOS/nixpkgs#pkgsLLVM.umockdev. We've got glibc-2.40.

  7. PIPIPIG233666 commented on May 24, 2026

    @PIPIPIG233666

    Still having the undefined symbol on llvm 22

    clang version 22.1.6+libcxx
    Target: x86_64-pc-linux-gnu
    Thread model: posix
    InstalledDir: /usr/lib/llvm/22/bin
    Configuration file: /etc/clang/22/x86_64-pc-linux-gnu-clang.cfg
    

    /var/tmp/portage/dev-util/umockdev-0.19.7-r1/temp/build.log

    ld.lld: error: undefined symbol: __readlinkat_alias
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Edit: GCC-16 works

  8. unhappy-ending commented on Jul 14, 2026

    @unhappy-ending

    Hello. Bumped into this issue on a Gentoo system using the LLVM toolchain. It seems passing -O* to clang causes the failure. Clang compiles umockdev as long as -O isn't passed.

  9. added a commit that references this issue on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions