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

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

Issue 2861903002: Revert "[infra] Roll clang to match the version used by Flutter" (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « build/config/android/config.gni ('k') | build/toolchain/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index f495361291f55085bd0827dd0433e24caba1890e..8c1818b2484047cfcb34e3d009ea8c1f912e2e8d 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -130,6 +130,17 @@ 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) {
@@ -354,8 +365,7 @@ 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" ||
- current_cpu == "arm64") {
+ if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") {
ldflags += [ "-fuse-ld=gold" ]
if (is_clang) {
# Let clang find the ld.gold in the NDK.
@@ -365,8 +375,10 @@ config("compiler") {
}
ldflags += [
- # Don't re-export visible symbols from libraries.
- "-Wl,--exclude-libs,ALL",
+ # Don't allow visible symbols from libgcc or libc++ to be
+ # re-exported.
+ "-Wl,--exclude-libs=libgcc.a",
+ "-Wl,--exclude-libs=libc++_static.a",
]
if (current_cpu == "arm") {
ldflags += [
@@ -379,15 +391,9 @@ 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=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" ]
+ cflags += [ "--target=x86-linux-androideabi" ]
+ ldflags += [ "--target=x86-linux-androideabi" ]
}
}
}
@@ -477,19 +483,25 @@ config("runtime_library") {
]
lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ]
-
- libs += [
- "$android_libcpp_library",
- "c++abi",
- "android_support",
- ]
-
- if (current_cpu == "arm") {
- libs += [ "unwind" ]
+ 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 += [
- "gcc",
"c",
"dl",
"m",
« no previous file with comments | « build/config/android/config.gni ('k') | build/toolchain/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698