Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CFLAGS/CXXFLAGS vs. CPU_FLAGS_X86
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
luz
n00b
n00b


Joined: 17 Jul 2018
Posts: 5

PostPosted: Tue Jul 17, 2018 5:04 am    Post subject: CFLAGS/CXXFLAGS vs. CPU_FLAGS_X86 Reply with quote

Hi everyone, I'm new to Gentoo. I installed without setting CPU_FLAGS_X86. Does that mean I got basic x86_64 binaries even though my CFLAGS and CXXFLAGS were set to -march=skylake-avx512 ? I'm dreading reinstalling as it takes an entire day even on a fast machine but it will be necessary if that's the case; the whole reason I'm using Gentoo is to get the optimizations, otherwise I'd have stayed with Arch. Without CPU_FLAGS_X86 being set, do CFLAGS/CXXFLAGS even matter? Or vice versa, if I'm using -march=skylake-avx512 do I get the optimizations regardless of what CPU_FLAGS_X86 is set to? The apparent redundancy of these settings and the apparent need for both (why?) are doing my head in, any help would be appreciated a lot.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 5950
Location: Room 101

PostPosted: Tue Jul 17, 2018 5:50 am    Post subject: Reply with quote

luz wrote:
Does that mean I got basic x86_64 binaries even though my CFLAGS and CXXFLAGS were set to -march=skylake-avx512

luz ... no, CFLAGS will be passed to practically all packages, but CPU_FLAGS_X86 will only effect a few packages ... so, those with sse*, mmx, etc, optimizations available:

Code:
% for i in $(egrep '^CPU_FLAGS_X86' /etc/portage/make.conf | cut -d '"' -f2) ; do eix --only-names --exact --installed-with-use cpu_flags_x86_$i ; done | sort -u
app-i18n/uchardet
dev-libs/openssl
media-libs/flac
media-libs/imlib2
media-libs/libpng
media-libs/libvpx
media-libs/libwebp
media-libs/x264
media-video/ffmpeg
x11-libs/pixman

If you felt inclined you could remerge the effected packages with the following (requires app-portage/eix):

Code:
# emerge --oneshot --ask $(for i in $(egrep '^CPU_FLAGS_X86' /etc/portage/make.conf | cut -d '"' -f2) ; do eix --only-names --exact --installed-without-use cpu_flags_x86_$i ; done | sort -u)


Edit: s/with/without

welcome to gentoo & best ... khay


Last edited by khayyam on Tue Jul 17, 2018 6:05 am; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 19235
Location: here

PostPosted: Tue Jul 17, 2018 5:54 am    Post subject: Reply with quote

CPU_FLAGS_X86 should have no influence on the CFLAGS/CXXFLAG optimization added with march because is a use_exapnd and is for enable some optimization on packages.
Then you can set CPU_FLAGS_X86 and run
Code:
# emerge -UD --with-bdeps y @world

for rebuild packages that have these use flags

EDIT: luz welcome to Gentoo forum!
_________________
Questions are guaranteed in life; Answers aren't.


Last edited by fedeliallalinea on Tue Jul 17, 2018 7:05 am; edited 2 times in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 5950
Location: Room 101

PostPosted: Tue Jul 17, 2018 6:15 am    Post subject: Reply with quote

fedeliallalinea wrote:
Code:
# emerge -UD --with-bdeps y @world

fedeliallalinea, luz ... '-U,--changed-use' is probably a better option to what I'd suggested ... doh!!

best ... khay
Back to top
View user's profile Send private message
luz
n00b
n00b


Joined: 17 Jul 2018
Posts: 5

PostPosted: Tue Jul 17, 2018 11:20 am    Post subject: Reply with quote

Thanks, everyone! Much appreciated.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 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