libxkcommon tries to build a host tool using CC_FOR_BUILD and environment CFLAGS. This fails if CFLAGS contain -march or -mtune Reproducible: Always Steps to Reproduce: 1. emerge libxkbcommon # for non-host target 2. 3. Actual Results: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I/build/x86-wayland/tmp/portage/x11-libs/libxkbcommon-0.0.0_alpha1/work/libxkbcommon-0.0.0_alpha1/makekeys -I../src -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -Wbad-function-cast -Wformat=2 -Wold-style-definition -Wdeclaration-after-statement -O2 -pipe -march=atom -mtune=atom -mfpmath=sse -ggdb -fvisibility=hidden -c /build/x86-wayland/tmp/portage/x11-libs/libxkbcommon-0.0.0_alpha1/work/libxkbcommon-0.0.0_alpha1/makekeys/makekeys.c /build/x86-wayland/tmp/portage/x11-libs/libxkbcommon-0.0.0_alpha1/work/libxkbcommon-0.0.0_alpha1/makekeys/makekeys.c:1: error: bad value (atom) for -march= switch /build/x86-wayland/tmp/portage/x11-libs/libxkbcommon-0.0.0_alpha1/work/libxkbcommon-0.0.0_alpha1/makekeys/makekeys.c:1: error: bad value (atom) for -mtune= switch /build/x86-wayland/tmp/portage/x11-libs/libxkbcommon-0.0.0_alpha1/work/libxkbcommon-0.0.0_alpha1/makekeys/makekeys.c:1: warning: SSE instruction set disabled, using 387 arithmetics make[1]: *** [makekeys.o] Error 1 Expected Results: Successful emerge.
Created attachment 289169 [details, diff] ebuild.patch
Please only CC: maintainers when explicitly requested to. The developer assigning the bug will handle CC: as necessary.
I am not convinced that this is the correct solution. Are you really using emerge or the crossdev CTARGET-emerge wrapper and PORTAGE_CONFIGROOT containing a make.conf with proper CFLAGS?
I'm using the the crossdev CTARGET-emerge wrapper (or something close to it). In make.conf for the target, my CFLAGS contain -march=atom and -mtune=atom. However, my host is amd64.
i think this is the right idea, but it needs more love: cat <<\EOF >> makekeys/Makefile.am CFLAGS = $(BUILD_CFLAGS) CPPFLAGS = $(BUILD_CPPFLAGS) LDFLAGS = $(BUILD_LDFLAGS) EOF and the toplevel configure.ac should setup these BUILD_xxx vars like it does for CC_FOR_BUILD alternatively, if the src/ks_tables.h is always the same across targets (i.e. it depends on other local headers), that should be a file that gets distributed with the tarball, and then the cross-compile logic can be dropped.
Looks like this was removed in upstream commit 5fff637e07d75b24f778210e7838ee9667810806. Marking as UPSTREAM.