Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 541142 - dev-lang/whitespace-0.3: unrecognized command line option ‘-nopie’
Summary: dev-lang/whitespace-0.3: unrecognized command line option ‘-nopie’
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jan Matějka (RETIRED)
URL:
Whiteboard:
Keywords:
: 541020 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-02-23 13:11 UTC by Toralf Förster
Modified: 2015-09-26 18:49 UTC (History)
2 users (show)

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


Attachments
emerge log (dev-lang:whitespace-0.3:20150223-130058.log,2.21 KB, text/plain)
2015-02-24 17:18 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2015-02-23 13:11:52 UTC
!!! The following installed packages are masked:
- dev-haskell/cabal-1.20.0.2::gentoo (masked by: package.mask)
/etc/portage/package.mask/common:
# nopie not known
#

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.

>>> Verifying ebuild manifests
>>> Emerging (1 of 1) dev-lang/whitespace-0.3::gentoo
>>> Failed to emerge dev-lang/whitespace-0.3, Log file:
>>>  '/var/log/portage/dev-lang:whitespace-0.3:20150223-130058.log'
 * Package:    dev-lang/whitespace-0.3
 * Repository: gentoo
 * Maintainer: yac@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
 * Applying whitespace-cabal.patch ...
 [ ok ]
 * Using cabal-1.20.0.2.
 * Prepending /usr/lib64/ghc-7.8.4 to LD_LIBRARY_PATH
/usr/bin/ghc -package Cabal-1.20.0.2 --make /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.lhs -dynamic -o setup
[1 of 1] Compiling Main             ( /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.lhs, /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.o )
Linking setup ...
x86_64-pc-linux-gnu-gcc: error: unrecognized command line option ‘-nopie’
/usr/bin/ghc -package Cabal-1.20.0.2 --make /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.lhs -o setup
[1 of 1] Compiling Main             ( /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.lhs, /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.o )
Linking setup ...
x86_64-pc-linux-gnu-gcc: error: unrecognized command line option ‘-nopie’
 * ERROR: dev-lang/whitespace-0.3::gentoo failed (configure phase):
 *   compiling /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.lhs failed
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_configure
 *   environment, line 2734:  Called haskell-cabal_src_configure
 *   environment, line 1859:  Called cabal-bootstrap
 *   environment, line  443:  Called die
 * The specific snippet of code:
 *           } || make_setup "$@" || die "compiling ${setupmodule} failed";
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/whitespace-0.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/whitespace-0.3::gentoo'`.
 * The complete build log is located at '/var/log/portage/dev-lang:whitespace-0.3:20150223-130058.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-lang/whitespace-0.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/whitespace-0.3/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace'
 * S: '/var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace'


        This is a built bot  unstable  chroot named amd64-unstable.kde at a hardened stable host.

        
