Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 887115 - sys-firmware/seabios-1.16.0 fails to compile with clang: error: unknown argument: -mpreferred-stack-boundary=2
Summary: sys-firmware/seabios-1.16.0 fails to compile with clang: error: unknown argum...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthias Maier
URL: https://mail.coreboot.org/hyperkitty/...
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2022-12-19 08:11 UTC by Agostino Sarubbo
Modified: 2022-12-22 04:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,72.78 KB, text/plain)
2022-12-19 08:11 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-12-19 08:11:53 UTC
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
Comment 1 Agostino Sarubbo gentoo-dev 2022-12-19 08:11:55 UTC
Created attachment 843617 [details]
build.log

build log and emerge --info
Comment 2 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-12-22 03:53:02 UTC
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'
Comment 3 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-12-22 04:43:12 UTC
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
Comment 4 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-12-22 04:46:26 UTC
Seems this fails with vanilla CFLAGS too, so just a "regular" clang issue.
Comment 5 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-12-22 04:51:57 UTC
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."