Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 586558 - sys-firmware/ipxe fails to compile on hardened w/gcc-4.9 due to -no-pie vs -nopie
Summary: sys-firmware/ipxe fails to compile on hardened w/gcc-4.9 due to -no-pie vs -n...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo QEMU Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-21 10:28 UTC by Agostino Sarubbo
Modified: 2016-06-23 19:22 UTC (History)
8 users (show)

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


Attachments
build log (sys-firmware:ipxe-1.0.0_p20130925:20160621-102513.log,955.17 KB, text/x-log)
2016-06-21 10:28 UTC, Agostino Sarubbo
Details
[thunderx] Fix compilation with older versions of gcc.patch ([thunderx] Fix compilation with older versions of gcc.patch,508 bytes, patch)
2016-06-23 12:06 UTC, Jonathan Scruggs (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2016-06-21 10:28:56 UTC
Created attachment 438252 [details]
build log

Portage 2.2.28 (python 2.7.10-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.22-r4, 4.4.8-hardened-r1 x86_64)                                                                                                                                                               
=================================================================                                                                                                                                                                                                              
System uname: Linux-4.4.8-hardened-r1-x86_64-Intel_Xeon_E3-12xx_v2_-Ivy_Bridge-with-gentoo-2.2                                                                                                                                                                                 
KiB Mem:     8170900 total,   7037052 free                                                                                                                                                                                                                                     
KiB Swap:          0 total,         0 free                                                                                                                                                                                                                                     
Timestamp of repository gentoo: Tue, 21 Jun 2016 10:02:23 +0000                                                                                                                                                                                                                
sh bash 4.3_p42-r1                                                                                                                                                                                                                                                             
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1                                                                                                                                                                                                                                          
app-shells/bash:          4.3_p42-r1::gentoo                                                                                                                                                                                                                                   
dev-java/java-config:     2.2.0-r3::gentoo                                                                                                                                                                                                                                     
dev-lang/perl:            5.20.2::gentoo                                                                                                                                                                                                                                       
dev-lang/python:          2.7.10-r1::gentoo                                                                                                                                                                                                                                    
dev-util/cmake:           3.3.1-r1::gentoo                                                                                                                                                                                                                                     
dev-util/pkgconfig:       0.28-r2::gentoo                                                                                                                                                                                                                                      
sys-apps/baselayout:      2.2::gentoo                                                                                                                                                                                                                                          
sys-apps/openrc:          0.19.1::gentoo                                                                                                                                                                                                                                       
sys-apps/sandbox:         2.10-r1::gentoo                                                                                                                                                                                                                                      
sys-devel/autoconf:       2.69::gentoo                                                                                                                                                                                                                                         
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo                                                                                                                                                                                                                         
sys-devel/binutils:       2.25.1-r1::gentoo                                                                                                                                                                                                                                    
sys-devel/gcc:            4.9.3::gentoo                                                                                                                                                                                                                                        
sys-devel/gcc-config:     1.7.3::gentoo                                                                                                                                                                                                                                        
sys-devel/libtool:        2.4.6::gentoo                                                                                                                                                                                                                                        
sys-devel/make:           4.1-r1::gentoo                                                                                                                                                                                                                                       
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)                                                                                                                                                                                                                     
sys-libs/glibc:           2.22-r4::gentoo                                                                                                                                                                                                                                      
Repositories:                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                               
gentoo                                                                                                                                                                                                                                                                         
    location: /usr/portage                                                                                                                                                                                                                                                     
    sync-type: git                                                                                                                                                                                                                                                             
    sync-uri: https://github.com/gentoo-mirror/gentoo.git                                                                                                                                                                                                                      
    priority: -1000                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                               
                                                                                                                                                                                    
ACCEPT_KEYWORDS="amd64"                                                                                                                                                                                                                                                        
ACCEPT_LICENSE="*"                                                                                                                                                                                                                                                             
CBUILD="x86_64-pc-linux-gnu"                                                                                                                                                                                                                                                   
CFLAGS="-O2 -march=x86-64"                                                                                                                                                                                                                                                     
CHOST="x86_64-pc-linux-gnu"                                                                                                                                                                                                                                                    
CONFIG_PROTECT="/etc"                                                                                                                                                                                                                                                          
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"           
CXXFLAGS="-O2 -march=x86-64"                                                                                                                                                                                                                                                   
DISTDIR="/usr/portage/distfiles"                                                                                                                                                                                                                                               
EMERGE_DEFAULT_OPTS="--with-bdeps y -b"                                                                                                                                                                                                                                        
FCFLAGS="-O2 -pipe"                                                                                                                                                                                                                                                            
FEATURES="assume-digests binpkg-logs buildpkg collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict 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://distfiles.gentoo.org http://gentoo.wheel.sk/ http://mirror.netcologne.de/gentoo/ http://mirrors.linuxant.fr/distfiles.gentoo.org/"                                                                                                                      
LANG="it_IT.UTF-8"                                                                                                                                                                                                                                                             
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"                                                                                                                                                                                                                         
MAKEOPTS="-j4"
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 --exclude=/.git"
PORTAGE_TMPDIR="/tmp/"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri gdbm hardened iconv justify mmx mmxext modules multilib ncurses nptl openmp pam pax_kernel pcre pie readline seccomp session sse sse2 ssl ssp symlink tcpd unicode urandom xattr xtpax 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" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GRUB_PLATFORMS="pc qemu" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB" NGINX_MODULES_HTTP="access fastcgi gzip proxy rewrite" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU"
USE_PYTHON="2.7"
Comment 1 Alexander Tsoy 2016-06-22 06:52:56 UTC
Broken by
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d31cc8d1b42484b6635f8b4fe0cd8161183c337

