Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1446)

Unified Diff: build/config/compiler/BUILD.gn

Issue 2858873005: [infra] Roll clang to match the version used by Flutter (Closed)
Patch Set: Fix Mac Android build Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 8c1818b2484047cfcb34e3d009ea8c1f912e2e8d..b33351bc992e8b17efbb936797bb2a3ca8052a0c 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -130,17 +130,6 @@ config("compiler") {
cflags_objcc += extra_flags
}
- if (is_clang) {
- # This is here so that all files get recompiled after a clang roll and
- # when turning clang on or off. (defines are passed via the command line,
- # and build system rebuild things when their commandline changes). Nothing
- # should ever read this define.
- defines +=
- [ "CR_CLANG_REVISION=" + exec_script("//tools/clang/scripts/update.py",
- [ "--print-revision" ],
- "trim string") ]
- }
-
# Mac-specific compiler flags setup.
# ----------------------------------
if (is_mac) {
@@ -365,12 +354,14 @@ config("compiler") {
defines += [ "HAVE_SYS_UIO_H" ]
# Use gold for Android for most CPU architectures.
- if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") {
+ if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
+ current_cpu == "arm64") {
ldflags += [ "-fuse-ld=gold" ]
if (is_clang) {
# Let clang find the ld.gold in the NDK.
- ldflags += [ "--gcc-toolchain=" +
- rebase_path(android_toolchain_root, root_build_dir) ]
+ toolchain_root = rebase_path(android_toolchain_root, root_build_dir)
+ ldflags += [ "--gcc-toolchain=$toolchain_root" ]
+ ldflags += [ "-B${toolchain_root}/bin" ]
}
}
@@ -391,9 +382,15 @@ config("compiler") {
if (current_cpu == "arm") {
cflags += [ "--target=arm-linux-androideabi" ]
ldflags += [ "--target=arm-linux-androideabi" ]
+ } else if (current_cpu == "arm64") {
+ cflags += [ "--target=aarch64-linux-android" ]
+ ldflags += [ "--target=aarch64-linux-android" ]
} else if (current_cpu == "x86") {
- cflags += [ "--target=x86-linux-androideabi" ]
- ldflags += [ "--target=x86-linux-androideabi" ]
+ cflags += [ "--target=i686-linux-androideabi" ]
+ ldflags += [ "--target=i686-linux-androideabi" ]
+ } else if (current_cpu == "x64") {
+ cflags += [ "--target=x86_64-linux-androideabi" ]
+ ldflags += [ "--target=x86_64-linux-androideabi" ]
}
}
}
@@ -452,7 +449,6 @@ config("runtime_library") {
# Work around incompatibilities between bionic and clang headers.
defines += [
"__compiler_offsetof=__builtin_offsetof",
- "nan=__builtin_nan",
]
}
@@ -483,25 +479,19 @@ config("runtime_library") {
]
lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ]
- libs += [ "$android_libcpp_library" ]
-
- if (current_cpu == "mipsel") {
- libs += [
- # ld linker is used for mips Android, and ld does not accept library
- # absolute path prefixed by "-l"; Since libgcc does not exist in mips
- # sysroot the proper library will be linked.
- # TODO(gordanac): Remove once gold linker is used for mips Android.
- "gcc",
- ]
- } else {
- libs += [
- # Manually link the libgcc.a that the cross compiler uses. This is
- # absolute because the linker will look inside the sysroot if it's not.
- rebase_path(android_libgcc_file),
- ]
+
+ libs += [
+ "$android_libcpp_library",
+ "c++abi",
+ "android_support",
+ ]
+
+ if (current_cpu == "arm") {
+ libs += [ "unwind" ]
}
libs += [
+ "gcc",
"c",
"dl",
"m",

Powered by Google App Engine
This is Rietveld 408576698