Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 386181 - [x11-overlay] x11-libs/libxkbcommon: doesn't x-compile when CFLAGS contains -m*
Summary: [x11-overlay] x11-libs/libxkbcommon: doesn't x-compile when CFLAGS contains -m*
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 23:58 UTC by Mandeep Singh Baines
Modified: 2013-02-05 07:11 UTC (History)
4 users (show)

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


Attachments
ebuild.patch (ebuild.patch,435 bytes, patch)
2011-10-08 00:00 UTC, Mandeep Singh Baines
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mandeep Singh Baines 2011-10-07 23:58:16 UTC
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.
Comment 1 Mandeep Singh Baines 2011-10-08 00:00:32 UTC
Created attachment 289169 [details, diff]
ebuild.patch
Comment 2 Chí-Thanh Christopher Nguyễn gentoo-dev 2011-10-08 00:03:41 UTC
Please only CC: maintainers when explicitly requested to.

The developer assigning the bug will handle CC: as necessary.
Comment 3 Chí-Thanh Christopher Nguyễn gentoo-dev 2011-10-08 12:10:06 UTC
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?
Comment 4 Mandeep Singh Baines 2011-10-10 17:32:12 UTC
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.
Comment 5 SpanKY gentoo-dev 2012-02-03 15:43:32 UTC
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.
Comment 6 Matt Turner gentoo-dev 2013-02-05 07:11:34 UTC
Looks like this was removed in upstream commit 5fff637e07d75b24f778210e7838ee9667810806. Marking as UPSTREAM.