https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: sys-firmware/seabios-1.16.0 fails to compile (CLANG-STRICTER-SYSTEM). Discovered on: amd64 (internal ref: clang-stricter_tinderbox) NOTE: (CLANG-STRICTER-SYSTEM) in the summary means that the bug was found on a machine that runs clang with stricter mode This machine uses clang with CFLAGS/CXXFLAGS=-Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-function-pointer-types See also: https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240 https://wiki.gentoo.org/wiki/Modern_C_porting
Created attachment 843617 [details] build.log build log and emerge --info
The actual errors are odd, to say the least: clang -Iout/ -Isrc -Os -MD -g -Wall -Wno-strict-aliasing -Wold-style-definition -Wtype-limits -m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 -minline-all-stringops -fomit-frame-pointer -freg-struct-return -ffreestanding -fno-delete-null-pointer-checks -ffunction-sections -fdata-sections -fno-common -fno-merge-constants -fno-pie -fno-stack-protector -Wno-address-of-packed-member -fcf-protection=none -DMODE16=0 -DMODESEGMENT=0 -c src/pnpbios.c -o out/src/pnpbios.o clang-15: error: unknown argument: '-mpreferred-stack-boundary=2' clang-15: warning: optimization flag '-fno-merge-constants' is not supported [-Wignored-optimization-argument] clang-15: warning: optimization flag '-fno-defer-pop' is not supported [-Wignored-optimization-argument] make: *** [Makefile:137: out/src/asm-offsets.s] Error 1 make: *** Waiting for unfinished jobs.... clang-15clang-15clang-15clang-15: : : : error: error: error: error: unknown argument: '-mpreferred-stack-boundary=2'unknown argument: '-mpreferred-stack-boundary=2'unknown argument: '-mpreferred-stack-boundary=2'unknown argument: '-mpreferred-stack-boundary=2' clang-15clang-15clang-15clang-15clang-15: : clang-15: : : : error: error: error: error: error: error: unknown argument: '-mpreferred-stack-boundary=2'unknown argument: '-mpreferred-stack-boundary=2'unknown argument: '-mpreferred-stack-boundary=2'unknown argument: '-mpreferred-stack-boundary=2'unknown argument: '-mpreferred-stack-boundary=2' unknown argument: '-mpreferred-stack-boundary=2'
Not sure how to get the mangled output that the tinderbox produced, but I can indeed get: clang -Iout/ -Isrc -Os -MD -g -Wall -Wno-strict-aliasing -Wold-style-definition -Wtype-limits -m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 -minline-all-stringops -fomit-frame-pointer -freg-struct-return -ffreestanding -fno-delete-null-pointer-checks -ffunction-sections -fdata-sections -fno-common -fno-merge-constants -fno-pie -fno-stack-protector -Wno-address-of-packed-member -fcf-protection=none -DMODE16=0 -DMODESEGMENT=0 -c src/misc.c -o out/src/misc.o clang-15: error: unknown argument: '-mpreferred-stack-boundary=2' clang-15: warning: optimization flag '-fno-merge-constants' is not supported [-Wignored-optimization-argument] make: *** [Makefile:141: out/src/misc.o] Error 1 * ERROR: sys-firmware/seabios-1.16.0::gentoo failed (compile phase): * emake failed
Seems this fails with vanilla CFLAGS too, so just a "regular" clang issue.
Looks like MaskRay has already done some work on this upstream :) But, those patches might not fix it all the way: "Note that clang still does not build due to other reasons: (1) probable misuse of constraint code 'Q': (2) clang cannot handle a typeof on GNU expression statement extension. I haven't investigated whether it is a clang bug."
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98689cf8710dff1e89f69bbc6991db16d2edd901 commit 98689cf8710dff1e89f69bbc6991db16d2edd901 Author: Z. Liu <zhixu.liu@gmail.com> AuthorDate: 2025-04-05 02:13:25 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-04-10 09:54:08 +0000 sys-firmware/seabios: force compiler to gcc known incompatiable to clang are: * error: unknown argument: '-mpreferred-stack-boundary=2' * error: invalid input size for constraint 'Q' (inline asm) so force gcc is obviously an easy option until upstream support clang Closes: https://bugs.gentoo.org/887115 Signed-off-by: Z. Liu <zhixu.liu@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> sys-firmware/seabios/seabios-1.16.3.ebuild | 10 ++++++++++ 1 file changed, 10 insertions(+)