Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 182728 - [4.1/bad code] media-libs/xvid fails when dev-lang/yasm is compiled with -O2 -fforce-addr
Summary: [4.1/bad code] media-libs/xvid fails when dev-lang/yasm is compiled with -O2 ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 185168 202367 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-20 20:16 UTC by Nico R. Wohlgemuth
Modified: 2009-04-13 22:33 UTC (History)
6 users (show)

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


Attachments
fail of xvid (fail.log,5.00 KB, text/plain)
2007-06-20 20:40 UTC, Nico R. Wohlgemuth
Details
pp_cleanup.disasm.bad (pp_cleanup.disasm.bad,2.19 KB, text/plain)
2007-06-22 16:59 UTC, SpanKY
Details
pp_cleanup.disasm.good (pp_cleanup.disasm.good-4.1.2,2.65 KB, text/plain)
2007-06-22 16:59 UTC, SpanKY
Details
yasm-bad.c (yasm-bad.c,3.33 KB, text/plain)
2007-06-23 14:45 UTC, SpanKY
Details
pp_cleanup.disasm.good-4.2.0 (pp_cleanup.disasm.good-4.2.0,1.99 KB, text/plain)
2007-06-23 14:50 UTC, SpanKY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nico R. Wohlgemuth 2007-06-20 20:16:28 UTC
media-libs/xvid fails when dev-lang/yasm is compiled with -fforce-addr

I think in the ebuild flag-o-matic should be interhited which removes the -fforce-addr CFLAG.

Reproducible: Always

Steps to Reproduce:
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-06-20 20:22:33 UTC
Please, post the actualy errors and emerge --info output.
Comment 2 Nico R. Wohlgemuth 2007-06-20 20:38:45 UTC
emerge --info:

Portage 2.1.3_rc4 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.5-r3, 2.6.22-rc5-moo-r1 i686)
=================================================================
System uname: 2.6.22-rc5-moo-r1 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System release 1.12.10
Timestamp of tree: Tue, 19 Jun 2007 14:20:01 +0000
ccache version 2.4 [enabled]
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=prescott -fforce-addr -fomit-frame-pointer -fno-ident -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=prescott -fforce-addr -fomit-frame-pointer -fno-ident -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg ccache distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/mpd /usr/portage/local/user"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa bash-completion berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt cups divx dts dvd dvdread emboss evo firefox gdbm gif gpm gstreamer gtk gtk2 iconv icq imagemagick imlib jabber joystick jpeg ldap libg++ mad maildir midi mikmod mmx mmxext mp3 mpeg mplayer msn mudflap ncurses nls nptl nptlonly nsplugin nvidia offensive ogg opengl openmp oss pam pcre pdf perl png python quicktime readline sdl session spl sse sse2 ssl svg tcpd tiff truetype truetype-fonts type1-fonts unicode urandom usb vcd vim-syntax vorbis win32codecs x86 xml xorg xpm xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev joystick keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="nvidia vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Nico R. Wohlgemuth 2007-06-20 20:40:59 UTC
Created attachment 122636 [details]
fail of xvid

it does not evertime fail at the same file but it will fail if yasm is compiled with -fforce-addr
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-06-20 20:58:38 UTC
Hmm...
Comment 5 SpanKY gentoo-dev 2007-06-22 01:17:11 UTC
no, -fforce-addr will not be filtered ... dont use the flag if it causes you problems
Comment 6 Nico R. Wohlgemuth 2007-06-22 11:03:38 UTC
-fforce-addr is a safe cflag, the only package where it is not working is yasm.
Comment 7 SpanKY gentoo-dev 2007-06-22 11:08:45 UTC
incorrect ... if -fforce-addr were a "safe" flag, we wouldnt be seeing bugs about it now would we ?

ignoring that, it seems like a pointless flag in the first place to be added globally
Comment 8 SpanKY gentoo-dev 2007-06-22 13:04:19 UTC
seems to be localized in modules/preprocs/nasm/nasm-pp.c ... if all of yasm is compiled with -O0 but that one is compiled with -O2 -fforce-addr, it crashes on something simple like:
yasm /dev/null
Comment 9 SpanKY gentoo-dev 2007-06-22 16:58:30 UTC
narrowing down further ... looks like just pp_cleanup() ... this code:

    for (h = 0; h < NHASH; h++) {
        while (mmacros[h]) {
            MMacro *m = mmacros[h];
            mmacros[h] = mmacros[h]->next;
            free_mmacro(m);
        }
        while (smacros[h]) {
            SMacro *s = smacros[h];
            smacros[h] = smacros[h]->next;
            nasm_free(s->name);
            free_tlist(s->expansion);
            nasm_free(s);
        }
    }

with -O2, we get ~185 bytes ... with -O2 -fforce-addr we get 131 bytes
Comment 10 SpanKY gentoo-dev 2007-06-22 16:59:41 UTC
Created attachment 122816 [details]
pp_cleanup.disasm.bad
Comment 11 SpanKY gentoo-dev 2007-06-22 16:59:54 UTC
Created attachment 122818 [details]
pp_cleanup.disasm.good
Comment 12 SpanKY gentoo-dev 2007-06-23 14:45:10 UTC
Created attachment 122896 [details]
yasm-bad.c

the C snippet which, when built with -O2 -fforce-addr, causes the crash
Comment 13 SpanKY gentoo-dev 2007-06-23 14:50:28 UTC
Created attachment 122897 [details]
pp_cleanup.disasm.good-4.2.0
Comment 14 SpanKY gentoo-dev 2007-06-23 16:42:55 UTC
this appears to be fixed for gcc-4.1.3, so unless someone can snipe the patch that fixes this, the answer is to wait for that version
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2007-07-13 08:01:03 UTC
*** Bug 185168 has been marked as a duplicate of this bug. ***
Comment 16 parafin 2007-07-16 22:36:21 UTC
So is -fforce-addr supported or not? There was a bug #155679 where it was considered as supportes, smth has changed?
Comment 17 SpanKY gentoo-dev 2007-07-16 23:30:53 UTC
should bugs be reported in the toolchain and fixed ?  of course

should we go as far as filtering it ?  i dont think so
Comment 18 Jakub Moc (RETIRED) gentoo-dev 2007-12-15 09:59:31 UTC
*** Bug 202367 has been marked as a duplicate of this bug. ***
Comment 19 Hendrik Friedel 2009-03-08 10:49:02 UTC
Hello,

ok, summary: two workarounds exist:
a) gcc>4.1.3
b) compile without -fforce-add.

The problem with a) : no 4.1.3 ebuild exists. Thus you need to update to 4.2.* or newer. This requires a emerge system and emerge world and I don't know if this has ever worked without trouble...

Thus b) is the only workable solution.

here, you need to understand that you need to compile yasm without this cflag. All other problems compiling other software is only a result of this problem.

--> look up your cflags in /etc/make.conf, remove -fforce-add and emerge:
CFLAGS="......" emerge yasm.

That's it.

Greetings,
Hendrik
Comment 20 SpanKY gentoo-dev 2009-04-13 22:33:23 UTC
gcc-4.3 is stable, no plans to fix gcc-4.1