Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 528544 - sys-libs/newlib-2.1.0 compiled with host computer CFLAGS
Summary: sys-libs/newlib-2.1.0 compiled with host computer CFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-07 09:15 UTC by Florian Kluge
Modified: 2015-05-19 12:31 UTC (History)
2 users (show)

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


Attachments
emerge --info (einfo,5.26 KB, text/plain)
2014-11-07 09:15 UTC, Florian Kluge
Details
Newlib build log (cross-arm-none-eabi-newlib.log,330.55 KB, text/plain)
2014-11-07 09:15 UTC, Florian Kluge
Details
Newlib build log with debug information (log.bz2,71.40 KB, application/x-bzip)
2015-05-18 19:45 UTC, Florian Kluge
Details
Newlib build log with debug information (log,521.01 KB, text/plain)
2015-05-19 08:40 UTC, Florian Kluge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Kluge 2014-11-07 09:15:12 UTC
Created attachment 388746 [details]
emerge --info

I tried to create an arm-none-eabi cross toolchain on my netbook. While this worked on my PCs (amd64), there are some issues on the netbook (x86). Despite fixing the make.conf, compilation of newlib still fails. The problem seems to be here that emerge seems to use the host system's /etc/portage/make.conf instead of the one created by crossdef at /usr/arm-none-eabi/etc/portage/make.conf. This leads to arm-none-eabi-gcc being called with unrecognised options in the CFLAGS.
Comment 1 Florian Kluge 2014-11-07 09:15:40 UTC
Created attachment 388748 [details]
Newlib build log
Comment 2 Florian Kluge 2014-11-07 09:16:56 UTC
I have reported the fix to make.conf in bug report 528542.
Comment 3 SpanKY gentoo-dev 2015-05-18 16:35:16 UTC
the target make.conf is irrelevant here.  this is a cross-xxx package which is, by design, installed in ROOT=/.

the newlib itself specifically attempts to filter out incompatible flags:
  CHOST=${CTARGET} strip-unsupported-flags

please run `emerge cross-arm-none-eabi/newlib --debug >& log` and attach the log file here for us to figure out.
Comment 4 Florian Kluge 2015-05-18 19:45:34 UTC
Created attachment 403574 [details]
Newlib build log with debug information

This is the build log with the patch mentioned above integrated in my system. Unfortunately, I had to compress the file.
Comment 5 SpanKY gentoo-dev 2015-05-19 04:56:37 UTC
your CFLAGS were stripped correctly:
+ CFLAGS='-O2 -pipe -ggdb'

your CXXFLAGS were not because you don't have a arm-none-eabi-g++, so it used g++ instead:
+ CXXFLAGS='-march=core2 -mtune=generic -O2 -pipe -ggdb'

however, that shouldn't really matter as newlib doesn't have C++, so it shouldn't be checking CXXFLAGS at all.

all that said, your first log doesn't match your 2nd (first uses -march=atom while 2nd uses -march=core2), and your 2nd shows it actually passing, not failing:
>>> Completed installing newlib-2.2.0 into /var/tmp/portage/cross-arm-none-eabi/newlib-2.2.0/image/

so please post a log that matches & shows build failures.
Comment 6 Florian Kluge 2015-05-19 08:40:46 UTC
Created attachment 403608 [details]
Newlib build log with debug information

Sorry for the wrong log file - now here's the one from the correct machine (building of newlib fails).
Comment 7 SpanKY gentoo-dev 2015-05-19 09:35:53 UTC
(In reply to Florian Kluge from comment #6)

have you hardcoded `CC=gcc` on your system ?  the log shows:

++ cmdline=($(tc-get${comp}) -Werror -c -o /dev/null)
+++ tc-getCC
+++ tc-getPROG CC gcc
+++ _tc-getPROG CHOST CC gcc
+++ local tuple=CHOST
+++ local v var vars=CC
+++ local prog=gcc
+++ var=CC
+++ for v in '${vars}'
+++ [[ -n gcc ]]
+++ export CC=gcc
+++ CC=gcc
+++ echo gcc
+++ return 0

if you have, then that's invalid, so shouldn't be surprised when it fails ;)
Comment 8 Florian Kluge 2015-05-19 12:31:19 UTC
Yes, I had CC=gcc in make.conf. This was a relic from some experiments with distcc. Removing these settings allowed for a proper installation. Thanks for your help!