[cef][wam] Make the recipe work with official chromium release tarballs
[AGL/meta-agl-demo.git] / recipes-wam / cef / files / chromium / 0030-M118-fix-Only-default-arm_use_neon-to-true-if-its-va.patch
1 From 55fe851951b11c30e010b5f3df618addf606e3d4 Mon Sep 17 00:00:00 2001
2 From: Roger Zanoni <rzanoni@igalia.com>
3 Date: Wed, 8 Nov 2023 14:35:21 -0300
4 Subject: [PATCH 30/33] [M118-fix] Only default arm_use_neon to true if its
5  value wasn't already set
6
7 arm_use_neon was always being set causing the build to fail.
8
9 Upstream-Status: Needs checking
10 Signed-off-by: Roger Zanoni <rzanoni@igalia.com>
11 ---
12  build/config/arm.gni | 58 +++++++++++++++++++++-----------------------
13  1 file changed, 27 insertions(+), 31 deletions(-)
14
15 diff --git a/build/config/arm.gni b/build/config/arm.gni
16 index 5b404c1ca94f0..575871c287c80 100644
17 --- a/build/config/arm.gni
18 +++ b/build/config/arm.gni
19 @@ -9,36 +9,39 @@ import("//build/config/v8_target_cpu.gni")
20  # ARM code is being compiled.  But they can also be relevant in the
21  # other contexts when the code will change its behavior based on the
22  # cpu it wants to generate code for.
23 -if (current_cpu == "arm" || v8_current_cpu == "arm") {
24 -  declare_args() {
25 -    # Version of the ARM processor when compiling on ARM. Ignored on non-ARM
26 -    # platforms.
27 -    arm_version = 7
28 +declare_args() {
29 +  # Version of the ARM processor when compiling on ARM. Ignored on non-ARM
30 +  # platforms.
31 +  arm_version = 7
32  
33 -    # The ARM architecture. This will be a string like "armv6" or "armv7-a".
34 -    # An empty string means to use the default for the arm_version.
35 -    arm_arch = ""
36 +  # The ARM architecture. This will be a string like "armv6" or "armv7-a".
37 +  # An empty string means to use the default for the arm_version.
38 +  arm_arch = ""
39  
40 -    # The ARM floating point hardware. This will be a string like "neon" or
41 -    # "vfpv3". An empty string means to use the default for the arm_version.
42 -    arm_fpu = ""
43 +  # The ARM floating point hardware. This will be a string like "neon" or
44 +  # "vfpv3". An empty string means to use the default for the arm_version.
45 +  arm_fpu = ""
46  
47 -    # The ARM variant-specific tuning mode. This will be a string like "armv6"
48 -    # or "cortex-a15". An empty string means to use the default for the
49 -    # arm_version.
50 -    arm_tune = ""
51 +  # The ARM variant-specific tuning mode. This will be a string like "armv6"
52 +  # or "cortex-a15". An empty string means to use the default for the
53 +  # arm_version.
54 +  arm_tune = ""
55  
56 -    # Whether to use the neon FPU instruction set or not.
57 -    arm_use_neon = ""
58 +  # Whether to use the neon FPU instruction set or not.
59 +  arm_use_neon = ""
60  
61 -    # Whether to enable optional NEON code paths.
62 -    arm_optionally_use_neon = false
63 +  # Whether to enable optional NEON code paths.
64 +  arm_optionally_use_neon = false
65  
66 -    # Thumb is a reduced instruction set available on some ARM processors that
67 -    # has increased code density.
68 -    arm_use_thumb = true
69 -  }
70 +  # Thumb is a reduced instruction set available on some ARM processors that
71 +  # has increased code density.
72 +  arm_use_thumb = true
73  
74 +  arm_control_flow_integrity = "none"
75 +  arm_float_abi = ""
76 +}
77 +
78 +if (current_cpu == "arm" || v8_current_cpu == "arm") {
79    # For lacros build, we use ARM v8 by default.
80    if (is_chromeos_lacros && arm_arch == "") {
81      # TODO(crbug.com/1467681) Enable i8mm and dotprod instructions for ffmpeg
82 @@ -49,13 +52,6 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") {
83  
84    if (current_os == "android" || target_os == "android") {
85      arm_float_abi = "softfp"
86 -  } else {
87 -    declare_args() {
88 -      # The ARM floating point mode. This is either the string "hard", "soft",
89 -      # or "softfp". An empty string means to use the default one for the
90 -      # arm_version.
91 -      arm_float_abi = ""
92 -    }
93    }
94    assert(arm_float_abi == "" || arm_float_abi == "hard" ||
95           arm_float_abi == "soft" || arm_float_abi == "softfp")
96 @@ -126,7 +122,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") {
97        }
98      }
99    }
100 -} else if (current_cpu == "arm64" || v8_current_cpu == "arm64") {
101 +} else if (arm_use_neon == "" && (current_cpu == "arm64" || v8_current_cpu == "arm64")) {
102    # arm64 supports only "hard".
103    arm_float_abi = "hard"
104    arm_use_neon = true
105 -- 
106 2.42.1
107