aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/nodejs/nodejs/0004-v8-don-t-override-ARM-CFLAGS.patch
blob: 97ed972ceeef7c5ef3e60ec0e5eaca2540c730c6 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
From 47ee5cc5501289205d3e8e9f27ea9daf18cebac1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
Date: Sat, 9 Nov 2019 14:45:30 +0000
Subject: [PATCH] v8: don't override ARM CFLAGS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This overrides yocto-provided build flags with its own, e.g we get
    arm-poky-linux-musleabi-g++  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 \
                                 ... \
                                  -march=armv7-a -mfpu=neon -mfloat-abi=hard -marm

Causing the latter to override the former, and compiler warnings:
    cc1plus: warning: switch '-mcpu=cortex-a7' conflicts with '-march=armv7-a' switch

Patch this out, so that yocto-provided flags take precedence.
Note that in reality the same should probably be done for all the other
supported architectures, too.

Note that this also switches to Thumb(2) mode (in my case). No obvious
problems have been noted during compilation or runtime.

Upstream-Status: Inappropriate [oe-specific]
Signed-off-by: André Draszik <git@andred.net>
---
 tools/v8_gypfiles/toolchain.gypi | 52 ++------------------------------
 1 file changed, 2 insertions(+), 50 deletions(-)

diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi
index 264b3e478e..0b41848145 100644
--- a/tools/v8_gypfiles/toolchain.gypi
+++ b/tools/v8_gypfiles/toolchain.gypi
@@ -211,31 +211,7 @@
         'target_conditions': [
           ['_toolset=="host"', {
             'conditions': [
-              ['v8_target_arch==host_arch', {
-                # Host built with an Arm CXX compiler.
-                'conditions': [
-                  [ 'arm_version==7', {
-                    'cflags': ['-march=armv7-a',],
-                  }],
-                  [ 'arm_version==7 or arm_version=="default"', {
-                    'conditions': [
-                      [ 'arm_fpu!="default"', {
-                        'cflags': ['-mfpu=<(arm_fpu)',],
-                      }],
-                    ],
-                  }],
-                  [ 'arm_float_abi!="default"', {
-                    'cflags': ['-mfloat-abi=<(arm_float_abi)',],
-                  }],
-                  [ 'arm_thumb==1', {
-                    'cflags': ['-mthumb',],
-                  }],
-                  [ 'arm_thumb==0', {
-                    'cflags': ['-marm',],
-                  }],
-                ],
-              }, {
-                # 'v8_target_arch!=host_arch'
+              ['v8_target_arch!=host_arch', {
                 # Host not built with an Arm CXX compiler (simulator build).
                 'conditions': [
                   [ 'arm_float_abi=="hard"', {
@@ -254,31 +230,7 @@
           }],  # _toolset=="host"
           ['_toolset=="target"', {
             'conditions': [
-              ['v8_target_arch==target_arch', {
-                # Target built with an Arm CXX compiler.
-                'conditions': [
-                  [ 'arm_version==7', {
-                    'cflags': ['-march=armv7-a',],
-                  }],
-                  [ 'arm_version==7 or arm_version=="default"', {
-                    'conditions': [
-                      [ 'arm_fpu!="default"', {
-                        'cflags': ['-mfpu=<(arm_fpu)',],
-                      }],
-                    ],
-                  }],
-                  [ 'arm_float_abi!="default"', {
-                    'cflags': ['-mfloat-abi=<(arm_float_abi)',],
-                  }],
-                  [ 'arm_thumb==1', {
-                    'cflags': ['-mthumb',],
-                  }],
-                  [ 'arm_thumb==0', {
-                    'cflags': ['-marm',],
-                  }],
-                ],
-              }, {
-                # 'v8_target_arch!=target_arch'
+              ['v8_target_arch!=target_arch', {
                 # Target not built with an Arm CXX compiler (simulator build).
                 'conditions': [
                   [ 'arm_float_abi=="hard"', {
-- 
2.20.1