Portage 2.2.14 (python 2.7.9-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.9.2, glibc-2.19-r1, 3.18.7-hardened x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.18.7-hardened-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16164808 total,    789772 free
KiB Swap:   16777212 total,  16750840 free
Timestamp of tree: Mon, 23 Feb 2015 06:00:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
ccache version 3.2.1 [disabled]
app-shells/bash:          4.2_p53
dev-lang/perl:            5.20.2
dev-lang/python:          2.7.9-r2, 3.3.5-r1
dev-util/ccache:          3.2.1-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3, 4.9.2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/easy-rsa /usr/share/qpsmtpd/plugins"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --tree --quiet-build --quiet --deep --jobs 1"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
USE="X a52 aac acl acpi aes-ni alsa amd64 apache2 avx avx2 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit corefonts cracklib crypt cups cxx dbus declarative dnssec dri drmkms dts dvd dvdr ecc emboss encode exif extraengine fam ffmpeg firefox flac fontconfig fortran fpm gdbm gif glamor gpm gtk gudev gui iconv isag jpeg kde kipi lcms libav libnotify libvirtd logrotate macvtap mad mbox minizip mmx mng modules mp3 mp4 mpeg multilib mysql ncurses nls nptl ogg opengl openmp pam pango pax_kernel pcre pdf phonon plasma png policykit ppds qemu qt3support qt4 readline sdl session spell spice sse sse2 sse4 sse4_1 sse4_2 ssh-askpass ssl ssse3 startup-notification svg tcpd theora thinkpad threads tiff tk tls truetype udev udisks uml unicode upower usb usbredir uxa v4l v4l2 video vorbis wxwidgets x264 xa xcb xcomposite xinerama xml xmp xscreensaver xv xvfb xvid xvmc zenmap zlib" ABI_X86="64" 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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublo x ubx" INPUT_DEVICES="keyboard mouse evdev" 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-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 1 Jan Matějka (RETIRED) gentoo-dev 2015-02-24 17:05:32 UTC
Please post the full build log. Works for me. Any idea where is the -nopie coming from?

 * Using cabal-1.20.0.2.
 * Prepending /usr/lib64/ghc-7.6.3 to LD_LIBRARY_PATH
/usr/bin/ghc -package Cabal-1.20.0.2 --make /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.lhs -dynamic -o setup
[1 of 1] Compiling Main             ( /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.lhs, /var/tmp/portage/dev-lang/whitespace-0.3/work/WSpace/Setup.o )
Linking setup ...
./setup configure --ghc --prefix=/usr --with-compiler=/usr/bin/ghc --with-hc-pkg=/usr/bin/ghc-pkg --prefix=/usr --libdir=/usr/lib64 --libsubdir=whitespace-0.3/ghc-7.6.3 --datadir=/usr/share/ --datasubdir=whitespace-0.3/ghc-7.6.3 --ghc-option=-optl-Wl,-O1 --ghc-option=-optl
-Wl,--as-needed --disable-executable-stripping --docdir=/usr/share/doc/whitespace-0.3 --verbose --sysconfdir=/etc --disable-library-stripping
Configuring WSpace-0.3...
...
Comment 2 Toralf Förster gentoo-dev 2015-02-24 17:18:18 UTC
Created attachment 397432 [details]
emerge log

(In reply to Jan Matějka from comment #1)
> Please post the full build log. Works for me. Any idea where is the -nopie
> coming from?
There're much more package affected, so probably an eclass/ issue ?
Nevertheless build is attached.

tinderbox@tor-relay ~/amd64-unstable.kde/var/log/portage $ grep -l "error: unrecognized command line option ‘-nopie’" *
dev-haskell:base-unicode-symbols-0.2.2.4:20150222-102153.log
dev-haskell:byteable-0.1.1:20150222-102021.log
dev-haskell:generic-deriving-1.7.0:20150222-094620.log
dev-haskell:ghc-paths-0.1.0.9:20150222-044715.log
dev-haskell:haskeline-0.7.1.3:20150222-081217.log
dev-haskell:list-0.5.1:20150222-102953.log
dev-haskell:readline-1.0.3.0:20150222-054626.log
dev-haskell:regex-base-0.93.2-r1:20150222-052923.log
dev-haskell:system-filepath-0.4.13.1:20150222-040731.log
dev-haskell:utf8-string-0.3.8:20150222-082242.log
dev-haskell:xml-1.3.13:20150222-100234.log
dev-lang:whitespace-0.3:20150223-130058.log
Comment 3 Jan Matějka (RETIRED) gentoo-dev 2015-02-24 17:33:55 UTC
Weird. My impression is that the only place where the -nopie flag can come from is flag-o-matic.eclass _filter-hardened function.

Also parts of your report mention it is hardened system but your profile seems to be non-hardened.

What is your selected gcc?

I'm running 

root@deathstar # eselect profile list | grep '*'
  [19]  hardened/linux/amd64 *
root@deathstar # gcc-config -l | grep '*'                                                                                                                                                                                                                                        
 [6] x86_64-pc-linux-gnu-4.8.3 *

and have no issue.
Comment 4 Toralf Förster gentoo-dev 2015-02-24 17:39:44 UTC
I run 6 different chroot images at a host in parallel for QA purpose. The host itself is hardened (and therefore in few rare cases breakspackages). The images itself are stable/unstable + hardened/regular.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2015-02-24 19:43:03 UTC
Please post your /usr/bin/ghc (it's a script) from that machine.
Comment 6 Toralf Förster gentoo-dev 2015-02-24 20:21:26 UTC
(In reply to Sergei Trofimovich from comment #5)
> Please post your /usr/bin/ghc (it's a script) from that machine.

tinderbox@tor-relay ~ $ cat amd64-unstable.kde/usr/bin/ghc
#!/bin/sh
exedir="/usr/lib64/ghc-7.8.4/bin"
exeprog="ghc-stage2"
executablename="$exedir/$exeprog"
datadir="/usr/share"
bindir="/usr/bin"
topdir="/usr/lib64/ghc-7.8.4"
executablename="$exedir/ghc"
exec "$executablename" -B"$topdir"  -optc-nopie -optl-nopie -optc-fno-stack-protector ${1+"$@"}
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2015-02-24 22:35:09 UTC
(In reply to Toralf Förster from comment #6)
> (In reply to Sergei Trofimovich from comment #5)
> > Please post your /usr/bin/ghc (it's a script) from that machine.
> 
> tinderbox@tor-relay ~ $ cat amd64-unstable.kde/usr/bin/ghc
> #!/bin/sh
> exedir="/usr/lib64/ghc-7.8.4/bin"
> exeprog="ghc-stage2"
> executablename="$exedir/$exeprog"
> datadir="/usr/share"
> bindir="/usr/bin"
> topdir="/usr/lib64/ghc-7.8.4"
> executablename="$exedir/ghc"
> exec "$executablename" -B"$topdir"  -optc-nopie -optl-nopie
> -optc-fno-stack-protector ${1+"$@"}

OK, GHC biary was build on hardened host.
Does gcc on that environment understand -nopie?

$ echo "int a = 0;" > a.c
$ gcc -c a.c -nopie

For me this test works only on hardened toolchain.

This -nopie is injected by ghc ebuild:
    gcc-specs-pie && append-ghc-cflags persistent compile link -nopie

Which means that either ghc binary or used toolchain is inappropriate for this setup.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2015-02-24 22:41:57 UTC
*** Bug 541020 has been marked as a duplicate of this bug. ***
Comment 9 Toralf Förster gentoo-dev 2015-02-25 14:20:40 UTC
well, the host itself gives :

tinderbox@tor-relay ~ $ echo "int a = 0;" > a.c
tinderbox@tor-relay ~ $ gcc -c a.c -nopie

but chroot'ing into the image (which is not hardened, just unstable) gives :

tinderbox@tor-relay ~ $ sudo ./chr.sh amd64-unstable.kde
tor-relay / # su -
tor-relay ~ # echo "int a = 0;" > a.c
tor-relay ~ # gcc -c a.c -nopie
gcc: error: unrecognized command line option ‘-nopie’
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2015-02-26 08:26:52 UTC
(In reply to Toralf Förster from comment #9)
> well, the host itself gives :
> 
> tinderbox@tor-relay ~ $ echo "int a = 0;" > a.c
> tinderbox@tor-relay ~ $ gcc -c a.c -nopie
> 
> but chroot'ing into the image (which is not hardened, just unstable) gives :
> 
> tinderbox@tor-relay ~ $ sudo ./chr.sh amd64-unstable.kde
> tor-relay / # su -
> tor-relay ~ # echo "int a = 0;" > a.c
> tor-relay ~ # gcc -c a.c -nopie
> gcc: error: unrecognized command line option ‘-nopie’

Do you happen to share binkpks between the hardened/nonhardened chroots?
eix ^ghc$ in broken chroot should show installed binpkg as {tbz2}
Comment 11 Toralf Förster gentoo-dev 2015-02-26 12:52:23 UTC
(In reply to Sergei Trofimovich from comment #10)
> Do you happen to share binkpks between the hardened/nonhardened chroots?

no, each chroot is independend from each other except - sharing the 2 directories /distfiles and /package.mask/
Comment 12 Sergei Trofimovich (RETIRED) gentoo-dev 2015-02-26 23:53:59 UTC
(In reply to Toralf Förster from comment #11)
> (In reply to Sergei Trofimovich from comment #10)
> > Do you happen to share binkpks between the hardened/nonhardened chroots?
> 
> no, each chroot is independend from each other except - sharing the 2
> directories /distfiles and /package.mask/

It clearly looks as some obscure environment leak.
I'm afraid you'll have to research yourself how '-nopie' got to /usr/bin/ghc on that toolchain.

It should be easy to discover by adding some einfo around call to ghc .ebuild:

    gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
  [gcc-specs-pie() lives in eclass/toolchain-funcs.eclass]

and running emerge on ghc ebuild.