Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 448206

Summary: flag-o-matic.eclass: `CHOST=${CTARGET} strip-unsupported-flags` doesn't strip flags
Product: Gentoo Linux Reporter: Dennis Schridde <dschridde+gentoobugs>
Component: EclassesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: alonbl, henrique.ribeiro.dias, sven.koehler, toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 461874    
Attachments: cross-spu-elf-info.log
cross-spu-elf-newlib.log.xz
newlib-config.logs.tar.xz

Description Dennis Schridde 2012-12-22 18:37:47 UTC
spu-elf-gcc -B/var/tmp/portage/cross-spu-elf/newlib-2.0.0/work/build/spu-elf/newlib/ -isystem /var/tmp/portage/cross-spu-elf/newlib-2.0.0/work/build/spu-elf/newlib/targ-include -isystem /var/tmp/portage/cross-spu-elf/newlib-2.0.0/work/newl
ib-2.0.0/newlib/libc/include -B/var/tmp/portage/cross-spu-elf/newlib-2.0.0/work/build/spu-elf/libgloss/spu -L/var/tmp/portage/cross-spu-elf/newlib-2.0.0/work/build/spu-elf/libgloss/libnosys -L/var/tmp/portage/cross-spu-elf/newlib-2.0.0/wor
k/newlib-2.0.0/libgloss/spu    -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.0.0\" -DPACKAGE_STRING=\"newlib\ 2.0.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I/var/tmp/portage/cross-spu-elf/newlib-2.
0.0/work/newlib-2.0.0/newlib/libc/misc -D_POSIX_MODE -DREENTRANT_SYSCALLS_PROVIDED -DMISSING_SYSCALL_NAMES -ffunction-sections -fdata-sections  -D__SINGLE_THREAD__ -DMISSING_SYSCALL_NAMES -fno-builtin      -g -pipe -O2 -march=opteron-sse3 
-c -o lib_a-fini.o `test -f 'fini.c' || echo '/var/tmp/portage/cross-spu-elf/newlib-2.0.0/work/newlib-2.0.0/newlib/libc/misc/'`fini.c
make[5]: *** [lib_a-__dprintf.o] Error 1
make[5]: *** Waiting for unfinished jobs....
/var/tmp/portage/cross-spu-elf/newlib-2.0.0/work/newlib-2.0.0/newlib/libc/misc/unctrl.c:1:0: error: bad value (opteron-sse3) for -march= switch
/var/tmp/portage/cross-spu-elf/newlib-2.0.0/work/newlib-2.0.0/newlib/libc/misc/ffs.c:1:0: error: bad value (opteron-sse3) for -march= switch
/var/tmp/portage/cross-spu-elf/newlib-2.0.0/work/newlib-2.0.0/newlib/libc/misc/init.c:1:0: error: bad value (opteron-sse3) for -march= switch

Reproducible: Always
Comment 1 Dennis Schridde 2012-12-22 18:39:05 UTC
Created attachment 333060 [details]
cross-spu-elf-info.log
Comment 2 Dennis Schridde 2012-12-22 18:39:15 UTC
Created attachment 333062 [details]
cross-spu-elf-newlib.log.xz
Comment 3 Dennis Schridde 2012-12-22 18:39:25 UTC
Created attachment 333064 [details]
newlib-config.logs.tar.xz
Comment 4 Dennis Schridde 2012-12-22 18:39:51 UTC
P.S: I ran
# crossdev -oO /var/cache/portage/local spu-elf
Comment 5 Dennis Schridde 2012-12-23 20:52:33 UTC
Same thing using crossdev-20120913 from ambro-cross overlay.
Comment 6 SpanKY gentoo-dev 2012-12-28 16:45:07 UTC
*** Bug 449046 has been marked as a duplicate of this bug. ***
Comment 7 Sven 2012-12-28 18:25:16 UTC
I don't understand the subject line, but is it intended, that the CFLAGS for the cross-compiles code derived from the ordinary CFLAGS variable just by stripping some of the flags?

Is there a way to override the CFLAGS for cross-compiled code explicitly? I.e. use -Os for cross-compiled code (libstdc++, libgcc, etc.) and -O2 for code that runs on the host (e.g. gcc compiler binary)?
Comment 8 Dennis Schridde 2012-12-29 11:11:48 UTC
(In reply to comment #7)
> I don't understand the subject line, but is it intended, that the CFLAGS for
> the cross-compiles code derived from the ordinary CFLAGS variable just by
> stripping some of the flags?
That is what I wondered, too. I would expect portage to use the CFLAGS from /usr/${CHOST}/etc/portage/make.conf when cross-compiling for ${CHOST}, i.e. compiling a cross-${CHOST}/pkg package...
Comment 9 SpanKY gentoo-dev 2012-12-31 20:13:27 UTC
*** Bug 449468 has been marked as a duplicate of this bug. ***
Comment 10 SpanKY gentoo-dev 2013-01-07 17:18:12 UTC
*** Bug 450670 has been marked as a duplicate of this bug. ***
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2019-10-23 18:34:23 UTC
cross-*/ packages are normally merged by host's portage into ROOT=/. libc arguably should never be merged by host's portage. But it's not how crossdev operates today (we'll fix it one day).

Thus today's behaviour is aggressive host flags cleanup in cross-* ebuilds.

Does it still fail to remove host's -march= today?
Comment 12 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-28 13:23:20 UTC
newlib ebuilds should work just fine nowadays. https://bugs.gentoo.org/642604 will move libc out of cross-*/ post portage longer term.