[PATCH] Hexagon (tests/tcg/hexagon) add compiler options to EXTRA_CFLAGS

Taylor Simpson posted 1 patch 1 year, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220726191757.30104-1-tsimpson@quicinc.com
Maintainers: Taylor Simpson <tsimpson@quicinc.com>
tests/tcg/hexagon/Makefile.target | 1 +
1 file changed, 1 insertion(+)
[PATCH] Hexagon (tests/tcg/hexagon) add compiler options to EXTRA_CFLAGS
Posted by Taylor Simpson 1 year, 9 months ago
The cross_cc_cflags_hexagon in configure are not getting passed to
the Hexagon cross compiler.  Set EXTRA_CFLAGS in
tests/tcg/hexagon/Makefile.target.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
---
 tests/tcg/hexagon/Makefile.target | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/tcg/hexagon/Makefile.target b/tests/tcg/hexagon/Makefile.target
index 23b9870534..627bf58fe6 100644
--- a/tests/tcg/hexagon/Makefile.target
+++ b/tests/tcg/hexagon/Makefile.target
@@ -20,6 +20,7 @@ EXTRA_RUNS =
 
 CFLAGS += -Wno-incompatible-pointer-types -Wno-undefined-internal
 CFLAGS += -fno-unroll-loops
+EXTRA_CFLAGS += -mv67 -O2
 
 HEX_SRC=$(SRC_PATH)/tests/tcg/hexagon
 VPATH += $(HEX_SRC)
-- 
2.17.1

Re: [PATCH] Hexagon (tests/tcg/hexagon) add compiler options to EXTRA_CFLAGS
Posted by Paolo Bonzini 1 year, 9 months ago
On 7/26/22 21:17, Taylor Simpson wrote:
> The cross_cc_cflags_hexagon in configure are not getting passed to
> the Hexagon cross compiler.  Set EXTRA_CFLAGS in
> tests/tcg/hexagon/Makefile.target.
> 
> Suggested-by: Richard Henderson<richard.henderson@linaro.org>
> Signed-off-by: Taylor Simpson<tsimpson@quicinc.com>
> ---

The bug applies to all targets, I am going to post a patch to fix it.

Paolo
Re: [PATCH] Hexagon (tests/tcg/hexagon) add compiler options to EXTRA_CFLAGS
Posted by Richard Henderson 1 year, 9 months ago
On 7/26/22 12:17, Taylor Simpson wrote:
> The cross_cc_cflags_hexagon in configure are not getting passed to
> the Hexagon cross compiler.  Set EXTRA_CFLAGS in
> tests/tcg/hexagon/Makefile.target.
> 
> Suggested-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
> ---
>   tests/tcg/hexagon/Makefile.target | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

> 
> diff --git a/tests/tcg/hexagon/Makefile.target b/tests/tcg/hexagon/Makefile.target
> index 23b9870534..627bf58fe6 100644
> --- a/tests/tcg/hexagon/Makefile.target
> +++ b/tests/tcg/hexagon/Makefile.target
> @@ -20,6 +20,7 @@ EXTRA_RUNS =
>   
>   CFLAGS += -Wno-incompatible-pointer-types -Wno-undefined-internal
>   CFLAGS += -fno-unroll-loops
> +EXTRA_CFLAGS += -mv67 -O2
>   
>   HEX_SRC=$(SRC_PATH)/tests/tcg/hexagon
>   VPATH += $(HEX_SRC)
Re: [PATCH] Hexagon (tests/tcg/hexagon) add compiler options to EXTRA_CFLAGS
Posted by Philippe Mathieu-Daudé via 1 year, 9 months ago
Hi Taylor,

On 26/7/22 21:17, Taylor Simpson wrote:
> The cross_cc_cflags_hexagon in configure are not getting passed to
> the Hexagon cross compiler.  Set EXTRA_CFLAGS in
> tests/tcg/hexagon/Makefile.target.
> 
> Suggested-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
> ---
>   tests/tcg/hexagon/Makefile.target | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tests/tcg/hexagon/Makefile.target b/tests/tcg/hexagon/Makefile.target
> index 23b9870534..627bf58fe6 100644
> --- a/tests/tcg/hexagon/Makefile.target
> +++ b/tests/tcg/hexagon/Makefile.target
> @@ -20,6 +20,7 @@ EXTRA_RUNS =
>   
>   CFLAGS += -Wno-incompatible-pointer-types -Wno-undefined-internal
>   CFLAGS += -fno-unroll-loops
> +EXTRA_CFLAGS += -mv67 -O2
>   
>   HEX_SRC=$(SRC_PATH)/tests/tcg/hexagon
>   VPATH += $(HEX_SRC)

My understanding of Richard suggestion is something like:

-- >8 --
@@ -45,6 +45,8 @@ HEX_TESTS += overflow

  TESTS += $(HEX_TESTS)

+$(filter-out usr, $(HEX_TESTS)): CFLAGS += -mv67 -O2
+
  # This test has to be compiled for the -mv67t target
  usr: usr.c
         $(CC) $(CFLAGS) -mv67t -O2 -Wno-inline-asm 
-Wno-expansion-to-defined $< -o $@ $(LDFLAGS)
---

Eventually to keep the same style in the file:
-- >8 --
@@ -46,6 +46,5 @@ HEX_TESTS += overflow
  TESTS += $(HEX_TESTS)

  # This test has to be compiled for the -mv67t target
-usr: usr.c
-       $(CC) $(CFLAGS) -mv67t -O2 -Wno-inline-asm 
-Wno-expansion-to-defined $< -o $@ $(LDFLAGS)
+usr: CFLAGS += -mv67t -O2 -Wno-inline-asm -Wno-expansion-to-defined
---

Regards,

Phil.