Skip to contentSkip to conversation

target/hexagon: use cmd_array() instead of get_id()

PATCH In review Brian Cain 4 participants 4 messages Jun 22 Arm/Amlogic Meson SoC support

lore
Share & tools
lore

Brian Cain

author
#0 lore raw

PATCH 1/1 target/hexagon: use cmd_array() instead of get_id()

get_id() returns the compiler's short name not a program. Passing it directly as the command for the idef-parser preprocessing custom_target happened to work for native gcc/clang builds but breaks under cross compilers such as emcc or any ccache-wrapped compiler.

---
 target/hexagon/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/hexagon/meson.build +2 -2
index d169cf71b2f..ff22b4e4706 100644
@@ -270,13 +270,13 @@ if idef_parser_enabled and 'hexagon-linux-user' in target_dirs
         command: [python, files('gen_idef_parser_funcs.py'), semantics_generated, '@OUTPUT@'],
     )
 
-    compiler = meson.get_compiler('c').get_id()
+    compiler = meson.get_compiler('c').cmd_array()
     preprocessed_idef_parser_input_generated = custom_target(
         'idef_parser_input.preprocessed.h.inc',
         output: 'idef_parser_input.preprocessed.h.inc',
         input: idef_parser_input_generated,
         depend_files: [idef_parser_dir / 'macros.h.inc'],
-        command: [compiler, '-x', 'c', '-E', '-I', idef_parser_dir, '-o', '@OUTPUT@', '@INPUT@'],
+        command: compiler + ['-x', 'c', '-E', '-I', idef_parser_dir, '-o', '@OUTPUT@', '@INPUT@'],
     )
 
     flex = generator(
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Brian Cain

get_id() returns the compiler's short name not a program. Passing it directly as the command for the idef-parser preprocessing custom_target happened to work for native gcc/clang builds but breaks under cross compilers such as emcc or any ccache-wrapped compiler.

---
  target/hexagon/meson.build | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Brian Cain
Quoted 10 lines · Brian Cain

get_id() returns the compiler's short name not a program. Passing it directly as the command for the idef-parser preprocessing custom_target happened to work for native gcc/clang builds but breaks under cross compilers such as emcc or any ccache-wrapped compiler.

---
 target/hexagon/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by on v1 1/1
#3 lore raw
In reply to Brian Cain
Quoted 21 lines · Brian Cain

get_id() returns the compiler's short name not a program. Passing it directly as the command for the idef-parser preprocessing custom_target happened to work for native gcc/clang builds but breaks under cross compilers such as emcc or any ccache-wrapped compiler.

---
 target/hexagon/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/hexagon/meson.build +1 -1
index d169cf71b2f..ff22b4e4706 100644
@@ -270,13 +270,13 @@ if idef_parser_enabled and 'hexagon-linux-user' in target_dirs
         command: [python, files('gen_idef_parser_funcs.py'), semantics_generated, '@OUTPUT@'],
     )
 
-    compiler = meson.get_compiler('c').get_id()
+    compiler = meson.get_compiler('c').cmd_array()

target/hexagon/meson.build if idef_parser_enabled and 'hexagon-linux-user' in target_dirs · line 282

Quoted 10 lines
target/hexagon/meson.build +1 -1
     preprocessed_idef_parser_input_generated = custom_target(
         'idef_parser_input.preprocessed.h.inc',
         output: 'idef_parser_input.preprocessed.h.inc',
         input: idef_parser_input_generated,
         depend_files: [idef_parser_dir / 'macros.h.inc'],
-        command: [compiler, '-x', 'c', '-E', '-I', idef_parser_dir, '-o', '@OUTPUT@', '@INPUT@'],
+        command: compiler + ['-x', 'c', '-E', '-I', idef_parser_dir, '-o', '@OUTPUT@', '@INPUT@'],
     )
 
     flex = generator(