Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 272479 - sys-libs/libcap-2.16-r1: cross compiling not working if -march or -mtune is set
Summary: sys-libs/libcap-2.16-r1: cross compiling not working if -march or -mtune is set
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-03 17:46 UTC by Markus Rathgeb
Modified: 2009-10-11 01:30 UTC (History)
1 user (show)

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


Attachments
cross compile with emerge wrappers and march or mtune option as cflags (cross-combile-cflags.patch,406 bytes, patch)
2009-06-03 17:47 UTC, Markus Rathgeb
Details | Diff
diff between original and edited ebuild (libcap-2.16-r1.ebuild.diff,333 bytes, patch)
2009-06-03 17:48 UTC, Markus Rathgeb
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Rathgeb 2009-06-03 17:46:10 UTC
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:
Comment 1 Markus Rathgeb 2009-06-03 17:47:44 UTC
Created attachment 193429 [details, diff]
cross compile with emerge wrappers and march or mtune option as cflags
Comment 2 Markus Rathgeb 2009-06-03 17:48:14 UTC
Created attachment 193431 [details, diff]
diff between original and edited ebuild
Comment 3 Víctor Ostorga (RETIRED) gentoo-dev 2009-06-07 22:13:26 UTC
Please add a build log, emerge --info, and tell us for what arch you are
cross-compiling.
Comment 4 Markus Rathgeb 2009-06-08 05:07:00 UTC
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
Comment 5 SpanKY gentoo-dev 2009-06-08 19:28:48 UTC
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
Comment 6 Markus Rathgeb 2009-09-09 19:26:46 UTC
Okay.

But is this the right solution to add it manually?
Should this be added in the ebuild if cross compiling is not working?