This change allows a clang toolchain to be used on ppc64 hosts.
This change is part of the effort to upstream a set of patches
that allow chromium to build and run on ppc64le hosts available here:
https://wiki.raptorcs.com/wiki/Porting/Chromium
Change-Id: I4496523f4948c675d4d1d8e529e0f4d5bbf99b8c
Reviewed-on: https://chromium-review.googlesource.com/c/1480698
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#635290}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 878414eeeb7995e61b5ed467feb41e2799fa493b
MIPS support was lacking in GN, only MIPS32 in combination with
CLANG was working properly.
This CL implements support for other flavors of MIPS, for
both CLANG and GCC compilers, in the context of V8 project that
needs it.
Bug:
Change-Id: Iaa4b4314cafe1631c40d75c151a82d52aa851131
Reviewed-on: https://chromium-review.googlesource.com/677302
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#506889}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4d62f13f73427a9c9881fe3249ceeebbe2226d4b
Currently, GN supports 32-bits LittleEndian targets (mipsel),
but GN does not supports 64-bits mips64el(such as loongson3a platform).
In order to successfully compile chromium on the mips64el platform,
this provides support for 64-bits LittleEndian targets with GN.
BUG=740468
R=machenbach@chromium.org, brettw@chromium.org
Change-Id: I348851fa545ebe940898484b9ceff17a88bcdc1d
Reviewed-on: https://chromium-review.googlesource.com/566751
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Brett Wilson <brettw@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#486293}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a735e99b56ecaf6d6bd8e6af59e27eb7720906f2
I intend to use the map file for binary size analysis.
Map file is gzipped, and is about 20MB for Android.
Adds ~2.5 seconds onto a 30 second link on my z620.
BUG=681694
Review-Url: https://codereview.chromium.org/2726983004
Cr-Original-Commit-Position: refs/heads/master@{#455482}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7d275da6c61c065510dcbcbd237636891d4b435a
toolchain_args is changing from a function call to a scope that can be passed around. Pipe these args through the various toolchain templates. This adds complexity in some cases, but it eliminates the need for the toolchain templates to know about every build flag they might ever be called with.
BUG=634446
Review-Url: https://codereview.chromium.org/2219953002
Cr-Original-Commit-Position: refs/heads/master@{#410853}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3c38c5cdab9e6fc35852ae79be5351be2bd6d49e
This also deletes references to gcc-based snapshot toolchains that
don't actually exist. Let's find out if they're actually needed anywhere ;).
The mips build was broken by the v8_target_cpu changes for 625353.
TBR=machenbach@chromium.org
BUG=625353, 629057
Review-Url: https://codereview.chromium.org/2159003002
Cr-Original-Commit-Position: refs/heads/master@{#406174}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fb1cadc07b5b8f97f1ef5ee9800a47ce6f6fe902
Currently v8_target_cpu can only be set to one particular architecture,
and that won't work for monochrome/webview builds where we need
to be able to build two different snapshots for two different architectures.
The way things are set are also confusing for when you need to do builds
for a target_cpu that is different from the host_cpu and the value of the
v8_target_cpu might get out of sync between target and host.
This change changes all that by making the cpu that v8 targets
a function of the current toolchain (thus declaring a v8_current_cpu
and using that instead).
R=brettw@chromium.org, jochen@chromium.org, michaelbai@chromium.org
BUG=625353
Review-Url: https://codereview.chromium.org/2116183002
Cr-Original-Commit-Position: refs/heads/master@{#405551}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8a2de90db035b90a891f0b980ab6162fd3995499
This change adds support for cross compiling chrome on ARM64 linux.
Temporarily disabled nacl and tcmalloc to fix compilation errors.
BUG=613452
Review-Url: https://codereview.chromium.org/2001523002
Cr-Original-Commit-Position: refs/heads/master@{#399766}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3026e6886f052160a3ff594801d5b4dbe8a20753
For example:
cc_wrapper="ccache"
cc_wrapper="icecc"
cc_wrapper="distcc"
cc_wrapper="ccache distcc"
In addition, it deprecates use_ccache and clang_dir.
A user who uses use_ccache must switch to cc_wrapper="ccache"
clang_dir supported icecc in the masquerade way. There is
2 ways to use external compiler wrapper. For example using icecc,
1) CC='icecc gcc'
2) masquerade icecc
mkdir /opt/icecc/bin
ln -s /usr/bin/icecc /opt/icecc/bin/gcc
ln -s /usr/bin/icecc /opt/icecc/bin/g++
export PATH=/opt/icecc/bin:$PATH
clang_dir="/opt/icecc/bin/"
This CL uses the #1 way because goma uses the #1 way, and removes
the #2 hack, which is clang_dir.
Review URL: https://codereview.chromium.org/1660053005
Cr-Original-Commit-Position: refs/heads/master@{#377251}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e279af1c9c511972000049b2c4d261161b48075d
This changes enables chrome for MIPS (Linux and Android)
to be compiled with clang when using gn build.
However, there are still few issues for build to complete successfully:
- "treat_warnings_as_errors=false" must be set for both Android and Linux.
- in case of Linux ldflags retreived by 'exec_script("sysroot_ld_path.py",..'
are ignored by linker, which is causing link failure for 'chrome' target.
BUG=gn gen for MIPS
TEST=gn gen out-gn/mips --args="is_debug=false target_os=\"android\" target_cpu=\"mipsel\" is_clang=true treat_warnings_as_errors=false"
ninja -C out-gn/mips chrome_public_apk
Review URL: https://codereview.chromium.org/1475943003
Cr-Original-Commit-Position: refs/heads/master@{#362002}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: af7fa747c3c2e433028103b45173c0275333abc7
This factors the commonalities of defining Clang toolchains into a
new "clang_toolchain" template. As well as reducing boilerplate in
build/toolchain/linux/BUILD.gn, this makes it more straightforward
to define variant toolchains the diverge slightly from the standard
Clang toolchains. One such divergence needed for the case of a
special toolchain to handle nacl_helper_bootstrap is the use_gold
setting; so that is plumbed through the gcc_toolchain template, and
the new clang_toolchain template, such that their invokers can get
their use_gold setting into the toolchain_args() block.
To make toolchain_args() overriding of use_gold affect the default
values of declare_args() variables that depend on use_gold, those
initializations are moved out of the declare_args() block.
BUG= none
R=dpranke@chromium.org
Review URL: https://codereview.chromium.org/1390383002
Cr-Original-Commit-Position: refs/heads/master@{#353081}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: de55ff1d33fcf3b5312034542d642b54766a25be
Avoid logic duplication between linux/android/... toolchain definitions
that all did the same thing. This is helpful for further work with
compiler prefixes / wrappers, in particular for non-goma-users.
Some toolchains used the prefix on nm and objcopy calls, this was probably
wrong and no longer happens. The toolchains that used gcc_toolchain.gni
but did not manually setup goma/ccache opt out of the setting to avoid
large behavior changes.
BUG=
Review URL: https://codereview.chromium.org/1361403002
Cr-Original-Commit-Position: refs/heads/master@{#350767}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: dfe796aa7deb3cb7c72dfdd294c73554b4e5c0c2
This changes various defaults about the ARM compiler setup so
that GN matches what GYP does today:
* Prefix for cross tools is arm-linux-gnueabihf- not arm-linux-gnueabi-
* arm_float_abi defaults to hard for non-Android ARMv7
* Non-CrOS ARM builds use the ARM sysroot by default
(the one installed by install-build-deps.sh --arm)
* Define a clang_arm toolchain, pass it the -no-integrated and
-target arm-linux-gnueabihf and switches as GYP does
R=dpranke@chromium.org, sbc@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1352313002
Cr-Original-Commit-Position: refs/heads/master@{#350100}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cc3a331e1bc91166a5d51fc1fa44fba49d1fb461
The newest version of GN replaces the 'cpu_arch' and 'os' variables with 'current_cpu', 'target_cpu', 'current_os', and 'target_os', and also replaces 'build_cpu' with 'host_cpu', and 'build_os' with 'host_os'.
The roll also picks up the change to add a new 'gn clean'
command, some absolute path handling fixes, a check_includes fix for action_foreach(), and some minor
internal fixes.
This patch also updates the build config files to accommodate the GN changes in a backwards-compatible manner, i.e., the configs now will set cpu_arch and os correctly in the right contexts. They will also allow the users to continue to set os= and cpu_arch= in an args file, so no user builds (or bots) will break.
Once all of the bots and all of the build files have been updated to refer to the new variables instead of the old ones, we can drop the backwards-compatible versions.
TBR=brettw@chromium.org
BUG=344767
CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:android_chromium_gn_compile_dbg,android_chromium_gn_compile_rel;tryserver.chromium.win:win8_chromium_gn_rel,win8_chromium_gn_dbg;tryserver.chromium.mac:mac_chromium_gn_rel,mac_chromium_gn_dbg
Review URL: https://codereview.chromium.org/936103003
Cr-Original-Commit-Position: refs/heads/master@{#317186}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7ee02bed35766535521c8e1f072b98cbf9eef53d
The problem was that the toolchain definitions had an is_clang block in them, but this is only evaluated in the context of the default toolchain (so false for and Android build). But then when we were re-evaluating the build config for the host compile, it was forcing clang to true which was causing the clang flags to be set.
This changes the way we default the is_clang value. Forcing it to true prevents it from being overridden manually. In some cases, like mac, this is pointless. In other cases like Linux, we may want to turn it on and off. Changing this definition allows us to toggle it on and off for different toolchains as we desire.
Ideally I think the way of defining toolchains would be different to make this a bit more flexible, I'll think about this. But this will work for now.
R=thakis@chromium.org
Review URL: https://codereview.chromium.org/385823002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@282685 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This fixes a lot of minor mistakes (mostly missing/extra files and flags) for the Mac GN build.
I separated out some clang flags into a config for extra clang warnings. Several of the third party libraries needed to remove this.
Removes the use_nss flag and uses !use_openssl. This is a result of discussion with rsleevi.
Removes extra duplicate net build file from secondary tree.
ui/gesture_events seems to be getting compiled in GN with more strict warnings than in GYP. Rather than fix this, I fixed the warning in the gesture recognizer unit test. It was returning a const copy (the const is pointless when you're copying).
This also removes a bunch of old GYP integration stuff that was left in the GN build.
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/239543013
git-svn-id: http://src.chromium.org/svn/trunk/src/build@264626 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Updates all rebase_path calls to use the new parameter ordering.
Use the new getenv function and delete the Python script we had to get the home directory.
Takes advantage of the new ability to have the default value of declare_args blocks be dependent on other values. This simplifies some code.
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/164773005
git-svn-id: http://src.chromium.org/svn/trunk/src/build@252065 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This hooks up Clang in the pure GN build (not the hybrid GYP mode).
Clang gave some warnings about compiler flags which made me realize that we were giving linker flags to the compiler in some cases. So I enhanced our pkg-config wrapper to to add libraries to the cflags (missing else), return ldflags separately, and also strip out -pthread which was getting included over and over.
BUG=
Review URL: https://codereview.chromium.org/147923010
git-svn-id: http://src.chromium.org/svn/trunk/src/build@248477 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This makes make_global_settings closer to the GYP version. Previously it had relied on GYP concatenating two lists when running with goma, but it doesn't actually behave this way, resulting in unexpected output.
TBR=scottmg
Review URL: https://codereview.chromium.org/132833002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@244104 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Refactors the toolchain definitions by adding an include file to help defining GCC toolchains. This eliminates most of the duplication on Linux and Android. Adds make_global_settings for most Linux and Mac builds that should match the GYP build (this will require some more passes to get every place to be an exact match).
Fixes Android build issues in WebKit. Fixes the definition of is_android.
Renames the Linux toolchains to use the GN name of the CPU architecture so one can refer to them without conditionals. Remove conditionals from BUILDCONFIG.gn
Adds the gyp_header variable to the help (it wasn't getting inserted into the list of available variables).
R=thakis@chromium.org
Review URL: https://codereview.chromium.org/117863003
git-svn-id: http://src.chromium.org/svn/trunk/src/build@242674 4ff67af0-8c30-449e-8e8b-ad334ec8d88c