Jump to content

Photo

CPU Flags

- - - - -

7 replies to this topic

#1
Oleg Vinichenko

Oleg Vinichenko

    Staff

  • Moderators
  • 366 posts
Hello, everyone.
 
The USE flags corresponding to the instruction sets and other features specific to the x86 (including x86-64) architecture are being moved into a separate USE flag group called CPU_FLAGS_X86.
 
In order not to lose CPU-specific optimizations, users will be required to update their make.conf (and package.use) file. For example, if the following USE flags were present:
 
USE="mmx mmxext sse sse2 sse3"
 
Those flags need to be copied into:
 
CPU_FLAGS_X86="mmx mmxext sse sse2 sse3"
 
Please note that the same CPU_FLAGS_X86 variable is used both on 32-bit and 64-bit x86 (amd64) systems.
When in doubt, you can consult the flag descriptions using one of the commonly available tools, e.g. ''equery uses'' from gentoolkit:
 
equery uses media-video/ffmpeg
 
Most of the flag names match /proc/cpuinfo names, with the notable exception of SSE3 which is called 'pni' in /proc/cpuinfo (please also do not confuse it with distinct SSSE3).
 
To help users enable the correct USE flags, we are providing a Python script that generates the correct value using /proc/cpuinfo. It can be found in the {{Package|app-portage/cpuinfo2cpuflags}} package:
 
emerge -1v app-portage/cpuinfo2cpuflags
cpuinfo2cpuflags-x86
 
In order to ensure safe migration and maintain compatibility with external repositories, it is recommended to preserve the old USE settings for a period of one year or until no package of interest is still using them

www.funtoo.org

#2
overkill

overkill

    Advanced Member

  • Members
  • PipPipPip
  • 89 posts
  • LocationAustin, TX

IMHO it would be wise to use portage's news feature for something like this.  I just happened to come here and find it, but it would have been useful to see a new news item was available after syncing and then view it with `eselect news read`.

 

Or has the news feature been deprecated?


  • spectromas likes this

#3
Oleg Vinichenko

Oleg Vinichenko

    Staff

  • Moderators
  • 366 posts

we are not using portage news anymore. https://bugs.funtoo.org/browse/FL-1789


www.funtoo.org

#4
overkill

overkill

    Advanced Member

  • Members
  • PipPipPip
  • 89 posts
  • LocationAustin, TX

Thank you for clarifying, Oleg.



#5
anika200

anika200

    Newbie

  • Members
  • Pip
  • 1 posts

New user and poster here, 

 

This is a good feature, thank you for the script it worked well.  :)

 

However I have an observation about the documentation, in the op post and the wiki there is reference to adding the flags as such 

 

 

 users will be required to update their make.conf (and package.use) file

 

there is an example for the /etc/portage/make.conf but not /etc/portage/package.use.

 

In my case I added the recommended lines to both files.

This ends up creating a cryptic error message when you try to emerge something, the error below.

Invalid atom in /etc/portage/package.use: CPU_FLAGS_X86="avx 

So I comment out the line added to the package.use and all is well.

The line added to both files from the script was the line below ( created from memory, funtoo is compiling away at the moment so not accessible)

CPU_FLAGS_X86="avx other ones here mmx mmxext sse sse2 sse3"

Should the docs exclude the info to add this line to package.use or give an example of use maybe?



#6
Oleg Vinichenko

Oleg Vinichenko

    Staff

  • Moderators
  • 366 posts

package.use file is for certain packages and it's entries should look like app-foo/bar cpu_flags_x86_avx. I suspect package.use not needed for you, remove it.


www.funtoo.org

#7
funfool

funfool

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationAlbuquerque New Mexico USA

I find this interesting, while I do not understand it yet.

What is the reason for the change, what happened  ... what changed to require this.

I do not doubt funtoo's great wisdom, just trying to understand why, so can help explain the change to others.

 

I run the cpuinfo2cpuflags-x86 and get

CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3"

 

 

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-mtune=generic -O2 -pipe"
CXXFLAGS="-mtune=generic -O2 -pipe"

 

While this is what I have currently in make.conf .... the new flags seems like I would need to rebuild my whole system.

I just want to ask why the changes, and what benefits it has?

What if I simply sit back and do nothing?

 

Not angry, just uninformed and curious about this change.



#8
overkill

overkill

    Advanced Member

  • Members
  • PipPipPip
  • 89 posts
  • LocationAustin, TX

AFAIK, the CPU_FLAGS_X86 variable is for ebuilds that contain the option for those flags whereas the CHOST, CFLAGS and CXXFLAGS are for EVERY ebuild.

 

If you want to see what would be recompiled, add the result that you posted in your make.conf file, and run a --pretend emerge:

 

`emerge world -uDNpv  --with-bdeps=y`

 

IIRC, it was only about 22 packages on my setup.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users