Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 319783 - www-client/chromium uses both CFLAGS and CXXFLAGS for C++ compilation
Summary: www-client/chromium uses both CFLAGS and CXXFLAGS for C++ compilation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High trivial (vote)
Assignee: Paweł Hajdan, Jr. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 23:02 UTC by Richard
Modified: 2010-06-14 21:32 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard 2010-05-14 23:02:47 UTC
When Chromium is built, the ebuild appears to pass the system CFLAGS to g++ twice.

Reproducible: Always

Steps to Reproduce:

Actual Results:  
Here is a copy and paste from build.log mid-compile:

  i686-pc-linux-gnu-g++ -O2 -march=prescott --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -pipe -fomit-frame-pointer -O2 -march=prescott --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -pipe -fomit-frame-pointer -D__STDC_CONSTANT_MACROS -pthread -fno-exceptions -Wall -Wno-unused-parameter -Wno-missing-field-initializers -D_FILE_OFFSET_BITS=64 -fvisibility=hidden -m32 -mmmx -fno-strict-aliasing -I/usr/include/libxml2 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -O2 -fno-ident -fdata-sections -ffunction-sections -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden '-DNO_HEAPCHECKER' '-DCHROMIUM_BUILD' '-DUSE_PROPRIETARY_CODECS' '-DENABLE_GPU=1' '-DGLEW_STATIC' '-DGL_GLEXT_PROTOTYPES' '-DU_STATIC_IMPLEMENTATION' '-DUSE_SYSTEM_LIBXML' '-DUSE_SYSTEM_ZLIB' '-D__STDC_FORMAT_MACROS' '-DNDEBUG' '-DNVALGRIND' -Ithird_party/icu/public/common -Ithird_party/icu/public/i18n -I. -Igpu -Ithird_party/glew/include -Iout/Release/obj/gen/chrome -Iout/Release/obj/gen/app/app_resources -Iskia/config -Ithird_party/skia/include/config -Ithird_party/skia/include/core -Ithird_party/skia/include/effects -Iskia/ext -Ithird_party/harfbuzz/src -Ithird_party/harfbuzz/contrib -Ithird_party/sqlite/preprocessed -Ithird_party/npapi -Ithird_party/npapi/bindings -MMD -MF out/Release/.deps/out/Release/obj.target/common/chrome/common/extensions/extension_message_bundle.o.d.raw -c -o out/Release/obj.target/common/chrome/common/extensions/extension_message_bundle.o chrome/common/extensions/extension_message_bundle.cc


Perhaps the ebuild is appending both CPPFLAGS and CXXFLAGS, which would explain the duplication. Here are the contents of emerge --info for my system:

# emerge --info
Portage 2.1.8.3 (default/linux/x86/10.0, gcc-4.4.3, glibc-2.11.1-r0, 2.6.33.4 i686)
=================================================================
System uname: Linux-2.6.33.4-i686-Genuine_Intel-R-_CPU_T2400_@_1.83GHz-with-gentoo-2.0.1
Timestamp of tree: Fri, 14 May 2010 22:00:23 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p5
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-r1
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.6b
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"
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 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2010-05-15 07:05:04 UTC
(In reply to comment #0)
> Perhaps the ebuild is appending both CPPFLAGS and CXXFLAGS, which would explain
> the duplication. Here are the contents of emerge --info for my system:

You don't have CPPFLAGS set :) It is first using CXXFLAGS, and then adding CFLAGS -- at least in 5.0.375.29. It should not be using CFLAGS for C++ compilations; they are allowed to contain options that are invalid for C++ (such as -Wimplicit-function-declaration).

Note that when this is fixed, the append-cflags from the ebuild should probably be changed to append-flags, or it will have no effect.

Adjusted summary, and removed version information as this happens with older versions too.
Comment 2 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2010-05-18 16:02:51 UTC
Note to self: the section that adds a file to .gyp can be removed from the ebuild, because the generated Makefile respects C/CXX/LDFLAGS from the environment. Make sure append-flags is used instead of, say, append-cflags to ensure the flags are effective.

Richard, thanks for spotting this bug. Fixing it will actually make the ebuild simpler and more maintainable. I plan to do it on the next bump, to make sure it's well compile-tested.
Comment 3 Richard 2010-05-18 19:14:35 UTC
(In reply to comment #2)
> Richard, thanks for spotting this bug. Fixing it will actually make the ebuild
> simpler and more maintainable. I plan to do it on the next bump, to make sure
> it's well compile-tested.
> 

Paweł, thanks for telling me that. Recently, I have been making a push to file bug reports for things that look like bugs and it is nice to know that my efforts have accomplished something.
Comment 4 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2010-05-21 09:11:52 UTC
Fixed in dev channel version bump.
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2010-06-14 21:32:35 UTC
*** Bug 323865 has been marked as a duplicate of this bug. ***