Cross compiling libcap with the emerge wrappers fails if -march or -mtune is set to a value that the build arch compiler is not known. In the rules for the makefile the BUILD_CFLAGS are assigned with the CFLAGS for the target. IMHO the options -march and -mtune should be stripped. A patch that is working for me is attached. >>> Compiling source in /usr/armv5tej-softfloat-linux-gnueabi/tmp/portage/sys-libs/libcap-2.16-r1/work/libcap-2.16 ... make -j2 make -C libcap all make[1]: Entering directory `/usr/armv5tej-softfloat-linux-gnueabi/tmp/portage/sys-libs/libcap-2.16-r1/work/libcap-2.16/libcap' => making cap_names.list.h from /usr/armv5tej-softfloat-linux-gnueabi/tmp/portage/sys-libs/libcap-2.16-r1/work/libcap-2.16/libcap/../libcap/include/linux/capability.h perl -e 'while ($l=<>) { if ($l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$/) { $tok=$1; $val=$2; $tok =~ tr/A-Z/a-z/; print "{\"$tok\",$val},\n"; } }' /usr/armv5tej-softfloat-linux-gnueabi/tmp/portage/sys-libs/libcap-2.16-r1/work/libcap-2.16/libcap/../libcap/include/linux/capability.h | fgrep -v 0x > cap_names.list.h i686-pc-linux-gnu-gcc -ggdb -Os -pipe -march=armv5te -mtune=arm926ej-s -fomit-frame-pointer -I/usr/armv5tej-softfloat-linux-gnueabi/usr/include/ -I/usr/armv5tej-softfloat-linux-gnueabi/include/ -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -fPIC -I/usr/armv5tej-softfloat-linux-gnueabi/tmp/portage/sys-libs/libcap-2.16-r1/work/libcap-2.16/libcap/../libcap/include -I/usr/armv5tej-softfloat-linux-gnueabi/tmp/portage/sys-libs/libcap-2.16-r1/work/libcap-2.16/libcap/../libcap/include _makenames.c -o _makenames perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($l = <>) { $l =~ s/[\{\"]//g; $l =~ s/\}.*// ; print $l; }' < cap_names.list.h | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 > _caps_output.gperf _makenames.c:1: error: bad value (armv5te) for -march= switch _makenames.c:1: error: bad value (arm926ej-s) for -mtune= switch make[1]: *** [_makenames] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/usr/armv5tej-softfloat-linux-gnueabi/tmp/portage/sys-libs/libcap-2.16-r1/work/libcap-2.16/libcap' make: *** [all] Error 2 Reproducible: Always Steps to Reproduce:
Created attachment 193429 [details, diff] cross compile with emerge wrappers and march or mtune option as cflags
Created attachment 193431 [details, diff] diff between original and edited ebuild
Please add a build log, emerge --info, and tell us for what arch you are cross-compiling.
Upstream fixed it in r2511 now. Should I set Resolve bug, changing resolution to upstream ?? Issue #1986 has been updated by stbuehler. Status changed from New to Fixed % Done changed from 40 to 100 Applied in changeset r2511. ---------------------------------------- Feature #1986: add posibility to activate pcre when cross-compiling http://redmine.lighttpd.net/issues/1986
march/mtune are not special in any way ... plenty of other flags will break things simply add `export BUILD_CFLAGS=${BUILD_CFLAGS}` to src_compile
Okay. But is this the right solution to add it manually? Should this be added in the ebuild if cross compiling is not working?
probably fixed now with: http://sources.gentoo.org/sys-libs/libcap/files/2.16/0001-build-system-fixes.patch?r1=1.2&r2=1.3