Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 538026 - sys-devel/gcc-4.8.3 with <sys-devel/binutils-2.23.2 on amd64: Assembler messages: Error: expecting string instruction after `rep'
Summary: sys-devel/gcc-4.8.3 with <sys-devel/binutils-2.23.2 on amd64: Assembler messa...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://gcc.gnu.org/bugzilla/show_bug...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-28 07:27 UTC by Jocelyn Mayer
Modified: 2015-02-02 16:41 UTC (History)
0 users

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


Attachments
kernel configuration used to compile sys-kernel/hardened-sources-3.15.5-r1 (config-3.15.5-hr1,69.99 KB, text/x-mpsub)
2015-01-29 05:45 UTC, Jocelyn Mayer
Details
kernel configuration used to compile sys-kernel/hardened-sources-3.15.10-r1 (config-3.15.10-hr1,70.07 KB, text/x-mpsub)
2015-01-29 05:46 UTC, Jocelyn Mayer
Details
kernel configuration used to compile sys-kernel/hardened-sources-3.17.7-r1 (config-3.17.7-hr1,71.40 KB, text/x-mpsub)
2015-01-29 05:47 UTC, Jocelyn Mayer
Details
assembly output file of gcc version 4.8.3 (misc.S,28.36 KB, text/plain)
2015-01-29 06:17 UTC, Jocelyn Mayer
Details
Simple test case (rep.S,31 bytes, text/plain)
2015-01-31 07:51 UTC, Jocelyn Mayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2015-01-28 07:27:21 UTC
GCC seems to emit invalid and/or truncated assembly code when compiling the linux kernel bootstrap code


Reproducible: Always

Steps to Reproduce:
Build a kennel:
# make V=1 bzImage
Actual Results:  
  gcc -Wp,-MD,arch/x86/boot/compressed/.misc.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include -I./arch/x86/include -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -m64 -D__KERNEL__ -O2 -fno-strict-aliasing -fPIC -DDISABLE_BRANCH_PROFILING -mcmodel=small -mno-mmx -mno-sse -ffreestanding -fno-stack-protector    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(misc)"  -D"KBUILD_MODNAME=KBUILD_STR(misc)" -c -o arch/x86/boot/compressed/misc.o arch/x86/boot/compressed/misc.c
/tmp/ccPGx6OM.s: Assembler messages:
/tmp/ccPGx6OM.s:246: Error: expecting string instruction after `rep'
scripts/Makefile.build:257: recipe for target 'arch/x86/boot/compressed/misc.o' failed
make[2]: *** [arch/x86/boot/compressed/misc.o] Error 1
arch/x86/boot/Makefile:108: recipe for target 'arch/x86/boot/compressed/vmlinux' failed
make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
arch/x86/Makefile:235: recipe for target 'bzImage' failed
make: *** [bzImage] Error 2


Expected Results:  
build a kernel image

# emerge --info
Portage 2.2.14 (python 3.3.5-final-0, hardened/linux/amd64/no-multilib, gcc-4.8.3, glibc-2.19-r1, 3.15.5-hardened-r1 x86_64)
=================================================================
System uname: Linux-3.15.5-hardened-r1-x86_64-AMD_Athlon-tm-_X2_Dual_Core_Processor_BE-2300-with-gentoo-2.2
KiB Mem:     1984812 total,    312236 free
KiB Swap:    2008088 total,   1944812 free
Timestamp of tree: Mon, 26 Jan 2015 04:45:01 +0000
ld GNU ld (Gentoo 2.22 p1.5) 2.22
app-shells/bash:          4.2_p53
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.9-r1, 3.2.5-r6, 3.3.5-r1, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.12.6, 1.13.4
sys-devel/binutils:       2.22-r1, 2.23.2, 2.24-r3
sys-devel/gcc:            3.4.6-r2, 4.3.6-r1, 4.4.7, 4.5.4, 4.6.4, 4.7.3-r1, 4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.4
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -funroll-loops -pipe -fexpensive-optimizations -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=amdfam10 -O2 -funroll-loops -pipe -fexpensive-optimizations -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg config-protect-if-modified ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.inode.at/ http://mirror.datapipe.net/gentoo http://gentoo.ynet.sk/pub http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.easynet.nl/mirror/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
LANG="POSIX"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j 1"
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="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext acl acpi adns amd64 apache2 apm bcmath berkdb branding bzip2 caps cgi cli cracklib crypt ctype cups curl curlwrappers dbus encode exif fam filecaps ftp gd gif gnutls gzip hardened hddtemp imap ipv6 jpeg jpeg2k justify lm_sensors lzma lzo maildir mbox memlimit mhash mmap mmx mmxext modules nas ncurses nntp nptl offensive pam pax_kernel pcntl pcre png posix postgres readline sasl session sharedmem skey slang smp sse sse2 sse3 ssl svg syslog sysvipc szip tcpd threads tiff truetype udev unicode urandom vhosts wifi wmf xattr xinetd xml 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" 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" 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 ublox 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

