[Qemu-devel] [PATCH v1 18/24] tests/tcg/arm: fix hello-arm

Alex Bennée posted 24 patches 7 years, 10 months ago
There is a newer version of this series
[Qemu-devel] [PATCH v1 18/24] tests/tcg/arm: fix hello-arm
Posted by Alex Bennée 7 years, 10 months ago
As hello-arm is a bare bones syscall test it needs specific compiler
flags so it doesn't try and link against glibc.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/arm/Makefile.target | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 tests/tcg/arm/Makefile.target

diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target
new file mode 100644
index 0000000000..b7c146c88e
--- /dev/null
+++ b/tests/tcg/arm/Makefile.target
@@ -0,0 +1,6 @@
+# -*- Mode: makefile -*-
+#
+# ARM specific tweaks
+
+hello-arm: CFLAGS+=-marm -ffreestanding
+hello-arm: LDFLAGS+=-nostdlib
-- 
2.16.2


Re: [Qemu-devel] [PATCH v1 18/24] tests/tcg/arm: fix hello-arm
Posted by Thomas Huth 7 years, 10 months ago
On 10.04.2018 21:39, Alex Bennée wrote:
> As hello-arm is a bare bones syscall test it needs specific compiler
> flags so it doesn't try and link against glibc.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/tcg/arm/Makefile.target | 6 ++++++
>  1 file changed, 6 insertions(+)
>  create mode 100644 tests/tcg/arm/Makefile.target

Reviewed-by: Thomas Huth <thuth@redhat.com>

Re: [Qemu-devel] [PATCH v1 18/24] tests/tcg/arm: fix hello-arm
Posted by Philippe Mathieu-Daudé 7 years, 10 months ago
Hi Alex,

On 04/10/2018 04:39 PM, Alex Bennée wrote:
> As hello-arm is a bare bones syscall test it needs specific compiler
> flags so it doesn't try and link against glibc.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/tcg/arm/Makefile.target | 6 ++++++
>  1 file changed, 6 insertions(+)
>  create mode 100644 tests/tcg/arm/Makefile.target
> 
> diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target
> new file mode 100644
> index 0000000000..b7c146c88e
> --- /dev/null
> +++ b/tests/tcg/arm/Makefile.target
> @@ -0,0 +1,6 @@
> +# -*- Mode: makefile -*-
> +#
> +# ARM specific tweaks

                    ... (Thumb mode explicitly disabled)

> +
> +hello-arm: CFLAGS+=-marm -ffreestanding
> +hello-arm: LDFLAGS+=-nostdlib

What about enforcing ARM mode for the swi call by the _syscallX()
functions with:

-- >8 --
 #define _syscall0(type,name) \
+__attribute__((target("arm"))) \
 type name(void) { \
   long __res; \
   __asm__ __volatile__ (\
--
(and so for _syscall[1..5])

So main() Thumb mode can also be tested.

tested with the following tests/tcg/arm/Makefile.include:

-- >8 --
DOCKER_IMAGE=debian-armel-cross
DOCKER_CROSS_COMPILER=arm-linux-gnueabi-gcc
--

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>