Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 542192 - media-sound/lame-3.99.5-r1: compile error on x86 with gcc-4.9.2
Summary: media-sound/lame-3.99.5-r1: compile error on x86 with gcc-4.9.2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 378027 gcc-4.9
  Show dependency tree
 
Reported: 2015-03-05 00:49 UTC by Jochen Schlick
Modified: 2015-10-02 02:01 UTC (History)
4 users (show)

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


Attachments
32-bit emerge failure log from pentium 4 (i386-lame-3.99.5-r1.build.log,35.03 KB, text/plain)
2015-08-18 21:39 UTC, Guy
Details
lame-3.99.5-msse.patch (lame-3.99.5-msse.patch,524 bytes, patch)
2015-08-21 10:10 UTC, Viktor Yu. Kovalskii
Details | Diff
Patch to place in files directory (lame-3.99.5-xmm.patch,291 bytes, text/plain)
2015-09-15 08:47 UTC, Mattia Rossi
Details
New ebuild (lame-3.99.5-r2.ebuild,2.29 KB, text/plain)
2015-09-15 08:48 UTC, Mattia Rossi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen Schlick 2015-03-05 00:49:29 UTC
here the compile error result:

/dsab/tmp.ostrov/portage/media-sound/lame-3.99.5-r1/work/lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c: In function 'fht_SSE2':
/dsab/tmp.ostrov/portage/media-sound/lame-3.99.5-r1/work/lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:172:20: warning: variable 'v_s2' set but not used [-Wunused-but-set-variable]
             __m128 v_s2;
                    ^
/dsab/tmp.ostrov/portage/media-sound/lame-3.99.5-r1/work/lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c: In function 'init_xrpow_core_sse':
/dsab/tmp.ostrov/portage/media-sound/lame-3.99.5-r1/work/lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:65:18: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
     const __m128 vec_fabs_mask = _mm_loadu_ps(&fabs_mask._float[0]);
                  ^
In file included from /dsab/tmp.ostrov/portage/media-sound/lame-3.99.5-r1/work/lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:
/usr/lib/gcc/i586-pc-linux-gnu/4.9.2/include/xmmintrin.h:929:1: error: inlining failed in call to always_inline '_mm_loadu_ps': target specific option mismatch
 _mm_loadu_ps (float const *__P)
 ^
.....
################

bug report in upstream already exist (http://sourceforge.net/p/lame/bugs/443/), but the workarounds don't fit well to gentoo environment.
Comment 1 Jochen Schlick 2015-03-05 00:55:18 UTC
dirty hack solving this problem at least in my environment

--- lame-3.99.5.orig/configure.in       2015-03-04 23:50:57.724964830 +0100
+++ lame-3.99.5/configure.in    2015-03-04 23:54:37.978298163 +0100
@@ -84,6 +84,17 @@
 
 dnl Checks for header files.
 AC_HEADER_STDC
+
+
+case $host_cpu in
+i586*|i66*)
+ check_xmmintrin=
+ ;;
+*)
+ check_xmmintrin="xmmintrin.h"
+ ;;
+esac
+
 AC_CHECK_HEADERS( \
                 errno.h \
                 fcntl.h \
@@ -93,7 +104,7 @@
                 sys/soundcard.h \
                 sys/time.h \
                 unistd.h \
-                xmmintrin.h \
+                ${check_xmmintrin} \
                 linux/soundcard.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
Comment 2 Jochen Schlick 2015-03-05 01:02:12 UTC
Sorry, 

in the configure.in diff the line consisting of +i586*|i66*) must be +i586*|i686*)
Comment 3 Guy 2015-08-18 21:39:05 UTC
Created attachment 409392 [details]
32-bit emerge failure log from pentium 4

I've run into this problem with gcc-4.9.3

Both my Pentium 4 PC and my qemu 32-bit {gentoo linux based} client fail to compile media-sound/lame-3.99.5-r1 with what appears to be the same messages posted here.

However, my Intel Atom N270 based notebook compiles lame-3.99.5-r1 fine with gcc-4.9.3.

This is the 'emerge --info' output from the same PC which the attached log is from.

# emerge --info '=media-sound/lame-3.99.5-r1'
Portage 2.2.20.1 (python 2.7.10-final-0, default/linux/x86/13.0/desktop/kde, gcc-4.9.3, glibc-2.21-r1, 4.1.5-gentoo i686)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.1.5-gentoo-i686-Intel-R-_Pentium-R-_4_CPU_2.66GHz-with-gentoo-2.2
KiB Mem:     2070016 total,   1407932 free
KiB Swap:    2047996 total,   2035352 free
Timestamp of repository gentoo: Mon, 17 Aug 2015 21:00:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25.1 p1.0) 2.25.1
app-shells/bash:          4.3_p39::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.1::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

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

GuyCustom
    location: /usr/local/portage
    masters: gentoo
    priority: 0

printer-drivers
    location: /var/lib/layman/printer-drivers
    masters: gentoo
    priority: 50