With gcc-4.9.3:
$ LANG=C gcc -fno-PIE -no-pie -x c -c /dev/null -o /dev/null 2>&1
gcc: error: unrecognized command line option '-no-pie'
Comment 2 Toralf Förster gentoo-dev 2016-06-22 19:13:56 UTC
same here,

got today :
  [BUILD] bin/clientcert.o
env CCACHE_DISABLE=1 x86_64-pc-linux-gnu-gcc  -DARCH=i386 -DPLATFORM=pcbios -march=i386 -fomit-frame-pointer -fstrength-reduce -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mpreferred-stack-boundary=2 -mregparm=3 -mrtd -freg-struct-return -m32 -fshort-wchar -Ui386 -Ulinux -DNVALGRIND -Iinclude -I. -Iarch/x86/include -Iarch/i386/include -Iarch/i386/include/pcbios -Os -g -ffreestanding -Wall -W -Wformat-nonliteral   -fno-stack-protector  -fno-dwarf2-cfi-asm -fno-exceptions  -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-address  -ffunction-sections -fdata-sections -include include/compiler.h    -DOBJECT=clientcert -c crypto/clientcert.c -o bin/clientcert.o
/var/tmp/portage/sys-firmware/ipxe-1.0.0_p20130925/temp/ccev8Fho.s: Assembler messages:
/var/tmp/portage/sys-firmware/ipxe-1.0.0_p20130925/temp/ccev8Fho.s:48: Error: missing or invalid displacement expression `client_certificate_len@GOTOFF'
/var/tmp/portage/sys-firmware/ipxe-1.0.0_p20130925/temp/ccev8Fho.s:73: Error: missing or invalid displacement expression `client_private_key_len@GOTOFF'
Makefile.housekeeping:801: recipe for target 'bin/clientcert.o' failed
make: *** [bin/clientcert.o] Error 1
make: *** Waiting for unfinished jobs....



but it worked in former times :

Mon Dec  8 00:10:56 2014 >>> sys-firmware/ipxe-1.0.0_p20130925
Sat Dec 13 14:31:36 2014 <<< sys-firmware/ipxe-1.0.0_p20130925
Sat Dec 13 14:31:38 2014 >>> sys-firmware/ipxe-1.0.0_p20130925
Mon Aug 31 22:04:52 2015 <<< sys-firmware/ipxe-1.0.0_p20130925
Mon Aug 31 22:04:55 2015 >>> sys-firmware/ipxe-1.0.0_p20130925
ipxe: Mon Dec  8 00:09:42 2014: 1 minute, 14 seconds
ipxe: Sat Dec 13 14:30:29 2014: 1 minute, 9 seconds
ipxe: Mon Aug 31 22:03:54 2015: 1 minute, 1 second


                        Package Settings
=================================================================

sys-firmware/ipxe-1.0.0_p20130925::gentoo was built with the following:
USE="qemu usb -iso -lkrn -undi -vmware" ABI_X86="64"



FWIW I rebuilt today gcc (vtv is goneand multilib was added - IIRC)
Comment 3 razamatan 2016-06-23 01:50:59 UTC
using --no-pie instead of -no-pie works for gcc 4.9.3
Comment 4 Agostino Sarubbo gentoo-dev 2016-06-23 07:09:53 UTC
mike, can you do something here?
Comment 5 wbrana 2016-06-23 10:50:59 UTC
I'm getting different error

x86_64-pc-linux-gnu-gcc  -DARCH=i386 -DPLATFORM=pcbios -march=i386 -fomit-frame-pointer -fstrength-reduce -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mpreferred-stack-boundary=2 -mregparm=3 -mrtd -freg-struct-return -m32 -fshort-wchar -Ui386 -Ulinux -DNVALGRIND -Iinclude -I. -Iarch/x86/include -Iarch/i386/include -Iarch/i386/include/pcbios -Os -g -ffreestanding -Wall -W -Wformat-nonliteral  -fno-stack-protector -fno-dwarf2-cfi-asm -fno-exceptions  -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-address   -ffunction-sections -fdata-sections -include include/compiler.h -DASM_TCHAR='@' -DASM_TCHAR_OPS='@'   -DOBJECT=x86_string -c arch/x86/core/x86_string.c -o bin/x86_string.o 
In file included from arch/x86/core/cpuid_settings.c:31:0:
arch/x86/core/cpuid_settings.c: In function 'cpuid_settings_fetch':
arch/x86/include/ipxe/cpuid.h:73:2: error: inconsistent operand constraints in an 'asm'
  __asm__ ( "cpuid"
  ^
arch/x86/include/ipxe/cpuid.h:73:2: error: inconsistent operand constraints in an 'asm'
  __asm__ ( "cpuid"
  ^
make: *** [Makefile.housekeeping:856: bin/cpuid_settings.o] Error 1
Comment 6 Jonathan Scruggs (RETIRED) gentoo-dev 2016-06-23 12:03:32 UTC
This commit happened 24 hours ago:
https://git.ipxe.org/ipxe.git/commit/04186319181298083ef28695a8309028b26fe83c

It just says compile fix for older versions of gcc. Is GCC 4.9.x considered and older version? Can someone try that patch as I have gcc 5.3. If it works, then ipxe just needs to be bumped to 20160622. :)
Comment 7 Jonathan Scruggs (RETIRED) gentoo-dev 2016-06-23 12:06:33 UTC
Created attachment 438522 [details, diff]
[thunderx] Fix compilation with older versions of gcc.patch

Add patch that's on upstream master to here for easy access.