Managing gcc with multiple versions on a gentoo system

I know that we can always use eselect to change the compiler version. My question is that you can associate different versions with different users. For example, I would like root to use the stable version. and in the meantime, I would like my regular user to use some cutting edges of the version.

I expect some kind of clean solution instead of manually switching using eselect

thanks

+4
source share
2 answers

I really hope you do not use the choice for this. The eselect compiler was killed many years ago because it was experimental and had many problems. gcc-config is what you should use. Unfortunately, it does not have support for each user, as we have for Java. You can always explicitly invoke a specific version (e.g. gcc-4.6.2 instead of gcc). If you create software using autotools, you can do it with ...

CC=gcc-4.6.2 ./configure make 
+4
source

You can use gcc-config to print the environment variables needed to use a specific version of GCC. For example, to use gcc-7.2.0 for the remainder of your shell session:

 eval "$(gcc-config --print-environ x86_64-pc-linux-gnu-7.2.0)" 
0
source

Source: https://habr.com/ru/post/1401204/


All Articles