# gcc-config -l
 [1] x86_64-pc-linux-gnu-3.4.6
 [2] x86_64-pc-linux-gnu-4.3.6
 [3] x86_64-pc-linux-gnu-4.3.6-hardenednopie
 [4] x86_64-pc-linux-gnu-4.3.6-vanilla
 [5] x86_64-pc-linux-gnu-4.4.7
 [6] x86_64-pc-linux-gnu-4.4.7-hardenednopie
 [7] x86_64-pc-linux-gnu-4.4.7-hardenednopiessp
 [8] x86_64-pc-linux-gnu-4.4.7-hardenednossp
 [9] x86_64-pc-linux-gnu-4.4.7-vanilla
 [10] x86_64-pc-linux-gnu-4.5.4
 [11] x86_64-pc-linux-gnu-4.5.4-hardenednopie
 [12] x86_64-pc-linux-gnu-4.5.4-hardenednopiessp
 [13] x86_64-pc-linux-gnu-4.5.4-hardenednossp
 [14] x86_64-pc-linux-gnu-4.5.4-vanilla
 [15] x86_64-pc-linux-gnu-4.6.4
 [16] x86_64-pc-linux-gnu-4.6.4-hardenednopie
 [17] x86_64-pc-linux-gnu-4.6.4-hardenednopiessp
 [18] x86_64-pc-linux-gnu-4.6.4-hardenednossp
 [19] x86_64-pc-linux-gnu-4.6.4-vanilla
 [20] x86_64-pc-linux-gnu-4.7.3
 [21] x86_64-pc-linux-gnu-4.7.3-hardenednopie
 [22] x86_64-pc-linux-gnu-4.7.3-hardenednopiessp
 [23] x86_64-pc-linux-gnu-4.7.3-hardenednossp
 [24] x86_64-pc-linux-gnu-4.7.3-vanilla
 [25] x86_64-pc-linux-gnu-4.8.3 *
 [26] x86_64-pc-linux-gnu-4.8.3-hardenednopie
 [27] x86_64-pc-linux-gnu-4.8.3-hardenednopiessp
 [28] x86_64-pc-linux-gnu-4.8.3-hardenednossp
 [29] x86_64-pc-linux-gnu-4.8.3-vanilla


Note 1: this does not happen when compiling gentoo-sources on non-hardened profile
Note 2: this does not happen when compiling with previous gcc version: tested with 4.6.4 and 4.7.3
Note 3: this does not seem to depend on kernel version: tested with linux-3.15.10-hardened-r1, linux-3.15.5-hardened-r1 and linux-3.17.7-hardened-r1
Comment 1 Anthony Basile gentoo-dev 2015-01-28 21:27:24 UTC
This is a surprising bug we've been using 4.8.3 on hardened for a while.  I'm first gut reaction is that your gcc-4.8.3 is broken, but let's go through and find out what's happening first.  Can you get me 1) your kernel config file and 2) the tmp assembly generated. That would be your /tmp/ccPGx6OM.s below, but expect the name to be slightly different.
Comment 2 Jocelyn Mayer 2015-01-29 05:45:45 UTC
Created attachment 395090 [details]
kernel configuration used to compile sys-kernel/hardened-sources-3.15.5-r1
Comment 3 Jocelyn Mayer 2015-01-29 05:46:31 UTC
Created attachment 395092 [details]
kernel configuration used to compile sys-kernel/hardened-sources-3.15.10-r1
Comment 4 Jocelyn Mayer 2015-01-29 05:47:17 UTC
Created attachment 395094 [details]
kernel configuration used to compile sys-kernel/hardened-sources-3.17.7-r1
Comment 5 Jocelyn Mayer 2015-01-29 06:07:56 UTC
Afeter further investigation, ie trying to recompile misc.c by hand, this
 bug seems related to bug #538028:
