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
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.
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.
(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.
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.
(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.
(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.