x11
    location: /var/lib/layman/x11
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA dlj-1.1 PUEL AdobeFlash-10.3 AdobeFlash-11.x Oracle-BCLA-JavaSE"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /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 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg 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"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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"
USE="X a52 aac acl acpi alsa avahi berkdb bluray branding bzip2 cairo cdda cdr cjk cli consolekit cracklib crypt css cups curl cxx dbus declarative dga dri dts dv dvd dvdr emboss encode exif expat fam ffmpeg firefox flac fortran gdbm gif gimp glamor gmp gnutls gphoto2 gpm graphviz gstreamer gtk ibus iconv icu imagemagick ipv6 java javascript jbig jpeg jpeg2k kde kipi lcms libnotify mad mmap mng modules mp3 mp4 mpeg ncurses nls nptl nsplugin odbc offensive ogg openexr opengl openmp pam pango pcre pdf perl phonon plasma png policykit postscript ppds pulseaudio python qt3support qt4 qt5 raw readline samba sdl seccomp semantic-desktop session snmp spell ssl startup-notification subversion svg syslog tcl tcpd threads tiff tools truetype udev udisks unicode upower usb utils vala vdpau vorbis webkit wmf wxwidgets x264 x86 xcb xcomposite xinerama xml xpm xscreensaver xv xvid zlib" ABI_X86="32" ALSA_CARDS="intel8x0" 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 mmxext sse sse2" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LINGUAS="en ja" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby19 ruby20 ruby22" USERLAND="GNU" VIDEO_CARDS="nouveau"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

media-sound/lame-3.99.5-r1::gentoo was built with the following:
USE="-debug -mp3rtp -sndfile -static-libs" CPU_FLAGS_X86="mmx"
Comment 4 Guy 2015-08-18 22:04:20 UTC
As you can see from the above 'emerge --info', the CFLAGS and CXXFLAGS for my Pentium 4 are set to "-O2 -march=i686 -pipe"

For my Atom N270, CFLAGS and CXXFLAGS are set to "-O2 -march=native -pipe"

On my Pentium 4, this worked:

# CFLAGS="-O2 -march=native -pipe" CXXFLAGS="-O2 -march=native -pipe" emerge -1 =media-sound/lame-3.99.5-r1
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) media-sound/lame-3.99.5-r1::gentoo
>>> Installing (1 of 1) media-sound/lame-3.99.5-r1::gentoo
>>> Jobs: 1 of 1 complete                           Load avg: 1.48, 0.60, 0.26
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.


The same is true on my qemu 32-bit linux client. It's CFLAGS and CXXFLAGS settings are: "-O2 -march=i386 -pipe". 

On my qemu 32-bit linux client, this also worked:

qemu_gnn_01 src # CFLAGS="-O2 -march=native -pipe" CXXFLAGS="-O2 -march=native -pipe" emerge -1 =media-sound/lame-3.99.5-r1
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) media-sound/lame-3.99.5-r1::x-portage
>>> Installing (1 of 1) media-sound/lame-3.99.5-r1::x-portage
>>> Jobs: 1 of 1 complete                           Load avg: 0.85, 0.29, 0.14
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.


I hope this helps.
Comment 5 Viktor Yu. Kovalskii 2015-08-21 10:09:34 UTC
Patch from upstream bug[1] works for me.

And the same patch is used by Debian see [2].

I don't test on system which doesn't support sse instruction
-----
[1] http://sourceforge.net/p/lame/bugs/443/#90bd
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760047

Description: Build xmm_quantize_sub.c with -msse
Author: Sebastian Ramacher <sramacher@debian.org>
Bug: http://sourceforge.net/p/lame/bugs/443/
Bug-Debian: https://bugs.debian.org/760047
Last-Update: 2014-08-31

--- lame-3.99.5+repack1.orig/libmp3lame/vector/Makefile.am
+++ lame-3.99.5+repack1/libmp3lame/vector/Makefile.am
@@ -20,6 +20,7 @@ xmm_sources = xmm_quantize_sub.c
 
 if WITH_XMM
 liblamevectorroutines_la_SOURCES = $(xmm_sources)
+liblamevectorroutines_la_CFLAGS = -msse
 endif
 
 noinst_HEADERS = lame_intrin.h
Comment 6 Viktor Yu. Kovalskii 2015-08-21 10:10:39 UTC
Created attachment 409738 [details, diff]
lame-3.99.5-msse.patch
Comment 7 Guy 2015-08-22 02:52:07 UTC
Patch worked for me on all my 32-bit {x86} based systems.
Comment 8 Fernando (likewhoa) 2015-09-11 16:17:17 UTC
Works for me also on x86.
Comment 9 Mattia Rossi 2015-09-15 08:47:29 UTC
Created attachment 411942 [details]
Patch to place in files directory

This is the patch for the files directory
Comment 10 Mattia Rossi 2015-09-15 08:48:58 UTC
Created attachment 411944 [details]
New ebuild

This is the new ebuild which uses the previously attached patch.

It might need some polishing, but it works.

I'd suggest to update the ebuild accordingly in the portage tree
Comment 11 Guy 2015-09-28 02:09:04 UTC
Patch and ebuild worked for me.
Comment 12 Ryan Hill (RETIRED) gentoo-dev 2015-10-02 02:01:20 UTC
Fixed in 3.99.5-r1.