Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cross emerge gcc with which -march?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
gabord
n00b
n00b


Joined: 17 Sep 2018
Posts: 3

PostPosted: Mon Sep 17, 2018 6:10 am    Post subject: Cross emerge gcc with which -march? Reply with quote

Hi,

I would like to cross emerge gcc with the following command (and -march=armv8-a+crc set) on an amd64 build machine, but I get an error message.

Code:
aarch64-unknown-linux-gnu-emerge gcc


Code:
cc1plus: error: bad value (‘armv8-a+crc’) for ‘-march=’ switch
cc1plus: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server bonnell atom silvermont slm knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 native


Every other package compiles correctly (around ~200), except this.
If I set -march to be the build architecture, gcc cross emerges, but none of the other packages do. I do not think this is a correct behavior for gcc, because -march means the target architecture, and not the build architecture, isn't it?
Which CFLAGS should I use?


The same thing happens with gcc-7.3.0-r3 and 8.2.0-r2.
My /usr/aarch64-unknown-linux-gnu/etc/portage/make.conf file:
Code:
ROOT=/usr/aarch64-unknown-linux-gnu/
ACCEPT_KEYWORDS="~arm64"
CFLAGS="-march=armv8-a+crc -O2 -pipe"
CXXFLAGS="${CFLAGS}"
PORTAGE_TMPDIR=${ROOT}var/tmp/


Full build log: https://pastebin.com/bbWiZF6y
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Mon Sep 17, 2018 7:35 am    Post subject: Reply with quote

gabord,

Welcome to Gentoo.

Do not set -march at all, just for gcc, while it is cross compiled.
The output gcc will run on any arm64 system and will itself obey the -march= when you run it on the target.

You can have portage set per package CFLAGS using both /etc/portage/env/ and /etc/portage/package.env/

-- edit --

That's the /usr/aarch64-unknown-linux-gnu/ ... files.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
gabord
n00b
n00b


Joined: 17 Sep 2018
Posts: 3

PostPosted: Mon Sep 17, 2018 7:50 am    Post subject: Reply with quote

NeddySeagoon wrote:
Welcome to Gentoo.

Thanks!

NeddySeagoon wrote:
Do not set -march at all, just for gcc, while it is cross compiled.

I will do that. What is the reason for this? Can I read about that in detail why gcc needs does this for cross compile? I tried to find information about the toolchain eclass, but could not find any.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Mon Sep 17, 2018 7:54 am    Post subject: Reply with quote

gabord,

The simple answer is that its a feature of the gcc build system.
Leaving out -march is a workaround, not a fix.

If you want to save some build time, I have a an arm64 BINHOST that is publicly accessible.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
gabord
n00b
n00b


Joined: 17 Sep 2018
Posts: 3

PostPosted: Mon Sep 17, 2018 6:52 pm    Post subject: Reply with quote

NeddySeagoon wrote:
gabord,

The simple answer is that its a feature of the gcc build system.
Leaving out -march is a workaround, not a fix.

If you want to save some build time, I have a an arm64 BINHOST that is publicly accessible.


Thanks! And I will look into it in detail in the future why this is a feature, but it is not important now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum