Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 361303 - x11-libs/qt-core: mkspecs always add CFLAGS="-pipe" even for in-portage builds
Summary: x11-libs/qt-core: mkspecs always add CFLAGS="-pipe" even for in-portage builds
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Low minor (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2011-03-30 13:53 UTC by Agostino Sarubbo
Modified: 2012-04-19 22:48 UTC (History)
1 user (show)

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


Attachments
qt-core-mkspecs.patch (qt-core-mkspecs.patch,494 bytes, patch)
2012-01-24 11:07 UTC, Michael Palimaka (kensington)
Details | Diff
qt4-r2.eclass.patch (qt4-r2.eclass.patch,1.03 KB, patch)
2012-01-25 10:08 UTC, Michael Palimaka (kensington)
Details | Diff
qt4-r2.eclass.patch (alternative approach) (qt4-r2.eclass.patch,615 bytes, patch)
2012-01-27 12:22 UTC, Michael Palimaka (kensington)
Details | Diff
qt4-r2.eclass.patch (qt4-r2.eclass.patch,810 bytes, patch)
2012-04-01 18:18 UTC, Michael Palimaka (kensington)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2011-03-30 13:53:35 UTC
$summary

For alla packages that compiles with eqmake4 i see -pipe..
Simple past for wpa_supplicant build log

x86_64-pc-linux-gnu-gcc -c -pipe -march=native -O2 -g0 -Wall -W -D_REENTRANT -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I.. -I../../src -I../../src/utils -I.moc -I.ui -o .obj/os_unix.o ../../src/utils/os_unix.c
Comment 1 Davide Pesavento (RETIRED) gentoo-dev 2011-03-30 14:30:37 UTC
your emerge --info please
Comment 2 Agostino Sarubbo gentoo-dev 2011-03-30 14:35:56 UTC
Portage 2.1.9.42 (default/linux/amd64/10.0, gcc-4.4.5, glibc-2.11.3-r0, 2.6.32-gentoo-r24 x86_64)                                                                                   
=================================================================                                                                                                                   
System uname: Linux-2.6.32-gentoo-r24-x86_64-Intel-R-_Core-TM-_i3_CPU_540_@_3.07GHz-with-gentoo-1.12.14                                                                             
Timestamp of tree: Wed, 30 Mar 2011 12:30:01 +0000                                                                                                                                  
app-shells/bash:     4.1_p9                                                                                                                                                         
dev-java/java-config: 2.1.11-r3                                                                                                                                                     
dev-lang/python:     2.7.1-r1, 3.1.3-r1                                                                                                                                             
dev-util/cmake:      2.8.4                                                                                                                                                          
sys-apps/baselayout: 1.12.14-r1                                                                                                                                                     
sys-apps/sandbox:    2.4                                                                                                                                                            
sys-devel/autoconf:  2.65-r1                                                                                                                                                        
sys-devel/automake:  1.11.1                                                                                                                                                         
sys-devel/binutils:  2.20.1-r1                                                                                                                                                      
sys-devel/gcc:       4.4.5                                                                                                                                                          
sys-devel/gcc-config: 1.4.1                                                                                                                                                         
sys-devel/libtool:   2.2.10                                                                                                                                                         
sys-devel/make:      3.81-r2                                                                                                                                                        
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)                                                                                                                            
ACCEPT_KEYWORDS="amd64"                                                                                                                                                             
ACCEPT_LICENSE="*"                                                                                                                                                                  
CBUILD="x86_64-pc-linux-gnu"                                                                                                                                                        
CFLAGS="-march=native -O2 -g0"                                                                                                                                                      
CHOST="x86_64-pc-linux-gnu"                                                                                                                                                         
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"                                                                                                              
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/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"                                                                                                                                                                          
CXXFLAGS="-march=native -O2 -g0"                                                                                                                                                    
DISTDIR="/media/sources"
FEATURES="assume-digests binpkg-logs collision-protect distlocks fixlafiles fixpackages multilib-strict news parallel-fetch protect-owned sandbox sfperms split-log strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="zh af ca cs da de el es et fr gl hr hu it nb nl pl pt ro ru sk sl sv uk bg cy en eo fo ga he id ku lt lv mk ms nn sw tn zu ja zh_TW en_GB pt_BR ko zh_CN ar en_CA fi kk oc sr tr fa wa nds as be bn bn_BD bn_IN en_US es_AR es_CL es_ES es_MX eu fy fy_NL ga_IE gu gu_IN hi hi_IN is ka kn ml mr nb_NO nn_NO or pa pa_IN pt_PT rm si sq sv_SE ta ta_LK te th vi ast dz km my om sh ug uz ca@valencia sr@ijekavian sr@ijekavianlatin sr@latin csb hne mai se es_LA fr_CA zh_HK br la no es_CR et_EE sr_CS bo hsb hy mn sr@Latn lb ne bs tg uz@cyrillic xh be_BY brx ca_XV dgo en_ZA gd kok ks ky lo mni nr ns pap ps rw sa_IN sat sd ss st sw_TZ ti ts ve"
MAKEOPTS="-j4"
PKGDIR="/media/sources/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="/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa amd64 apache2 assistant bash-completion berkdb bzip2 cairo cd cdr cli cracklib crypt cups curl cxx dbus dri dvd dvdr extensions extras ffmpeg fontconfig fortran gdbm gnutls gpm gstreamer gtk iconv icu imagemagick imap ipv6 ithreads jadetex jpeg kde lame mmx modules mp3 mudflap multilib mysql ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre pdo perl png postgres pppd python qt3support qt4 readline sasl sdl session sqlite sse sse2 ssl svg symlink sysfs tcpd threads tk truetype unicode v4l v4l2 vhosts vorbis webcam xcb xorg zlib zsh-completion" ALSA_CARDS="hda-intel" 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 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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="mouse evdev keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="zh af ca cs da de el es et fr gl hr hu it nb nl pl pt ro ru sk sl sv uk bg cy en eo fo ga he id ku lt lv mk ms nn sw tn zu ja zh_TW en_GB pt_BR ko zh_CN ar en_CA fi kk oc sr tr fa wa nds as be bn bn_BD bn_IN en_US es_AR es_CL es_ES es_MX eu fy fy_NL ga_IE gu gu_IN hi hi_IN is ka kn ml mr nb_NO nn_NO or pa pa_IN pt_PT rm si sq sv_SE ta ta_LK te th vi ast dz km my om sh ug uz ca@valencia sr@ijekavian sr@ijekavianlatin sr@latin csb hne mai se es_LA fr_CA zh_HK br la no es_CR et_EE sr_CS bo hsb hy mn sr@Latn lb ne bs tg uz@cyrillic xh be_BY brx ca_XV dgo en_ZA gd kok ks ky lo mni nr ns pap ps rw sa_IN sat sd ss st sw_TZ ti ts ve" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_req limit_zone map memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi addition cache_purge dav degradation flv geoip gzip_static headers_more image_filter passenger perl push random_index realip secure_link stub_status sub xslt" NGINX_MODULES_MAIL="imap pop3 smtp" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Davide Pesavento (RETIRED) gentoo-dev 2011-04-07 19:21:59 UTC
Why do you think that -pipe is added by eqmake4?
Comment 4 Agostino Sarubbo gentoo-dev 2011-04-07 19:38:17 UTC
i don't think that is added by eqmake4. I say only that there is always -pipe when the buildsystem is qmake..now who adds -pipe??
Comment 5 Michael Palimaka (kensington) gentoo-dev 2012-01-24 11:07:11 UTC
Created attachment 299721 [details, diff]
qt-core-mkspecs.patch