- I'm not able to recompile the kernel using binutils versions 2.23.2 and 2.24, getting an "as out of memory" error while building arch dependent cryptographic drivers
- then I have to switch back to binutils versions 2.22 in order to be able to compile the core kernel then trigger this gcc bug.

Then:
* trying to compile arch/x86/boot/compressed/misc.c "by hand" with binutils version 2.22 and gcc version < 4.8.3 is OK
* trying to compile misc.c with binutils 2.22 and gcc 4.8.3 fails
* trying to compile misc.c with binutils 2.23.2 / 2.24 is OK whatever gcc version is used

... so the bugs shows up only when using gcc 4.8.3 with binutils 2.22; I don't have any previous binutils versions installed to check if they might be affected by the bug too:
# binutils-config -l
 [1] x86_64-pc-linux-gnu-2.22 *
 [2] x86_64-pc-linux-gnu-2.23.2
 [3] x86_64-pc-linux-gnu-2.24
If useful, I may try using binutils versions 2.20.1 and / or 2.21.1 (which are still unmasked on hardened gcc).
Comment 6 Jocelyn Mayer 2015-01-29 06:17:29 UTC
Created attachment 395096 [details]
assembly output file of gcc version 4.8.3

Generated using:
gcc -Wp,-MD,arch/x86/boot/compressed/.misc.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include -I./arch/x86/include -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -m64 -D__KERNEL__ -O2 -fno-strict-aliasing -fPIC -DDISABLE_BRANCH_PROFILING -mcmodel=small -mno-mmx -mno-sse -ffreestanding -fno-stack-protector    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(misc)"  -D"KBUILD_MODNAME=KBUILD_STR(misc)" -S -o arch/x86/boot/compressed/misc.S arch/x86/boot/compressed/misc.c

Seems like as binutils version 2.22 does not like the "rep ret" instruction stream at line 246; isn't there a ';' missing between the two instructions ?
gcc version 4.7.3 generates "rep\n ret" stream and all other rep prefix generated
in this file are "rep; nop" as far as I can see...
Comment 7 Jocelyn Mayer 2015-01-31 05:34:20 UTC
Having made some tries on another box, with a non-hardened configuration, I can confirm the problem when using gcc 4.8.3 with binutils versions 2.20.1, 2.21.1 and 2.22. binutils 2.23.2 and 2.24 are OK.
Then, the bug appears not to be hardened gentoo related but a development toolchain generic bug. Please update the bug assignation.

