Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 322137 - app-emulation/wine: strip fomit-frame-pointer and provide omitfp USE flag to include it
Summary: app-emulation/wine: strip fomit-frame-pointer and provide omitfp USE flag to ...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Wine Maintainers
URL: http://wiki.winehq.org/Gentoo
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-30 20:31 UTC by Richard
Modified: 2010-06-07 16:25 UTC (History)
0 users

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


Attachments
build.log showing that -fomit-frame-pointer is not being stripped (build.log.gz,128.29 KB, application/octet-stream)
2010-06-07 04:12 UTC, Richard
Details
build.log from building with -march=native (build.log.gz,125.35 KB, text/plain)
2010-06-07 13:52 UTC, Richard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard 2010-05-30 20:31:58 UTC
I had assumed that app-emulation/wine ebuilds ignored the system CFLAGS unless the custom-cflags flag was set, but after trying to file a bug report with the WINE project, I learned that this is the not the case. The WINE project does not like having WINE compiled with "-fomit-frame-pointer" and marks any bug report filed by Gentoo users who have it in their system CFLAGS as being invalid.

Reproducible: Always

Steps to Reproduce:
1. Install Gentoo Linux with -fomit-frame-pointer in system CFLAGS on a x86 system.
2. Install app-emulation/wine
3. Find a bug with a windows program that should go to upstream.
4. File a bug with upstream.
5. Have it marked invalid

Actual Results:  
The WINE project marked my bug report invalid.

Expected Results:  
They should have given it serious consideration. There was no crash to produce a stack trace, so the lack of frame pointers was not an issue, but the WINE project seems to be extremely -fomit-frame-pointer-phobic.

To resolve this, I suggest that app-emulation/wine treat -fomit-frame-pointer like sys-libs/glibc does. I.e. -fomit-frame-pointer would be stripped by default, with an option to add it after it had been stripped being controlled by a omitfp USE flag that must be explicitly specified by the user. That way, Gentoo Linux users that use -fomit-frame-pointer in their system USE flags would be able to report bugs to the WINE project without having them closed.

There is a good commentary on why -fomit-frame-pointer is an issue under WINE in the upstream bug report that I filed:

http://bugs.winehq.org/show_bug.cgi?id=22890#c8
Comment 1 Richard 2010-05-30 20:41:34 UTC
I originally made the severity of this bug "enhancement", but I have decided to change the severity to major following a closer examination of Philip J. Fry's comments at the WINE bug tracker.

In specific, "the frame pointer is necessary for wine to allow some of the more arcane /
hacky features to work, to be specific, support for certain stack-scanning copy
protection and anticheat mechanisms", which implies that failing to strip -fomit-frame-pointer frame-pointers breaks WINE.
Comment 2 Richard 2010-05-30 21:58:17 UTC
Another gentoo user at the upstream bug report is unable to reproduce this, so I am attaching my emerge --info:

$ emerge --info
Portage 2.1.8.3 (default/linux/x86/10.0, gcc-4.4.3, glibc-2.11.1-r0, 2.6.34 i686)
=================================================================
System uname: Linux-2.6.34-i686-Genuine_Intel-R-_CPU_T2400_@_1.83GHz-with-gentoo-2.0.1
Timestamp of tree: Sun, 30 May 2010 19:30:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r2, 3.1.2-r3
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.7b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=prescott --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /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"
CPPFLAGS="-O2 -march=prescott --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -pipe -fomit-frame-pointer"
CXXFLAGS="-O2 -march=prescott --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests buildpkg ccache distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=prescott --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://gentoo.netnitco.net http://distro.ibiblio.org/pub/linux/distributions/gentoo/"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/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="/var/lib/layman/sunrise /var/lib/layman/vmware /var/lib/layman/java-overlay /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi alsa apm berkdb bzip2 cdr cli consolekit cracklib crypt cups cxx dbus dri dvd dvdr fftw fortran gd gdbm gif gnutls gpm hal iconv ipv6 java java6 jpeg kde lzma midi mmap mmx mng modules mp3 mudflap ncurses networkmanager nls nptl nptlonly nsplugin opengl openmp pam pcre perl png pppd python qt3 qt3support qt4 readline reflection samba session spl sqlite sse sse2 sse3 ssl svg sysfs tcpd threads tiff unicode vorbis x264 x86 xml xorg xvmc 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 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 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" ELIBC="glibc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" NETBEANS_MODULES="*" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" 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:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 SpanKY gentoo-dev 2010-06-06 17:19:43 UTC
-fomit-frame-pointer is already stripped by `strip-flags`.  i see no evidence of this not working as it certainly seems to be for me.
Comment 4 Richard 2010-06-07 04:12:52 UTC
Created attachment 234359 [details]
build.log showing that -fomit-frame-pointer is not being stripped

