Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 49452

Summary: libmpeg3 fails to compile with gcc 3.4
Product: Gentoo Linux Reporter: gent_bz
Component: Current packagesAssignee: Please assign to toolchain <gcc-porting>
Status: RESOLVED FIXED    
Severity: normal CC: sound
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 48528    
Attachments: 1.5.2-gcc-3.4.patch

Description gent_bz 2004-04-29 19:14:18 UTC
Linking fails with a long stream of missing symbols.  Band-aid application of CFLAGS += "-fno-unit-at-a-time" gets things working

Reproducible: Always
Steps to Reproduce:
1. emerge =sys-devel/gcc-3.4.0
2. emerge libmpeg3





Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.4.0, glibc-2.3.3_pre20040420-r0,
2.6.5-gentoo-r1)
=================================================================
System uname: 2.6.5-gentoo-r1 i686 AMD Athlon(tm)
Gentoo Base System version 1.4.10
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -ftracer -pipe
-maccumulate-outgoing-args -fprefetch-loop-arrays"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -ftracer -pipe
-maccumulate-outgoing-args -fprefetch-loop-arrays"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://linux.ntcu.net/dists/gentoo/
http://gentoo.seren.com/gentoo http://gentoo.ccccom.com"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://192.168.0.238/gentoo-portage"
USE="3dnow X aalib alsa apm avi berkdb cdr crypt cups curl dedicated dv dvd
encode esd faad foomaticdb gdbm gif gnome gpm gstreamer gtk gtk2 imlib jpeg lcms
libg++ libwww mad mbox mikmod mmx motif mozilla mpeg ncurses nls nptl oggvorbis
opengl oss pam pdflib perl png ppds python qt quicktime readline samba sdl slang
spell sse ssl tcpd tiff truetype usb videos wmf x86 xml xml2 xmms xv zlib"
Comment 1 ecco 2004-05-04 04:25:33 UTC
This is basicly the same as bug #49383 for ffmpeg, so I'll quote Ed Catmur:

"Yup, use __attribute__((used)):

     * The new unit-at-a-time compilation scheme has several compatibility issues:
          + The order in which functions, variables, and top-level asm statements are emitted may have changed. Code relying on some particular ordering
            needs to be updated. The majority of such top-level asm statements can be replaced by section attributes.
          + Unreferenced static variables and functions are removed. This may result in undefined references when an asm statement refers to the
            variable/function directly. In that case either the variable/function shall be listed in asm statement operand or in the case of top-level
            asm statements the attribute used shall be used to force function/variable to be always output and considered as a possibly used by unknown
            code.
            For variables the attribute is accepted only by GCC 3.4 and newer, while for earlier versions it is sufficient to use unused to silence
            warnings about the variables not being referenced. To keep code portable across different GCC versions, you can use appropriate preprocessor
            conditionals.

Note: applying __attribute__((used)) to a variable is an error in gcc 3.3 and
below. This patch needs to be conditionally applied, or expanded to use a
#ifdef, on the version of gcc used."

So I made a small patch using __attribute__((used)).
Comment 2 ecco 2004-05-04 04:29:04 UTC
Created attachment 30695 [details, diff]
1.5.2-gcc-3.4.patch

Ed Catmur: "applying __attribute__((used)) to a variable is an error in gcc 3.3
and
below. This patch needs to be conditionally applied, or expanded to use a
#ifdef, on the version of gcc used."
Comment 3 SpanKY gentoo-dev 2004-05-16 12:48:19 UTC
added to cvs, thanks for the patch