Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 392885 - dev-lang/nasm: built with <sys-devel/gcc-4.6 produces code that cannot be compiled on AMD E-350 CPU (eg. media-libs/libjpeg-turbo-1.1.1)
Summary: dev-lang/nasm: built with <sys-devel/gcc-4.6 produces code that cannot be com...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mr. Bones. (RETIRED)
URL:
Whiteboard:
Keywords:
: 413741 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-02 05:15 UTC by Anders Kreinøe
Modified: 2012-04-27 18:53 UTC (History)
5 users (show)

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


Attachments
build.log (build.log,11.64 KB, text/plain)
2011-12-02 05:18 UTC, Anders Kreinøe
Details
environment (environment,46.03 KB, text/plain)
2011-12-02 05:19 UTC, Anders Kreinøe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Kreinøe 2011-12-02 05:15:43 UTC
The build phase fails with an error:

ERROR: media-libs/libjpeg-turbo-1.1.1 failed (compile phase):
 *   emake failed

Reproducible: Always

Steps to Reproduce:
1. Try to emerge media-libs/libjpeg-turbo-1.1.1
Actual Results:  
Build fails.

Expected Results:  
Build succed

emerge -pqv =media-libs/libjpeg-turbo-1.1.1
[ebuild  N    ] media-libs/libjpeg-turbo-1.1.1  USE="-static-libs"