The plain-text log file exceeded the attachment size limit, so I gzipped it. Run the following to see evidence that -fomit-frame-pointer is not being stripped:

zcat build.log.gz | grep "\-fomit\-frame\-pointer"
Comment 5 Richard 2010-06-07 04:15:03 UTC
(In reply to comment #3)
> -fomit-frame-pointer is already stripped by `strip-flags`.  i see no evidence
> of this not working as it certainly seems to be for me.
> 

I had assumed that this was easy to reproduce, so I did not think it was necessary to attach a build.log, but it seems that I was wrong to think that. I have attached a build log generated by the following command:

ebuild $(equery which wine) install
Comment 6 Richard 2010-06-07 04:18:36 UTC
While it likely does not matter, I have changed my system LDFLAGS since I made this bug report. They are now LDFLAGS="-Wl,-O1 -Wl,--as-needed".

I am right now working around this issue with an env file on my system:

# cat /etc/portage/env/app-emulation/wine 
CFLAGS="-O2 -march=prescott --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -pipe"
CPPFLAGS="${CFLAGS}"
CXXFLAGS="${CFLAGS}"
FCFLAGS="${CFLAGS}"
FFLAGS="${CFLAGS}"

I removed it prior to running ebuild $(equery which wine) install. Otherwise wine would build without frame pointers. Is it possible that you have an env file for WINE on your system?
Comment 7 SpanKY gentoo-dev 2010-06-07 09:51:15 UTC
your CPPFLAGS are stupid
Comment 8 Richard 2010-06-07 13:40:24 UTC
(In reply to comment #7)
> your CPPFLAGS are stupid
> 

GCC translates -march=native into "-march=prescott --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048" on my system. Specifying this manually is necessary for distcc.

Furthermore, I have recompiled WINE with -march=native and it appears that the WINE ebuild is using both CPPFLAGS and another flag variable in the build and one of them is not being stripped:

i686-pc-linux-gnu-gcc -c -I. -I. -I../../include -I../../include  -D__WINESRC__  -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -O2 -march=native -pipe -fomit-frame-pointer -O2 -march=native -pipe  -o meshbuilder.o meshbuilder.c

This is eerily similar to bug 319783.
Comment 9 Richard 2010-06-07 13:52:41 UTC
Created attachment 234423 [details]
build.log from building with -march=native

Here is a build.log file where I am compiling with -march=native. Notice that -fomit-frame-pointer is still present and that the compiler flags are specified twice, one with -fomit-frame-pointer and one without.
Comment 10 SpanKY gentoo-dev 2010-06-07 14:45:51 UTC
nothing you've said changes the fact that your CPPFLAGS are stupid.  those make absolutely no sense in CPPFLAGS.
Comment 11 Richard 2010-06-07 15:55:04 UTC
My latest build.log is from using:

CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
CPPFLAGS="${CFLAGS}"
CXXFLAGS="${CFLAGS}"
FCFLAGS="${CFLAGS}"
FFLAGS="${CFLAGS}"

Tell me, exactly what is "stupid" about this. I want to know so I can see if fixing it resolves the issue on my system.
Comment 12 SpanKY gentoo-dev 2010-06-07 16:04:50 UTC
i'm guessing you have no idea what CPP actually means.  it's the preprocessor.  optimization has no bearing, thus your attempts to do so there is completely useless.
Comment 13 Richard 2010-06-07 16:16:05 UTC
Ah, okay. I thought that CPP was an alternate name for C++, as usually file endings for C++ files are .cpp.

Considering that the CPPFLAGS are passed along with the CXXFLAGS, it might be a good idea to fix those too, but as far as I am concerned, this is fixed. :)
Comment 14 SpanKY gentoo-dev 2010-06-07 16:19:30 UTC
strip-flags already strips CXXFLAGS among others
Comment 15 Richard 2010-06-07 16:25:13 UTC
(In reply to comment #14)
> strip-flags already strips CXXFLAGS among others
> 

I meant to say that it might be a good idea to strip CPPFLAGS too because there are likely many ignorant people such as myself that assume that CPPFLAGS is an alias for CXXFLAGS on the basis that C++ source files are typically suffixed with ".cpp".

I should have used the verb "strip" instead of the verb "fix" in my previous comment.