Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 491848 - www-client/chromium - bundled v8 engine does not respect CXXFLAGS and CXX
Summary: www-client/chromium - bundled v8 engine does not respect CXXFLAGS and CXX
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-21 09:01 UTC by octoploid
Modified: 2016-11-19 02:15 UTC (History)
2 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 octoploid 2013-11-21 09:01:45 UTC
With:
CXXFLAGS="-march=native -O2 -pipe"
CXX="clang++"
in /etc/make.conf I get for example:

x86_64-pc-linux-gnu-g++ -MMD -MF obj.host/v8/src/x64/v8_base.x64.full-codegen-x64.o.d -DANGLE_DX11 -D_FILE_OFFSET_BITS=64 -DNO_TCMALLOC -DDISABLE_NACL -DCHROMIUM_BUILD -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_NSS=1 -DUSE_X11=1 -DENABLE_ONE_CLICK_SIGNIN -DGTK_DISABLE_SINGLE_INCLUDES=1 -DUSE_XI2_MT=2 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_INPUT_SPEECH -DENABLE_NOTIFICATIONS -DLOGGING_IS_OFFICIAL_BUILD=1 -DENABLE_EGLIMAGE=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_BACKGROUND=1 -DENABLE_AUTOMATION=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_FULL_PRINTING=1 -DENABLE_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_MANAGED_USERS=1 -DENABLE_MDNS=1 -DV8_TARGET_ARCH_X64 -DENABLE_DEBUGGER_SUPPORT -DV8_I18N_SUPPORT -DU_USING_ICU_NAMESPACE=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen/shim_headers/icuuc/host -Igen/shim_headers/icui18n/host -I../../v8/src -fstack-protector --param=ssp-buffer-size=4  -pthread -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-format -Wno-unused-result -m64 -fno-ident -fdata-sections -ffunction-sections -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wno-deprecated  -c ../../v8/src/x64/full-codegen-x64.cc -o obj.host/v8/src/x64/v8_base.x64.full-codegen-x64.o

The rest of the chromium build uses the flags just fine.

Reproducible: Always
Comment 1 Mike Gilbert gentoo-dev 2013-11-21 16:34:58 UTC
The chromium build process uses 2 separate toolchains:

target: This uses CXX and CXXFLAGS
host: This uses BUILD_CXX and possibly BUILD_CXXFLAGS

Try setting BUILD_CXX in make.conf or your environment.
Comment 2 Mike Gilbert gentoo-dev 2013-11-21 16:38:01 UTC
Correction: the host toolchain will probably ignore BUILD_CXXFLAGS, but it doesn't really matter; this toolchain is only used to build programs which are executed during the build process.
Comment 3 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-11-21 16:54:10 UTC
(In reply to Mike Gilbert from comment #1)
> The chromium build process uses 2 separate toolchains:
> 
> target: This uses CXX and CXXFLAGS
> host: This uses BUILD_CXX and possibly BUILD_CXXFLAGS
> 
> Try setting BUILD_CXX in make.conf or your environment.

Right, it'd be interesting to see the results of that. Note that it's only a workaround, I'd still like to apply the users's flags and CXX choice.

(In reply to Mike Gilbert from comment #2)
> Correction: the host toolchain will probably ignore BUILD_CXXFLAGS, but it
> doesn't really matter; this toolchain is only used to build programs which
> are executed during the build process.

It's probably a low-severity bug, but I'd still like to get that fixed. I'll take a look at the build system and see what's different.
Comment 4 octoploid 2013-11-21 17:31:50 UTC
Yes setting BUILD_CXX in make.conf works fine.
I guess one could edit build_ffmpeg.sh to add CXXFLAGS support:
 add_flag_common -optflags=...
 add_flag_common --extra-cxxflags=...
(see ffmpeg-2.1.ebuild)

build_ffmpeg.sh also contains an outdated (ld)gold check,
that I had to delete to get past it (I use gold as my system linker).

BTW do you guys know how to disable SSSE3 in the whole tree?
Because a clang lto build will fail with linker errors otherwise.
(My AMD machine doesn't support SSE3 and SSSE3).
A normal clang build works fine.
Comment 5 Mike Gilbert gentoo-dev 2013-11-21 18:02:17 UTC
(In reply to Paweł Hajdan, Jr. from comment #3)
> Right, it'd be interesting to see the results of that. Note that it's only a
> workaround, I'd still like to apply the users's flags and CXX choice.
> 

Except that if you are trying to cross-compile, you definitely don't want to use CXX for the chromium's host toolchain.

I guess we could have BUILD_CXX default to CXX if tc-is-cross-compiler returns false.
Comment 6 Mike Gilbert gentoo-dev 2013-11-21 18:05:25 UTC
(In reply to Paweł Hajdan, Jr. from comment #3)
> It's probably a low-severity bug, but I'd still like to get that fixed. I'll
> take a look at the build system and see what's different.

You are probably already aware, but we do a little juggling in the ebuild:

    # Tools for building programs to be executed on the build system, bug #410883.
    export AR_host=$(tc-getBUILD_AR)
    export CC_host=$(tc-getBUILD_CC)
    export CXX_host=$(tc-getBUILD_CXX)
    export LD_host=${CXX_host}

I did some grepping through the gyp source, and I didn't see anything like "CXXFLAGS_host", or any other obvious way to specify that.