Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved]Safe CFLAGS for Coffee Lake?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
reikdas
Apprentice
Apprentice


Joined: 27 Nov 2018
Posts: 238

PostPosted: Wed Nov 28, 2018 12:38 pm    Post subject: [Solved]Safe CFLAGS for Coffee Lake? Reply with quote

I was not sure where to post this, but since I faced this while trying to install Gentoo I decided it might be a safe bet to post it here.

My CPU architecture is -
Code:
vendor_id   : GenuineIntel
cpu family   : 6
model      : 158
model name   : Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz


But there is no safe CFLAGS for this cpu in https://wiki.gentoo.org/wiki/Safe_CFLAGS page. Could you tell me what the CFLAG I should use is?(apart from -march=native)


Last edited by reikdas on Sun Dec 23, 2018 10:40 am; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 21780
Location: here

PostPosted: Wed Nov 28, 2018 12:51 pm    Post subject: Reply with quote

reikdas the better cflags usaully are -march=native -O2 -pipe, with native is gcc that check correct flag to enable for your cpu
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3961
Location: Dallas area

PostPosted: Wed Nov 28, 2018 12:55 pm    Post subject: Reply with quote

To see what native does

gcc -march=native -E -v - </dev/null 2>&1 | sed -n 's/.* -v - //p'
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7094
Location: Saint Amant, Acadiana

PostPosted: Wed Nov 28, 2018 12:56 pm    Post subject: Reply with quote

fedeliallalinea wrote:
reikdas the better cflags usaully are -march=native -O2 -pipe, with native is gcc that check correct flag to enable for your cpu

+1

When GCC gets upgraded your CPU may get even better support with -march=native and you are going to miss it with fixed CFLAGS.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
reikdas
Apprentice
Apprentice


Joined: 27 Nov 2018
Posts: 238

PostPosted: Wed Nov 28, 2018 12:58 pm    Post subject: Reply with quote

I was a little concerned because the page says -
Quote:
Warning
Do not use -march=native or -mtune=native in the CFLAGS or CXXFLAGS variables of make.conf when compiling with distcc. Consult the distcc page about how to set up CFLAGS/CXXFLAGS correctly.


And I was not sure whether I would ever need to use distcc.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7094
Location: Saint Amant, Acadiana

PostPosted: Wed Nov 28, 2018 1:01 pm    Post subject: Reply with quote

Kaby Lake hardly needs distcc help, you can use it as a helper for weaker machines, you can use -march=native in helper box.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13865

PostPosted: Thu Nov 29, 2018 2:57 am    Post subject: Reply with quote

reikdas wrote:
And I was not sure whether I would ever need to use distcc.
The warning applies at the time you actually use distcc. You can safely use -march=native today on a non-distcc system, then revisit the decision tomorrow if/when you add distcc.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5846

PostPosted: Thu Nov 29, 2018 5:00 am    Post subject: Reply with quote

This is what I'm using on kaby lake:

Code:
CFLAGS="-march=skylake -mabm -O2 -pipe"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"


kaby lake also supports sgx, but afaik nothing on linux uses it. what i do is run:

Code:
gcc -Q --help=target -march=skylake | grep enabled

gcc -Q --help=target -march=native | grep enabled


compare the two outputs, and add what's missing from skylake to CFLAGS.
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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