Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[N00b] Toolchain USE flags for different profiles
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Cuong Nguyen
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2018
Posts: 81

PostPosted: Tue Jul 03, 2018 4:00 am    Post subject: [N00b] Toolchain USE flags for different profiles Reply with quote

Hello,

Now my starting profile for installing gentoo is hardened, which eliminate some USE-flags for gcc like pch pgo sanitize.

Should I create a common toolchain for all different profiles that enable all possible USE-flags?

Thank you,
Back to top
View user's profile Send private message
skorefish
Apprentice
Apprentice


Joined: 21 Jun 2015
Posts: 263

PostPosted: Sat Jul 14, 2018 8:56 pm    Post subject: Reply with quote

Cuong Nguyen,

If i understand your question. Profiles is the heighest level of choosing USE-flags.So no, just choose a profile that fits you best. This means it has the most USE-flags you need.
(Hardened is a profile focusing on more security. )
now watch the selected useflags
Code:
emerge --info | grep USE=


on a global level edit the file /etc/portage/make.conf
add useflags you miss or delete some you don't need. Remember this is for all the pachages.

next level per package USE-flags: edit /etc/portage/package.use/file

for example
Code:
>=media-libs/libsdl2-2.0.4::gentoo gles
app-text/highlight examples qt4
net-wireless/wpa_supplicant dbus hs2-0 readline ssl -ap -eap-sim -fasteap -gnutls -libressl -p2p -ps3 qt5 -selinux -smartcard -tdls -uncommon-eap-types wimax wps


next level change use flag only this moment
USE="-uncommon-eap-types" emerge net-wireless/wpa_supplicant --ask

I hope this makes some sense
Back to top
View user's profile Send private message
Cuong Nguyen
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2018
Posts: 81

PostPosted: Mon Jul 16, 2018 4:26 am    Post subject: Reply with quote

Thank you for good explanations,
I have basic knowledge how to use profiles both stock- and my own /etc/portage/profile settings. I just want to make better organization of USE-flags to fit my needs, just like other distros - Sabayon, Calculate-Linux. I am still a bit concerned, when I switch to new profile or create a combined profile with parent file contains pointers to gentoo:profiles (the order of gentoo-profiles in the profile's parent file matters, because different profiles I applied will have USE-flags that negate other). The default USE-flags set will change, especially when it related to toolchain pkgs like gcc glibc, I would have to re-emerge them together with runtime depedencies...
Now I am thingking about create a base profile that contains all needed USE-flags for a toolchain libtool, gcc, glibc, binutils that fits all possible profiles for desktop with either Qt or gnome toolkits. I dont want to re-emerge toolchain pkgs everytime I apply new profile of gentoo or my own, e.g.:

sys-devel/gcc hardened pgo pch santitize graphite go fortran cxx objc objc++

That means one toolchain fits all.

As in Arch Linux the toolchain splits into many subpkgs like lib32- for multilibs, golang support etc.

Rgds,
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1638

PostPosted: Mon Jul 16, 2018 6:48 am    Post subject: Reply with quote

Now, I'd think you may be doing something wrong if you are switching profiles frequently. Most times, you should be able to set it initially, then forget about it all together (with a few minor times just to update it from say moving from 15.0 to 17.0 profile, which should affect your use flags too much).

As far as making a custom profile, just to set some USE flags; I think you are making more work than you need. USE flags are applied from profile->make.conf->package.use->command line. So you can easily just make a file in your package.use (assuming it is a directory, which is effectively concatenated together when used), say 00-default-toolchain.conf which have all of your default settings for the toolchain. With it starting at 00 (package.use is read in alphabetical order), makes it read first, so anything after can overwrite the setting for more adjusting as necessary.
Back to top
View user's profile Send private message
skorefish
Apprentice
Apprentice


Joined: 21 Jun 2015
Posts: 263

PostPosted: Mon Jul 16, 2018 1:25 pm    Post subject: Reply with quote

Cuong Nguyen,

Don't change the profiles. Instead choose a profile first time you install gentoo, or when big changes are made: like switching from gnome to kde desktop
or installing only a very secure command line only (hardened). From time to time profiles will be updated by gentoo.

Then just try to emerge like this. for example
Code:
 emerge -av vim

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-editors/vim-8.0.1298::gentoo  USE="X acl gpm nls -cscope -debug -lua -luajit -minimal -perl -python -racket -ruby (-selinux) -tcl -terminal -vim-pager" PYTHON_SINGLE_TARGET="python3_5 -python2_7 -python3_4 -python3_6" PYTHON_TARGETS="python2_7 python3_5 -python3_4 -python3_6" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]

answer no!
imagine you want 'tcl' but not 'gpm'
just add
Code:
 =app-editors/vim-8.0.1298 tcl -gpm
to /etc/portage/package.use/WhatEverNameYouLike

after this emerge -av vim -> tcl is selected, gpm not

Now Say you want tcl for all packages-> edit /etc/portage/make.conf
This is the same result as adding it to the profile, without changing the profile,
making a profile update possible without losing your use-flag global settings.
it overrides your chosen profile


Code:
USE="tcl jack gles2 dbus wayland X -elogind -pulseaudio jack2 inotify hpcups acpi alsa amd64 bindist bzip2 cli gtk gnome kde -bluetooth udev drm  glamoregl dri intel i915 i965 fbdev modesetting vesa evdev mouse"


or make friends with the euse command
Back to top
View user's profile Send private message
Cuong Nguyen
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2018
Posts: 81

PostPosted: Tue Jul 17, 2018 7:42 am    Post subject: Reply with quote

Thank you!

I got the point. Now I will create a combined hardened+desktop profiles, keep the hardened profile USE-flags explicitly declared by using make.defaults and use.mask package.use.mask use.force.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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