Here's the emerge --info output of the other box if it can be useful:
# emerge --info
Portage 2.2.14 (python 3.3.5-final-0, default/linux/amd64/13.0/developer, gcc-4.8.3, glibc-2.19-r1, 3.10.63-gentoo x86_64)
=================================================================
System uname: Linux-3.10.63-gentoo-x86_64-AMD_Athlon-tm-_II_X2_255_Processor-with-gentoo-2.2
KiB Mem:     7666420 total,    387928 free
KiB Swap:   33554424 total,  32915148 free
Timestamp of tree: Sat, 31 Jan 2015 03:15:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.9-r1, 3.2.5-r6, 3.3.5-r1, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.4_p6-r2, 1.5-r2, 1.6.3-r2, 1.7.9-r3, 1.8.5-r5, 1.9.6-r4, 1.10.3-r1, 1.11.6-r1, 1.12.6, 1.13.4
sys-devel/binutils:       2.20.1-r1, 2.21.1-r1, 2.22-r1, 2.23.2, 2.24-r3
sys-devel/gcc:            3.4.6-r2, 4.3.6-r1, 4.4.7, 4.5.4, 4.6.3, 4.7.3-r1, 4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.4
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -funroll-loops -pipe -fexpensive-optimizations -fomit-frame-pointer -g"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/yp/Makefile"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=amdfam10 -O2 -funroll-loops -pipe -fexpensive-optimizations -fomit-frame-pointer -g"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg collision-protect config-protect-if-modified ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sfperms sign splitdebug strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.inode.at/ http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ http://gentoo.blueyonder.co.uk http://mirror.datapipe.net/gentoo http://gentoo.ynet.sk/pub http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.easynet.nl/mirror/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j 1"
PKGDIR="/usr/local/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="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X Xaw3d a52 aac aalib acl acpi adns aim alsa amd64 ao apache2 apm audiofile bash-completion bcmath berkdb bidi blas bluetooth branding bzip2 cairo calendar caps cdb cdda cddb cdparanoia cdr cgi cli consolekit cracklib crypt cscope css ctype cups curl curlwrappers cvs cxx dbus dga djvu doc dri dts dv dvb dvd dvdr eds emacs encode enscript evo examples exif expat fam fastcgi fbcon ffmpeg fftw filecaps firefox flac fontconfig foomaticdb fortran ftp gd gdbm ggi gif gimp git glamor glut gmp gnome gnuplot gnutls gphoto2 gpm gps graphviz gsl gsm gstreamer gtk gtkhtml guile gzip hddtemp iconv icq icu idn ieee1394 imagemagick imap imlib inotify introspection iodbc ios ipod ipv6 jabber jack javascript jingle jit jpeg jpeg2k ladspa lame lapack lash latex lcms ldap libass libcaca libffi libnotify libsamplerate libwww lm_sensors lua lzma lzo mad maildir matroska matrox mbox memlimit mhash mikmod mime mmap mms mmx mmxext mng modplug modules motif mozilla mp3 mp4 mpeg mpi mplayer msn mtp multilib musepack musicbrainz nas ncurses neXt netcdf nls nntp nptl nsplugin ocaml ocamlopt odbc offensive ofx ogg openal openexr opengl openmp orc osc oscar oss pam pango pcntl pcre pdf perl plotutils png policykit portaudio posix postgres postscript ppds pulseaudio python qt3support quicktime raw readline recode rss ruby sasl scanner sdl sharedmem shorten simplexml skey slang slp smp sndfile snmp soap sockets sound sox speex spell sqlite sqlite3 sse sse2 sse3 ssl startup-notification static-libs subversion svg syslog sysvipc szip taglib tcl tcpd theora threads tidy tiff timidity tk truetype udev unicode upnp upnp-av upower usb v4l vcd vdpau vhosts videos vnc vorbis wavpack wddx webkit wifi wmf wxwidgets x264 xattr xcb xcomposite xface xft xine xinerama xinetd xml xmlrpc xmp xmpp xosd xpm xscreensaver xsl xv xvid yahoo yaz 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="mmx sse sse2" 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 ublox 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 8 Jocelyn Mayer 2015-01-31 07:51:37 UTC
Created attachment 395244 [details]
Simple test case

The bug can be reproduced trying to compile this file:
gcc -O2 -c -o /tmp/rep.o /tmp/rep.S

Compilation is OK when using binutils 2.23.2 or 2.24-r3.
It fails when using binutils 2.20.1-r1, 2.21.1-r1 or 2.22-r1 (supposed to be stable on amd64):
# gcc -O2 -c -o /tmp/rep.o /tmp/rep.S 
/tmp/rep.S: Assembler messages:
/tmp/rep.S:2: Error: expecting string instruction after `rep'
Comment 9 Anthony Basile gentoo-dev 2015-01-31 16:23:24 UTC
This is not a hardened specific bug.  This is not kernel related.  It is a known issue in either gcc or binutils, depending on who you want to blame.

According to the debian bug, it was introduced after gcc-4.8.0.  I'll test and try to bracket it down to the release of gcc, but I'm not going to git bisect it down to the actual commit that causes the problem because we have a perfectly reasonable solution --- use the latest stable gcc and binutils on amd64.

Unfortunately (in gentoo) we give you a lot of toolchain flexibility.  Its not suprising that you'll find gcc/binutils combos that will cause problems. It would be a maintenance nightmare to try to maintain all combos.
Comment 10 Anthony Basile gentoo-dev 2015-01-31 17:16:10 UTC
Can't put more than one url in the url field above:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57017
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=710142
Comment 11 Anthony Basile gentoo-dev 2015-02-02 11:30:19 UTC
(In reply to Anthony Basile from comment #10)
> Can't put more than one url in the url field above:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57017
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=710142

I've confirmed that this problem happens with gcc-4.8 and above and binutils before 2.23.2.

I understand that bug #538028 makes you switch between binutils to get the kernel compiled, but that seems to be the problem, not this bug.