-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path0028-build-config-compiler-add-build-flags-for-clang.patch
48 lines (43 loc) · 1.67 KB
/
0028-build-config-compiler-add-build-flags-for-clang.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 20c72b8a114d65b82decba916133c7c56c1e84b5 Mon Sep 17 00:00:00 2001
From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
Date: Mon, 25 Jul 2022 14:29:11 +0800
Subject: [PATCH 28/68] build: config: compiler: add build flags for clang
This will resolve build failure on v8 when using clang.
Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
---
build/config/compiler/BUILD.gn | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 2b09584757ad..e2eadac1dafb 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1511,6 +1511,8 @@ config("default_warnings") {
# this as well. http://crbug.com/316352
"-Wno-unneeded-internal-declaration",
"-Wno-unused-function",
+ "-Wno-invalid-offsetof",
+ "-Wno-range-loop-construct",
]
if (!is_nacl || is_nacl_saigo) {
@@ -1938,8 +1940,17 @@ config("no_incompatible_pointer_warnings") {
# Shared settings for both "optimize" and "optimize_max" configs.
# IMPORTANT: On Windows "/O1" and "/O2" must go before the common flags.
if (is_win) {
- common_optimize_on_cflags = [
- "/Ob2", # Both explicit and auto inlining.
+ common_optimize_on_cflags = []
+ if(is_clang) {
+ common_optimize_on_cflags += [
+ "/Ob2", # Both explicit and auto inlining.
+ ]
+ } else {
+ common_optimize_on_cflags += [
+ "/Ob3", # Both explicit and auto inlining.
+ ]
+ }
+ common_optimize_on_cflags += [
"/Oy-", # Disable omitting frame pointers, must be after /O2.
"/Zc:inline", # Remove unreferenced COMDAT (faster links).
]
--
2.30.2