Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646874 - sys-devel/gcc-7.3.0 pie use flag/unable to set // profile:release/17.0
Summary: sys-devel/gcc-7.3.0 pie use flag/unable to set // profile:release/17.0
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-07 07:20 UTC by ciaran
Modified: 2018-02-08 09:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ciaran 2018-02-07 07:20:15 UTC
I read notes in 

.../portage/profile/releases/17.0/package.use.force (pie)
.../portage/profile/releases/17.0/package.use.mask (-pie)

and to me they sound consistent, unfortunately I am NOT able to set the 'pie' use flag unless I comment out the "sys-devel/gcc pie" in package.use.force. This doesn't make too much sense to me, as I wish to build GCC with PIE, and the file names/notes seem to be consistent but not the behaviour of the use flag with respect to myself trying to set it, or it defaulting to on.

under ../portage/sys-devel/gcc/metadata.xml the 'pie' flag reads as:
<flag name="nopie">Disable PIE support (NOT FOR GENERAL USE)</flag>

there is no regular "pie" flag declaration in the metadata.xml file, unlike the rest.
Comment 1 Franz Trischberger 2018-02-07 10:38:08 UTC
"nopie" is a local USE-Flag (for sys-devel/gcc and dev-lang/gnat-gpl) so the description comes in the package's metadata.xml. "pie" on the other hand is a global USE-Flag, descriptions can be found in profile/use.desc.
gcc USE-Flags are set by toolchain.eclass, no IUSE in gcc ebuilds.

For the problem: "emerge --info" and "emerge -pv gcc" (without your changes to profile files) would be great.
Comment 2 ciaran 2018-02-07 22:02:58 UTC
Portage 2.3.19 (python 3.5.4-final-0, default/linux/amd64/17.0, gcc-7.3.0, glibc-2.25-r9, 4.15.1-gentoo x86_64)
=================================================================
System uname: Linux-4.15.1-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E5-2670_0_@_2.60GHz-with-gentoo-2.4.1
KiB Mem:    65975000 total,  58380364 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Wed, 07 Feb 2018 21:00:01 +0000
Head commit of repository gentoo: 158975527e77a403c6b42f8fd771fcfcf59441fb
sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo, 2.30::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo, 7.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.15::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mindirect-branch=thunk"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -mindirect-branch=thunk"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS=""
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs binpkg-multi-instance buildpkg candy cgroup config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles merge-sync multilib-strict news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms split-log strict unknown-features-warn unmerge-backup unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j32"
PKGDIR="/var/lib/portage/amd64/17.0/"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/tmp"
USE="acl alsa amd64 berkdb bzip2 cli crypt cxx docs dri fortran gdbm iconv icu ipv6 mmx modules multilib ncurses nls nptl openmp pam pcre readline seccomp sse sse2 ssl tcpd unicode xattr zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 efi-32 pc emu" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

-----------------------------------------------------------------------------

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

Calculating dependencies                          ... done!        
[ebuild  N    ~] dev-scheme/guile-2.2.3:12/2.2-1::gentoo  USE="deprecated networking nls regex threads -debug -debug-malloc" 0 KiB
[ebuild  N     ] sys-devel/autogen-5.18.4-r1::gentoo  USE="-libopts -static-libs" 0 KiB
[ebuild   R   ~] sys-devel/gcc-7.3.0:7.3.0::gentoo  USE="cilk* cxx debug* doc* fortran go* graphite* mpx* (multilib) nls nptl objc* objc++* objc-gc* openmp pch pgo* (pie) regression-test* sanitize ssp vanilla* vtv (-altivec) (-awt) (-fixed-point) (-gcj) (-hardened) (-jit) (-libssp)" 0 KiB

Total: 3 packages (2 new, 1 reinstall), Size of downloads: 0 KiB

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

\emerge -pv gcc  20.71s user 0.80s system 99% cpu 21.535 total
Comment 3 ciaran 2018-02-07 22:07:23 UTC
here is a pretend emerge gcc when I comment out the line in package.use.force


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

Calculating dependencies                         ... done!   
[ebuild  N    ~] dev-scheme/guile-2.2.3:12/2.2-1::gentoo  USE="deprecated networking nls regex threads -debug -debug-malloc" 0 KiB
[ebuild  N     ] sys-devel/autogen-5.18.4-r1::gentoo  USE="-libopts -static-libs" 0 KiB
[ebuild   R   ~] sys-devel/gcc-7.3.0:7.3.0::gentoo  USE="cilk* cxx debug* doc* fortran go* graphite* mpx* (multilib) nls nptl objc* objc++* objc-gc* openmp pch pgo* pie regression-test* sanitize ssp vanilla* vtv (-altivec) (-awt) (-fixed-point) (-gcj) (-hardened) (-jit) (-libssp)" 0 KiB

Total: 3 packages (2 new, 1 reinstall), Size of downloads: 0 KiB

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

\emerge -pv gcc  14.97s user 0.70s system 99% cpu 15.681 total
Comment 4 Franz Trischberger 2018-02-08 07:17:21 UTC
(In reply to ciaran from comment #2)

> [ebuild   R   ~] sys-devel/gcc-7.3.0:7.3.0::gentoo  USE="cilk* cxx debug*
> doc* fortran go* graphite* mpx* (multilib) nls nptl objc* objc++* objc-gc*
> openmp pch pgo* (pie) regression-test* sanitize ssp vanilla* vtv (-altivec)
> (-awt) (-fixed-point) (-gcj) (-hardened) (-jit) (-libssp)" 0 KiB

That's perfectly fine. From "man emerge" under "--verbose":

()       circumfix   forced, masked, or removed

(pie) indicates that the use flag is forced. You can't change it. Masked (and therefore disabled) use flags also show up in your output: altivec, awt, gcj, ...
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2018-02-08 08:07:09 UTC
You can also check if actual gcc enabled PIE by default:
    $ gcc -v 2>&1 | fgrep default-pie
    --enable-default-pie
and
    $ gcc -E -dM -x c - </dev/null | egrep -i 'PIE|PIC'
    #define __pie__ 2
    #define __PIE__ 2
    #define __pic__ 2
    #define __PIC__ 2
Comment 6 ciaran 2018-02-08 09:26:39 UTC
so why is portage saying it's not enabled but the package is configuring it anyways? Seems inconsistent.
Comment 7 ciaran 2018-02-08 09:28:16 UTC
because I am using equery...
Comment 8 Franz Trischberger 2018-02-08 09:47:10 UTC
(In reply to ciaran from comment #7)
> because I am using equery...

So equery says it is disabled? Then that's an equery (gentolkit) bug.

Could you post the command you used and the output? Thx.
Comment 9 Franz Trischberger 2018-02-08 09:51:57 UTC
And "emerge -pv gentoolkit" also could be useful.

[I use "app-portage/eix" for searching for and looking at specific packages and their useflags.]
Comment 10 Franz Trischberger 2018-02-08 09:58:21 UTC
Nevermind, here is a bug I found:
https://bugs.gentoo.org/634824