Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 287391 - media-sound/pulseaudio-0.9.19-r50 fails to compile with -O1 -fweb
Summary: media-sound/pulseaudio-0.9.19-r50 fails to compile with -O1 -fweb
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-02 18:42 UTC by Torsten Kaiser
Modified: 2009-10-07 17:43 UTC (History)
3 users (show)

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


Attachments
failing .i file (svolume_mmx.i,227.42 KB, text/plain)
2009-10-06 17:39 UTC, Torsten Kaiser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Kaiser 2009-10-02 18:42:03 UTC
Trying to upgrade from pulseaudio-0.9.18-r50 to -0.9.19-r50 on an ~amd64 system fails with the following error

Reproducible: Always

Steps to Reproduce:
1.emerge -1 pulseaudio

Actual Results:  
  CC     libpulsecore_0.9.19_la-svolume_c.lo
  CC     libpulsecore_0.9.19_la-svolume_arm.lo
  CC     libpulsecore_0.9.19_la-svolume_mmx.lo
  CC     libpulsecore_0.9.19_la-svolume_sse.lo
pulsecore/svolume_mmx.c: In function 'pa_volume_s16ne_mmx':
pulsecore/svolume_mmx.c:103: error: invalid 'asm': invalid expression as operand
pulsecore/svolume_mmx.c:103: error: invalid 'asm': invalid expression as operand
pulsecore/svolume_mmx.c:103: error: invalid 'asm': invalid expression as operand
pulsecore/svolume_mmx.c: Assembler messages:
pulsecore/svolume_mmx.c:126: Error: expecting operand before ','; got nothing
pulsecore/svolume_mmx.c:150: Error: expecting operand before ','; got nothing
pulsecore/svolume_mmx.c:188: Error: expecting operand before ','; got nothing
make[3]: *** [libpulsecore_0.9.19_la-svolume_mmx.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
pulsecore/svolume_sse.c: In function 'pa_volume_s16ne_sse2':
pulsecore/svolume_sse.c:86: error: invalid 'asm': invalid expression as operand
pulsecore/svolume_sse.c:86: error: invalid 'asm': invalid expression as operand
pulsecore/svolume_sse.c:86: error: invalid 'asm': invalid expression as operand
pulsecore/svolume_sse.c:86: error: invalid 'asm': invalid expression as operand
pulsecore/svolume_sse.c: Assembler messages:
pulsecore/svolume_sse.c:109: Error: expecting operand before ','; got nothing
pulsecore/svolume_sse.c:133: Error: expecting operand before ','; got nothing
pulsecore/svolume_sse.c:157: Error: expecting operand before ','; got nothing
pulsecore/svolume_sse.c:195: Error: expecting operand before ','; got nothing
make[3]: *** [libpulsecore_0.9.19_la-svolume_sse.lo] Error 1
make[3]: Leaving directory `/var/tmp/portage/media-sound/pulseaudio-0.9.19-r50/work/pulseaudio-0.9.19/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/media-sound/pulseaudio-0.9.19-r50/work/pulseaudio-0.9.19/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-sound/pulseaudio-0.9.19-r50/work/pulseaudio-0.9.19'
make: *** [all] Error 2
 *
 * ERROR: media-sound/pulseaudio-0.9.19-r50 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2982:  Called _eapi2_src_compile
 *               ebuild.sh, line  638:  Called die
 * The specific snippet of code:
 *              emake || die "emake failed"
 *  The die message:
 *   emake failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/media-sound/pulseaudio-0.9.19-r50/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-sound/pulseaudio-0.9.19-r50/temp/environment'.
 *


Expected Results:  
Upgrade of pulseaudio.

treogen ~ # emerge -1v pulseaudio

These are the packages that would be merged, in order:

Calculating dependencies ... done!
[ebuild     U ] media-sound/pulseaudio-0.9.19-r50 [0.9.18-r50] USE="X alsa asyncns caps dbus doc glib hal jack libsamplerate lirc tcpd test udev -avahi -bluetooth -gnome -ipv6 (-oss)" 0 kB

Total: 1 package (1 upgrade), Size of downloads: 0 kB

emerge --info:
Portage 2.2_rc42 (default/linux/amd64/10.0, gcc-4.4.1, glibc-2.10.1-r0, 2.6.32-rc2 x86_64)
=================================================================
System uname: Linux-2.6.32-rc2-x86_64-Dual-Core_AMD_Opteron-tm-_Processor_2218-with-gentoo-2.0.1
Timestamp of tree: Fri, 02 Oct 2009 16:00:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     4.0_p33
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.2-r2
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.1
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -march=opteron-sse3 -O3 -fomit-frame-pointer -fweb -frename-registers -ftracer -ftree-loop-im -funswitch-loops -fivopts -floop-interchange -floop-strip-mine -floop-block"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/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 /etc/udev/rules.d"
CXXFLAGS="-pipe -march=opteron-sse3 -O3 -fomit-frame-pointer -fweb -frename-registers -ftracer -ftree-loop-im -funswitch-loops -fivopts -floop-interchange -floop-strip-mine -floop-block"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --jobs=4 --load-average=5 --keep-going"
FEATURES="assume-digests buildpkg distlocks fixpackages parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://ds.thn.htu.se/linux/gentoo http://gentoo.inf.elte.hu/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/"
LDFLAGS="-Wl,-O1"
LINGUAS="de en"
MAKEOPTS="-j5"
PKGDIR="/var/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage-local/layman/x11 /usr/portage-local/layman/desktop-effects /usr/portage-local/layman/gentoojp /usr/portage-local/layman/nx /usr/portage-local/layman/sunrise /root/ebuilds"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip X a52 aac accessibility acct ace acpi ads aim aio akode alsa altenburgcards amarok amd64 amr amrnb amrr amrwb animgif apache2 arts async audacious audiofile bash-completion beagle berkdb bigpatch binfilter bittorrent bl blas blender-game boost bzip2 cairo ccache cdda cddb cdparanoia cdr cgi chroot cifsupcall cli clucene compress connectionstatus consolekit cpio cracklib crypt css cups curl cvs cvsgraph dbus dga dhcp directfb divx dmi dmx doc domainkeys dri dts dv dvb dvd dvdr dvdread ecc editor embedded encode esd exif extras fam fastbuild fat fbcon festival ffmpeg flac font-server fontconfig fortran gd gd-external gdbm gif gimp glib glitz glut gmp gnutls gpgme gpm graphite gstreamer gtk gzip hal hddtemp html http httpd hvm iceweasel iconv icq icu id3 idea idn ieee1394 image imagemagick innodb ipsec irc isdnlog ithreads jabber jack jadetex java java5 java6 javascript jce jfs jit john jpeg jpeg2k juju kde kdecards kdehiddenvisibility kdepim kdrive kexi kvm lame latex ldap libnotify libsamplerate lirc lm_sensors logrotate lzo mad matroska mbox mbrola mikmod mime mixer mjpeg mmap mmx mng mod_python motif mozdevelop mozdom mozilla mp3 mp3rtp mp4 mp4live mpd mpeg mpeg2 mpi mplayer mudflap multilib music mysql mysqli ncurses net network network-cron nforce2 nfs nfsv4 nls nntp nodrm nptl nptlonly nsplugin ntfs ntlm nvidia odbc offensive ogg ole openexr opengl openmp openssl oscar pam pango pascal paste64 pcap pcre pdf perl php player pmu png posix postfix povray pppd pulseaudio python qt3support qt4 quicktime randr12 rar rc5 rdesktop readline realmedia reflection remix restrict-javascript rpm rss rtsp samba scanner screen sdl sdl-image sdl-sound sdlaudio seamonkey sensord server session sharedmem shorten shout simplexml skins slang smime smp sndfile sockets socks5 soundex sox speech speex spell spl sql sqlite sqlite3 sse sse2 sse3 ssl stream subtitles subversion suhosin svg svgz sylpheed sysfs syslog szip t1lib tcl tcpd tcpwrapper test tetex tga theora thesaurus threads threadsafe tidy tiff tk transcode truetype type1 ucs2 unicode usb utempter uuencode v4l v4l2 valgrind vcd vdr vlm vnc vncviewer voice vorbis wav wavpack wifi wireshark wma wmf wmp wordperfect wxwindows x264 xanim xcb xcomposite xext xface xforms xfs xine xinerama xinetd xml xorg xosd xpm xrandr xscreensaver xskatcards xterm xv xvid xvmc xvnc yahoo yv12 zip zlib zrtp" 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 auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l vesa vga radeon" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Vadim 2009-10-05 14:53:36 UTC
Compiling is normal without any CFLAGS and CXXFLAGS
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2009-10-05 15:26:20 UTC
Anything above CFLAGS="-pipe -march=opteron-sse3 -O2" is like shooting yourself in a foot.

Try dropping your flags one by one until you find the offending one. That would be the minimal information required here.
Comment 3 Torsten Kaiser 2009-10-05 18:58:39 UTC
I didn't have much problems with these CFLAGS. Only some ICEs until I kicked -fsee out.

As pulseaudio-0.9.18-r50 did work with these CFLAGS, I assumed its some kind of amd64-gcc vs i686-asm-code problem. I wasn't aware that funny CFLAGS could cause such syntax errors.

Ok, I found the offening CFLAG:
CFLAGS="-pipe -march=opteron-sse3 -O2 -fweb" -> fails
CFLAGS="-pipe -march=opteron-sse3 -O3 -fomit-frame-pointer -frename-registers -ftracer -ftree-loop-im -funswitch-loops -fivopts -floop-interchange -floop-strip-mine -floop-block" -> works

... and I thought -fweb was one of the saver things to use.

I hope singling -fweb out is helpfull for you.
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-10-05 19:04:20 UTC
Okay now it definitely turns interesting, CCing toolchain to track this down. I'll see to reproduce.
Comment 5 Torsten Kaiser 2009-10-05 19:07:58 UTC
If you suspect a toolchain problem, here the infos about my gcc (Please note, that I have activated the 'graphite' useflag):
treogen ~ # emerge -pv gcc

These are the packages that would be merged, in order:

Calculating dependencies ... done!
[ebuild   R   ] sys-devel/gcc-4.4.1  USE="doc fortran graphite gtk mudflap (multilib) nls nptl openmp test (-altivec) -bootstrap -build (-fixed-point) -gcj (-hardened) -ip28 -ip32r10k -libffi -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -vanilla" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
treogen ~ # gcc --version
gcc (Gentoo 4.4.1 p1.0) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Comment 6 SpanKY gentoo-dev 2009-10-05 23:38:51 UTC
preprocess the file in question and then try to compile that with your crazy optimizations and see if it fails.  if it does, post the exact .i file you're compiling as well as the command line you're using.

most likely the pulseaudio code uses asm statements that are not 100% correct, but for most optimization, it squeaks by and no one notices.
Comment 7 Torsten Kaiser 2009-10-06 17:38:13 UTC
I got the command that failed during the emerge and generated the requested .i file for svolume_mmx.c.

Trying to compile this .i file with gcc -O1 results in an linker error, so it was assembled correctly. Using gcc -O1 -fweb fails:
treogen pa # gcc -O1 -fweb svolume_mmx.i
pulsecore/svolume_mmx.c: In function 'pa_volume_s16ne_mmx':
pulsecore/svolume_mmx.c:103: error: invalid 'asm': invalid expression as operand
pulsecore/svolume_mmx.c:103: error: invalid 'asm': invalid expression as operand
pulsecore/svolume_mmx.c:103: error: invalid 'asm': invalid expression as operand

(gcc -O0 -fweb seems to work...)
Comment 8 Torsten Kaiser 2009-10-06 17:39:32 UTC
Created attachment 206258 [details]
failing .i file
Comment 9 SpanKY gentoo-dev 2009-10-06 21:00:41 UTC
i think you're confused about what the compile driver is doing and the compile/assemble/linker steps.  any error you're seeing here is coming from the C compiler -- no assembler let alone linker has been invoked.

this doesnt appear to be a new issue.  same .i code fails with gcc-4.[0-4].

if you review this bit of code, pa_volume_s16ne_mmx() is causing the problems.  the gcc output doesnt clue you in as to which line is wrong though, so you have to delete inline asm lines until it narrows it down.  so the bug is in:

f(short *samples, int *volumes, unsigned channels, unsigned length)
{
    long channel, temp;
    asm volatile(
        "sub  %5, %4"
        : "+r"(samples), "+r"(volumes), "+r"(length),
            "=D"((long) channel), "=&r"(temp)
        : "X"((long) channels)
        : "cc");
}

(there were three such sub instructions before which is why there were three asm errors)

operand 4 is: "=&r"(temp)
operand 5 is: "X"((long) channels)

seems like "X" is a bad choice
Comment 10 Torsten Kaiser 2009-10-07 05:17:11 UTC
Its a new issue regarding pulseaudio.
Pulseaudio-0.9.18 did compile with -fweb, but 0.9.19 does not.

Seems that the bad 'X' constrain was added very recently:

http://git.0pointer.de/?p=pulseaudio.git;a=commitdiff;h=5eecd8ea7dcaca7536240b8a5800c686db51eee5
Comment 11 SpanKY gentoo-dev 2009-10-07 05:28:36 UTC
perhaps a different fix would have been to add "m" to the constraint list instead of replacing "r" with "X".  many people seem to miss the fact that constraints are a list and not just a single choice:
        : "rm"((long) channels)

at any rate, up to the sound/pulseaudio guys to address this.  dont think there's any toolchain issues here.
Comment 12 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-10-07 17:40:49 UTC
I've submitted a patch for this upstream testing now locally as a backport.
Comment 13 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-10-07 17:43:07 UTC
Fix committed, thanks for reporting, and thanks Mike for the fix.