0004-v8-don-t-override-ARM-CFLAGS.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. From 47ee5cc5501289205d3e8e9f27ea9daf18cebac1 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
  3. Date: Sat, 9 Nov 2019 14:45:30 +0000
  4. Subject: [PATCH] v8: don't override ARM CFLAGS
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This overrides yocto-provided build flags with its own, e.g we get
  9. arm-poky-linux-musleabi-g++ -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 \
  10. ... \
  11. -march=armv7-a -mfpu=neon -mfloat-abi=hard -marm
  12. Causing the latter to override the former, and compiler warnings:
  13. cc1plus: warning: switch '-mcpu=cortex-a7' conflicts with '-march=armv7-a' switch
  14. Patch this out, so that yocto-provided flags take precedence.
  15. Note that in reality the same should probably be done for all the other
  16. supported architectures, too.
  17. Note that this also switches to Thumb(2) mode (in my case). No obvious
  18. problems have been noted during compilation or runtime.
  19. Upstream-Status: Inappropriate [oe-specific]
  20. Signed-off-by: André Draszik <git@andred.net>
  21. ---
  22. tools/v8_gypfiles/toolchain.gypi | 52 ++------------------------------
  23. 1 file changed, 2 insertions(+), 50 deletions(-)
  24. diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi
  25. index 264b3e478e..0b41848145 100644
  26. --- a/tools/v8_gypfiles/toolchain.gypi
  27. +++ b/tools/v8_gypfiles/toolchain.gypi
  28. @@ -211,31 +211,7 @@
  29. 'target_conditions': [
  30. ['_toolset=="host"', {
  31. 'conditions': [
  32. - ['v8_target_arch==host_arch', {
  33. - # Host built with an Arm CXX compiler.
  34. - 'conditions': [
  35. - [ 'arm_version==7', {
  36. - 'cflags': ['-march=armv7-a',],
  37. - }],
  38. - [ 'arm_version==7 or arm_version=="default"', {
  39. - 'conditions': [
  40. - [ 'arm_fpu!="default"', {
  41. - 'cflags': ['-mfpu=<(arm_fpu)',],
  42. - }],
  43. - ],
  44. - }],
  45. - [ 'arm_float_abi!="default"', {
  46. - 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
  47. - }],
  48. - [ 'arm_thumb==1', {
  49. - 'cflags': ['-mthumb',],
  50. - }],
  51. - [ 'arm_thumb==0', {
  52. - 'cflags': ['-marm',],
  53. - }],
  54. - ],
  55. - }, {
  56. - # 'v8_target_arch!=host_arch'
  57. + ['v8_target_arch!=host_arch', {
  58. # Host not built with an Arm CXX compiler (simulator build).
  59. 'conditions': [
  60. [ 'arm_float_abi=="hard"', {
  61. @@ -254,31 +230,7 @@
  62. }], # _toolset=="host"
  63. ['_toolset=="target"', {
  64. 'conditions': [
  65. - ['v8_target_arch==target_arch', {
  66. - # Target built with an Arm CXX compiler.
  67. - 'conditions': [
  68. - [ 'arm_version==7', {
  69. - 'cflags': ['-march=armv7-a',],
  70. - }],
  71. - [ 'arm_version==7 or arm_version=="default"', {
  72. - 'conditions': [
  73. - [ 'arm_fpu!="default"', {
  74. - 'cflags': ['-mfpu=<(arm_fpu)',],
  75. - }],
  76. - ],
  77. - }],
  78. - [ 'arm_float_abi!="default"', {
  79. - 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
  80. - }],
  81. - [ 'arm_thumb==1', {
  82. - 'cflags': ['-mthumb',],
  83. - }],
  84. - [ 'arm_thumb==0', {
  85. - 'cflags': ['-marm',],
  86. - }],
  87. - ],
  88. - }, {
  89. - # 'v8_target_arch!=target_arch'
  90. + ['v8_target_arch!=target_arch', {
  91. # Target not built with an Arm CXX compiler (simulator build).
  92. 'conditions': [
  93. [ 'arm_float_abi=="hard"', {
  94. --
  95. 2.20.1