too long lines were shrinked: bash mkversion.sh creating version.h creating man-page clang -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int -Wno-unused-result -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I. -I. -c globals.c -o build/globals.o clang -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int -Wno-unused-result -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I. -I. -shared -g -fPIC idev.c -o idev.so -lcrypto -lmd -lm -lpthread clang -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int -Wno-unused-result -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I. -I. -shared -fPIC tapetest.c -o tapetest.so -lcrypto -lmd -lm -lpthread idev.c:55:15: error: clang -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int -Wno-unused-result -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I. -I. -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__ expected identifier or '(' 55 | int LIBC_OPEN(const char *path, int oflag, ...) ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 23.0_llvm-20240825-084454 UNMASKED: Requested by sam /etc/portage/package.unmask/50unstable:>=sys-libs/ncurses-6.5 The attached etc.portage.tar.xz has all details. ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-13 * clang/llvm (if any): clang version 18.1.8+libcxx Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/18/bin Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg /usr/lib/llvm/18 18.1.8+libcxx Python 3.12.5 Available Rust versions: [1] rust-bin-1.80.1 [2] rust-1.80.1 * The following VMs are available for generation-2: 1) Eclipse Temurin JDK 11.0.24_p8 [openjdk-bin-11] 2) Eclipse Temurin JDK 17.0.12_p7 [openjdk-bin-17] *) Eclipse Temurin JDK 21.0.4_p7 [openjdk-bin-21] 4) Eclipse Temurin JDK 8.422_p05 [openjdk-bin-8] Available Java Virtual Machines: [1] openjdk-bin-8 [2] openjdk-bin-11 [3] openjdk-bin-17 [4] openjdk-bin-21 system-vm The Glorious Glasgow Haskell Compilation System, version 9.2.8 php cli (if any): go version go1.23.0 linux/amd64 HEAD of ::gentoo commit a72ce254e94b4fcd7518f4371b07c1cdb8d931eb Author: Repository mirror & CI <repomirrorci@gentoo.org> Date: Thu Aug 29 11:04:19 2024 +0000 2024-08-29 11:04:18 UTC emerge -qpvO =sys-block/mbuffer-20240707 [ebuild N ] sys-block/mbuffer-20240707 USE="ssl -debug -test"
Created attachment 901556 [details] emerge-info.txt
Created attachment 901557 [details] emerge-history.txt
Created attachment 901558 [details] environment
Created attachment 901559 [details] etc.clang.tar.xz
Created attachment 901560 [details] etc.portage.tar.xz
Created attachment 901561 [details] logs.tar.xz
Created attachment 901562 [details] qlist-info.txt.xz
Created attachment 901563 [details] sys-block:mbuffer-20240707:20240829-115021.log
Created attachment 901564 [details] temp.tar.xz
Created attachment 901565 [details] var.tmp.clang.tar.xz
I'm reproducing this. Also on an llvm-glibc profile. Working fine on llvm-musl.
in configure.ac, AC_MSG_CHECKING([linking open() and write() to detect libc names]) # clang -g -O2 -lcrypto -lmd -lm -lpthread a.c # objdump -T a.out a.out: file format elf64-x86-64 DYNAMIC SYMBOL TABLE: 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.2.5) write 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.7) __open_2 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.34) __libc_start_main 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.4) __stack_chk_fail 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.33) fstat 0000000000000000 w D *UND* 0000000000000000 Base _ITM_deregisterTMCloneTable 0000000000000000 w D *UND* 0000000000000000 Base __gmon_start__ 0000000000000000 w D *UND* 0000000000000000 Base _ITM_registerTMCloneTable 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.4) __read_chk 0000000000000000 w DF *UND* 0000000000000000 (GLIBC_2.2.5) __cxa_finalize # gcc -g -O2 -lcrypto -lmd -lm -lpthread a.c # objdump -T a.out a.out: file format elf64-x86-64 DYNAMIC SYMBOL TABLE: 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.2.5) write 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.2.5) open 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.34) __libc_start_main 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.4) __stack_chk_fail 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.2.5) read 0000000000000000 DF *UND* 0000000000000000 (GLIBC_2.33) fstat 0000000000000000 w D *UND* 0000000000000000 Base _ITM_deregisterTMCloneTable 0000000000000000 w D *UND* 0000000000000000 Base __gmon_start__ 0000000000000000 w D *UND* 0000000000000000 Base _ITM_registerTMCloneTable 0000000000000000 w DF *UND* 0000000000000000 (GLIBC_2.2.5) __cxa_finalize for clang with -O2, read is optimized away & open is changed to __open_2, so LIBC_OPEN and LIBC_READ become null don't know howto pass -O0 to AC_LINK_IFELSE don't know the reason to test the name of open/read either.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69fee45923a0a9b2734f3bb150a1f576499904b0 commit 69fee45923a0a9b2734f3bb150a1f576499904b0 Author: Z. Liu <zhixu.liu@gmail.com> AuthorDate: 2025-01-15 10:15:37 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-18 17:34:27 +0000 sys-block/mbuffer: fix build failure w/ clang use "-O0" to compile the feature test code Closes: https://bugs.gentoo.org/938689 Signed-off-by: Z. Liu <zhixu.liu@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/40141 Signed-off-by: Sam James <sam@gentoo.org> .../mbuffer-20240107-O0-for-libc-name-find.patch | 38 ++++++++++++++++++++++ sys-block/mbuffer/mbuffer-20240107.ebuild | 1 + sys-block/mbuffer/mbuffer-20240707.ebuild | 1 + sys-block/mbuffer/mbuffer-20241007.ebuild | 1 + 4 files changed, 41 insertions(+)