68c37f25a92474205503ef8a8dcc8717df0f8b0c
[AGL/meta-agl-demo.git] / recipes-wam / cef / files / chromium / 0003-Remove-the-GN-settings-done-for-clang-that-conflict-.patch
1 From 22de50ac2371aed1e04e4cb248beabb7f8ad3ebe Mon Sep 17 00:00:00 2001
2 From: Roger Zanoni <rzanoni@igalia.com>
3 Date: Thu, 27 Apr 2023 16:16:28 +0200
4 Subject: [PATCH 3/9] Remove the GN settings done for clang that conflict with
5  OE
6
7 clang cross compiler that is build with meta-clang has lot of these
8 settings built-in and specifying them here confuses the compiler
9
10 --target option and -no-canonical-prefixes options result in clang
11
12 finding the headers in target sysroot
13
14 Upstream-Status: Inappropriate [OE-Specific]
15
16 Signed-off-by: Khem Raj <raj.khem@gmail.com>
17 Rebased-by: Maksim Sisov <msisov@igalia.com>
18 Rebased-by: Randy MacLeod <randy.macleod@windriver.com>
19 Rebased-by: Roger Zanoni <rzanoni@igalia.com>
20 ---
21  build/config/compiler/BUILD.gn | 37 ----------------------------------
22  1 file changed, 37 deletions(-)
23
24 diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
25 index 531b326c498d0..244a6757613d5 100644
26 --- a/build/config/compiler/BUILD.gn
27 +++ b/build/config/compiler/BUILD.gn
28 @@ -924,11 +924,6 @@ config("compiler_cpu_abi") {
29          ]
30        }
31      } else if (current_cpu == "arm") {
32 -      if (is_clang && !is_android && !is_nacl &&
33 -          !(is_chromeos_lacros && is_chromeos_device)) {
34 -        cflags += [ "--target=arm-linux-gnueabihf" ]
35 -        ldflags += [ "--target=arm-linux-gnueabihf" ]
36 -      }
37        if (!is_nacl) {
38          cflags += [
39            "-march=$arm_arch",
40 @@ -939,11 +934,6 @@ config("compiler_cpu_abi") {
41          cflags += [ "-mtune=$arm_tune" ]
42        }
43      } else if (current_cpu == "arm64") {
44 -      if (is_clang && !is_android && !is_nacl && !is_fuchsia &&
45 -          !(is_chromeos_lacros && is_chromeos_device)) {
46 -        cflags += [ "--target=aarch64-linux-gnu" ]
47 -        ldflags += [ "--target=aarch64-linux-gnu" ]
48 -      }
49        if (is_android) {
50          # Outline atomics crash on Exynos 9810. http://crbug.com/1272795
51          cflags += [ "-mno-outline-atomics" ]
52 @@ -955,9 +945,6 @@ config("compiler_cpu_abi") {
53            if (is_android) {
54              cflags += [ "--target=mipsel-linux-android" ]
55              ldflags += [ "--target=mipsel-linux-android" ]
56 -          } else {
57 -            cflags += [ "--target=mipsel-linux-gnu" ]
58 -            ldflags += [ "--target=mipsel-linux-gnu" ]
59            }
60          } else {
61            cflags += [ "-EL" ]
62 @@ -1037,8 +1024,6 @@ config("compiler_cpu_abi") {
63        ldflags += [ "-Wl,--hash-style=sysv" ]
64        if (custom_toolchain == "") {
65          if (is_clang) {
66 -          cflags += [ "--target=mips-linux-gnu" ]
67 -          ldflags += [ "--target=mips-linux-gnu" ]
68          } else {
69            cflags += [ "-EB" ]
70            ldflags += [ "-EB" ]
71 @@ -1086,9 +1071,6 @@ config("compiler_cpu_abi") {
72            if (is_android) {
73              cflags += [ "--target=mips64el-linux-android" ]
74              ldflags += [ "--target=mips64el-linux-android" ]
75 -          } else {
76 -            cflags += [ "--target=mips64el-linux-gnuabi64" ]
77 -            ldflags += [ "--target=mips64el-linux-gnuabi64" ]
78            }
79          } else {
80            cflags += [
81 @@ -1146,8 +1128,6 @@ config("compiler_cpu_abi") {
82        ldflags += [ "-Wl,--hash-style=sysv" ]
83        if (custom_toolchain == "") {
84          if (is_clang) {
85 -          cflags += [ "--target=mips64-linux-gnuabi64" ]
86 -          ldflags += [ "--target=mips64-linux-gnuabi64" ]
87          } else {
88            cflags += [
89              "-EB",
90 @@ -1309,23 +1289,6 @@ config("compiler_deterministic") {
91        }
92      }
93    }
94 -
95 -  # Tells the compiler not to use absolute paths when passing the default
96 -  # paths to the tools it invokes. We don't want this because we don't
97 -  # really need it and it can mess up the goma cache entries.
98 -  if (is_clang && (!is_nacl || is_nacl_saigo)) {
99 -    cflags += [ "-no-canonical-prefixes" ]
100 -
101 -    # Same for links: Let the compiler driver invoke the linker
102 -    # with a relative path and pass relative paths to built-in
103 -    # libraries. Not needed on Windows because we call the linker
104 -    # directly there, not through the compiler driver.
105 -    # We don't link on goma, so this change is just for cleaner
106 -    # internal linker invocations, for people who work on the build.
107 -    if (!is_win) {
108 -      ldflags += [ "-no-canonical-prefixes" ]
109 -    }
110 -  }
111  }
112  
113  config("clang_revision") {
114 -- 
115 2.39.2
116