sudo emerge --info =media-libs/libjpeg-turbo-1.1.1
Adgangskode: 
Portage 2.3.2 (default/linux/amd64/2008.0, gcc-4.4.5, glibc-2.11.3-r0, 2.6.32-042stab037.1 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.32-042stab037.1-x86_64-AMD_E-350_Processor-with-gentoo-2.1.8
Timestamp of tree: Thu, 01 Dec 2011 06:30:01 +0000
app-shells/bash:          4.1_p10
dev-lang/python:          2.7.1-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1.8-r2
sys-apps/openrc:          0.8.3-r5
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.20.1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1
sys-devel/libtool:        2.4-r3
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.32 (virtual/os-headers)
sys-libs/glibc:           2.11.3
Repositories: gentoo kde lokalt-overlay mythtv
Installed sets: 
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=k8 -pipe"
DISTDIR="/tmp"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles mini-manifest news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="da_DK.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/kde /var/lib/portage/overlays /var/lib/portage/myth-overlay/Gentoo"
SYNC="git://github.com/funtoo/portage-mini-2011.git"
SYNC_USER="root"
USE="acl alac amd64 berkdb bzip2 caps cdr cli cracklib crypt cups cxx dk dri dvd dvdr dvdread emacs encode flac fortran gdbm iconv ipv6 lame mad mercurial mmx modules mp3 mpeg mudflap multilib multiuser ncurses nls nptl nptlonly ogg openmp pam pcre pppd python readline session sse sse2 ssl sysfs tcpd truetype unicode vorbis wavpack xml xmltv xorg zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 stage tables krita karbon braindump" 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 ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic 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, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, SYNC_UMASK
Comment 1 Anders Kreinøe 2011-12-02 05:18:20 UTC
Created attachment 294477 [details]
build.log
Comment 2 Anders Kreinøe 2011-12-02 05:19:27 UTC
Created attachment 294479 [details]
environment
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2011-12-02 20:01:03 UTC
(In reply to comment #0)
> Portage 2.3.2 (default/linux/amd64/2008.0, gcc-4.4.5, glibc-2.11.3-r0,
> 2.6.32-042stab037.1 x86_64)
> Linux-2.6.32-042stab037.1-x86_64-AMD_E-350_Processor-with-gentoo-2.1.8
> Timestamp of tree: Thu, 01 Dec 2011 06:30:01 +0000

http://forums.gentoo.org/viewtopic-t-876475-start-0-postdays-0-postorder-asc-highlight-.html

I believe you are using too old gcc for the CPU.
Propably needs gcc-4.6.x. 
Try ~arch version of media-libs/jpeg-turbo. It also has support for yasm, so you could "emerge -C nasm" and "emerge -1 yasm" for another try. If nothing else helps, you can always use media-libs/jpeg for now.

@toolchain: what do you think?
Comment 4 Anders Kreinøe 2011-12-02 23:23:20 UTC
I had come to the same conclusion. I have tried the ~arch version, but it also fails.

I am currently updating gcc to gcc-4.6.2 to se if that fixes the problem, i will report back when im done.
Comment 5 Anders Kreinøe 2011-12-02 23:41:18 UTC
The gcc-upgrade alone did not help, but emerge yasm made it build
Comment 6 SpanKY gentoo-dev 2011-12-02 23:45:54 UTC
i wouldn't mind making yasm a requirement where possible over nasm
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2011-12-02 23:47:32 UTC
(In reply to comment #5)
> The gcc-upgrade alone did not help, but emerge yasm made it build

let me get clarification. did you try re-emerging nasm with gcc-4.6.2?
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2011-12-02 23:57:55 UTC
(In reply to comment #6)
> i wouldn't mind making yasm a requirement where possible over nasm

yasm support is only in 1.1.90, and it was just added... not mature enough to be used as default in libjpeg-turbo yet
Comment 9 Anders Kreinøe 2011-12-03 00:08:15 UTC
The gcc-upgrade alone did not help, but emerge yasm made it build
Comment 10 Anders Kreinøe 2011-12-03 00:12:54 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > The gcc-upgrade alone did not help, but emerge yasm made it build
> 
> let me get clarification. did you try re-emerging nasm with gcc-4.6.2?

ahh, actually i did. I removed nasm and emerged yasm before trying to re-emerge libjpeg-turbe, but that pulled ind nasm as a dependency, and it was thereby rebuild with gcc-4.6.2. Thats properly why it works now.
Comment 11 SpanKY gentoo-dev 2011-12-03 00:26:44 UTC
you lost me.  why is this a gcc problem and not nasm ?
Comment 12 Anders Kreinøe 2011-12-13 09:48:14 UTC
(In reply to comment #11)
> you lost me.  why is this a gcc problem and not nasm ?

Because everything dependent on nasm fails to build on the AMD-E-350 CPU if nasn is build by <GCC-4.6. Whether that is nasm og gcc fault is beyond my knowledge, but it could indicate that <GCC-4.6 compiles a defect nasm somehow. 

Anyway, upgrading to GCC-4.6 and rebuilding nasm solves to problem, so this bug will be solved when GCC-4.6 is stabilized.
Comment 13 SpanKY gentoo-dev 2011-12-14 16:46:40 UTC
(In reply to comment #12)

this description says to me it's a bug in nasm, not gcc
Comment 14 Anders Kreinøe 2011-12-15 07:16:47 UTC
As a temporary fix, could it be possibly to make virtual/jpeg depend on media-libs/jpeg in the case of <gcc-4.6 and a AMD E-350 CPU, and media-libs/libjpeg-turbo in other cases? It would solve the specific case I had trouble with, so other users would not run into the same problem.
Comment 15 SpanKY gentoo-dev 2011-12-16 02:59:07 UTC
yeah, i don't think that really works
Comment 16 trefoil 2011-12-22 17:13:53 UTC
(In reply to comment #0)

I'm surprised your system works at all. -march=k8 turns on 3dnow vectorization etc. which the E-350 doesn't support. Use the generic -march=x86-64 as native support for that proc was only added with gcc 4.6
Comment 17 Samuli Suominen (RETIRED) gentoo-dev 2011-12-22 18:20:23 UTC
(In reply to comment #16)
> (In reply to comment #0)
> 
> I'm surprised your system works at all. -march=k8 turns on 3dnow vectorization
> etc. which the E-350 doesn't support. Use the generic -march=x86-64 as native
> support for that proc was only added with gcc 4.6

uh, good point
Comment 18 Thomas Kahle (RETIRED) gentoo-dev 2011-12-26 12:24:19 UTC
For the records: I ran into the same issue on a new install using the 11.2 live DVD as follows

System is a core i5, I'm running 32bit guest on 64 bit host.

-> Boot liveDVD-32bit
-> install from i686 stage3
-> nasm shipped with the stage does not work
-> nasm compiled with -march=native does not work

I solved the problem by recompiling nasm with -march=prescott

Then everything worked with the stable versions of nasm, gcc, and libjpeg-turbo
Comment 19 Ryan Hill (RETIRED) gentoo-dev 2011-12-27 02:48:51 UTC
oog.  what does `echo "" | gcc -march=native -v -E - 2>&1 | grep cc1` output?
Comment 20 trefoil 2011-12-31 17:00:37 UTC
-march=native only works with gcc 4.6 and later for the E-350. Earlier gccs will unwittingly turn on 3dnow by way of -march=native. Folks should just use -march=i686 or -march=x86-64 (works great here.)
Comment 21 Anders Kreinøe 2012-01-03 07:53:52 UTC
Could there be implemented a feature in portage, detecting these known broken configurations, and warn the users? It would save a lot of trouble for people if they got a warning like "The combination of cpu=x, gcc-version=y and the use of march=native is invalid, use march=z instead" when trying to use emerge.
Comment 22 Samuli Suominen (RETIRED) gentoo-dev 2012-01-03 07:57:55 UTC
(In reply to comment #18)
> For the records: I ran into the same issue on a new install using the 11.2 live
> DVD as follows
> 
> System is a core i5, I'm running 32bit guest on 64 bit host.
> 
> -> Boot liveDVD-32bit
> -> install from i686 stage3
> -> nasm shipped with the stage does not work

what? stage3 ships nasm? i really doubt it

(In reply to comment #21)
> Could there be implemented a feature in portage, detecting these known broken
> configurations, and warn the users? It would save a lot of trouble for people
> if they got a warning like "The combination of cpu=x, gcc-version=y and the use
> of march=native is invalid, use march=z instead" when trying to use emerge.

overkill

nothing really left to do here: use only native if you are sure the gcc supports it for your cpu
Comment 23 SpanKY gentoo-dev 2012-01-03 20:13:28 UTC
checking for invalid combinations gets very ugly very quickly and outstrips the original goal due to false positives: to make the life better for the user.
Comment 24 Samuli Suominen (RETIRED) gentoo-dev 2012-04-27 18:53:57 UTC
*** Bug 413741 has been marked as a duplicate of this bug. ***