It looks like -pipe is being defined as a default CFLAG in /usr/share/qt4/mkspecs/, and user CFLAGS appended to it.

Attached is a patch that removes the obvious offended I noticed, however it seems quite hack-y, so I wonder if there's a better solution.
Comment 6 Davide Pesavento (RETIRED) gentoo-dev 2012-01-24 13:09:09 UTC
Yeah, I already investigated this issue some time ago but forgot to report my findings here.

Unfortunately the solution isn't that simple. Patching mkspecs has a global effect and would change the behaviour of qmake for out-of-portage builds too, which is undesirable (see e.g. bug #352778). We need a solution that fixes both problems at the same time.
Comment 7 Michael Palimaka (kensington) gentoo-dev 2012-01-25 10:08:45 UTC
Created attachment 299815 [details, diff]
qt4-r2.eclass.patch

Here's a different approach.
Instead of patching mkspecs files, add a rule to .pro files to strip offending flags.
Comment 8 Davide Pesavento (RETIRED) gentoo-dev 2012-01-25 17:19:56 UTC
(In reply to comment #7)
> Created attachment 299815 [details, diff] [details, diff]
> qt4-r2.eclass.patch
> 
> Here's a different approach.
> Instead of patching mkspecs files, add a rule to .pro files to strip offending
> flags.

This approach is definitely better, but it does not work if the user has any DELETE_FLAGS among his CFLAGS in /etc/make.conf, because the .pro file tells qmake to remove them (i.e. user's CFLAGS are ignored).
It *might* work if eqmake4 adds "-after" to qmake arguments, I haven't tested though.
Comment 9 Michael Palimaka (kensington) gentoo-dev 2012-01-26 02:21:25 UTC
(In reply to comment #8)
> This approach is definitely better, but it does not work if the user has any
> DELETE_FLAGS among his CFLAGS in /etc/make.conf
That's strange, my CFLAGS of -O2 -pipe -ggdb were left intact while I was testing. Is there some particular package where this patch causes user CFLAGS to be ignored, that I may use for testing?
Comment 10 Davide Pesavento (RETIRED) gentoo-dev 2012-01-27 11:20:08 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > This approach is definitely better, but it does not work if the user has any
> > DELETE_FLAGS among his CFLAGS in /etc/make.conf
> That's strange, my CFLAGS of -O2 -pipe -ggdb were left intact while I was
> testing. Is there some particular package where this patch causes user CFLAGS
> to be ignored, that I may use for testing?

I tried more or less the following:

$ echo "QMAKE_CFLAGS -= -fbar" > test.pro
$ qmake QMAKE_CFLAGS="-fbar"
$ grep fbar Makefile

However, I just remembered eqmake4 uses QMAKE_CFLAGS_{RELEASE,DEBUG}, so my test may be irrelevant...
Comment 11 Michael Palimaka (kensington) gentoo-dev 2012-01-27 12:22:02 UTC
Created attachment 300037 [details, diff]
qt4-r2.eclass.patch (alternative approach)

(In reply to comment #10)
> However, I just remembered eqmake4 uses QMAKE_CFLAGS_{RELEASE,DEBUG}, so my
> test may be irrelevant...
As such I don't believe it would cause interference. Your comment however gave me an idea for a much simpler potential solution (I don't know why I didn't try it before).

For the packages I tested with, the attached patch overrides mkspecs nicely.
Comment 12 Davide Pesavento (RETIRED) gentoo-dev 2012-02-21 14:18:25 UTC
That can be extended to LFLAGS I guess..
Comment 13 Michael Palimaka (kensington) gentoo-dev 2012-04-01 18:18:33 UTC
Created attachment 307401 [details, diff]
qt4-r2.eclass.patch

(In reply to comment #12)
> That can be extended to LFLAGS I guess..

Updated patch to include that.
Comment 14 Davide Pesavento (RETIRED) gentoo-dev 2012-04-05 12:52:35 UTC
Patch applied to qt overlay for testing.
Comment 15 Davide Pesavento (RETIRED) gentoo-dev 2012-04-19 22:48:36 UTC
Moved to tree, closing.

  19 Apr 2012; Davide Pesavento <pesa@gentoo.org> qt4-r2.eclass:
  Overhaul *FLAGS handling in eqmake4() to fix bug 361303. Thanks to Michael
  (kensington) for the patch.