[v1,19/24] tests/tcg: move MIPS specific tests into subdir

Message ID 20180410193919.28026-20-alex.bennee@linaro.org
State Superseded
Headers show
Series
  • fix building of tests/tcg
Related show

Commit Message

Alex Bennée April 10, 2018, 7:39 p.m.
These only need to be built for MIPS guests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 tests/tcg/README                  | 11 -----------
 tests/tcg/mips/README             |  7 +++++++
 tests/tcg/{ => mips}/hello-mips.c |  0
 3 files changed, 7 insertions(+), 11 deletions(-)
 create mode 100644 tests/tcg/mips/README
 rename tests/tcg/{ => mips}/hello-mips.c (100%)

-- 
2.16.2

Comments

Philippe Mathieu-Daudé April 16, 2018, 1:02 a.m. | #1
On 04/10/2018 04:39 PM, Alex Bennée wrote:
> These only need to be built for MIPS guests.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>  tests/tcg/README                  | 11 -----------

>  tests/tcg/mips/README             |  7 +++++++

>  tests/tcg/{ => mips}/hello-mips.c |  0

>  3 files changed, 7 insertions(+), 11 deletions(-)

>  create mode 100644 tests/tcg/mips/README

>  rename tests/tcg/{ => mips}/hello-mips.c (100%)

> 

> diff --git a/tests/tcg/README b/tests/tcg/README

> index 625f2326e6..a5643d33e7 100644

> --- a/tests/tcg/README

> +++ b/tests/tcg/README

> @@ -3,17 +3,6 @@ regression testing. Tests are either multi-arch, meaning they can be

>  built for all guest architectures that support linux-user executable,

>  or they are architecture specific.

>  

> -

> -

> -MIPS

> -====

> -

> -hello-mips

> -----------

> -

> -hello-mipsel

> -------------

> -

>  CRIS

>  ====

>  The testsuite for CRIS is in tests/tcg/cris.  You can run it

> diff --git a/tests/tcg/mips/README b/tests/tcg/mips/README

> new file mode 100644

> index 0000000000..e5bbc58ec5

> --- /dev/null

> +++ b/tests/tcg/mips/README

> @@ -0,0 +1,7 @@

> +MIPS

> +====

> +

> +hello-mips

> +----------

> +

> +A very simple inline assembly, write syscall based hello world

> diff --git a/tests/tcg/hello-mips.c b/tests/tcg/mips/hello-mips.c

> similarity index 100%

> rename from tests/tcg/hello-mips.c

> rename to tests/tcg/mips/hello-mips.c


tested with:

-- >8 --
diff --git a/configure b/configure
index c98eb01c39..aebe928b3c 100755
--- a/configure
+++ b/configure
@@ -455,6 +455,7 @@ docker="no"
 # cross compilers defaults, can be overridden with --cross-cc-ARCH
 cross_cc_aarch64="aarch64-linux-gnu-gcc"
 cross_cc_arm="arm-linux-gnueabihf-gcc"
+cross_cc_mips="mipsel-linux-gnu-gcc"
 cross_cc_powerpc="powerpc-linux-gnu-gcc"
 cross_cc_i386="i386-pc-linux-gnu-gcc"
 cross_cc_i386_cflags=""
@@ -6860,6 +6861,7 @@ case "$target_name" in
   mips|mipsel)
     TARGET_ARCH=mips
     echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
+    target_compiler=$cross_cc_mips
   ;;
   mipsn32|mipsn32el)
     TARGET_ARCH=mips64
diff --git a/tests/tcg/mips/Makefile.target b/tests/tcg/mips/Makefile.target
new file mode 100644
index 0000000000..427aafc9e5
--- /dev/null
+++ b/tests/tcg/mips/Makefile.target
@@ -0,0 +1,6 @@
+# -*- Mode: makefile -*-
+#
+# MIPS specific tweaks
+
+hello-mips: CFLAGS+=-ffreestanding
+hello-mips: LDFLAGS+=-nostdlib
-- 

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

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Philippe Mathieu-Daudé April 16, 2018, 1:33 a.m. | #2
On 04/15/2018 10:02 PM, Philippe Mathieu-Daudé wrote:
> On 04/10/2018 04:39 PM, Alex Bennée wrote:

>> These only need to be built for MIPS guests.

>>

>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>> ---

>>  tests/tcg/README                  | 11 -----------

>>  tests/tcg/mips/README             |  7 +++++++

>>  tests/tcg/{ => mips}/hello-mips.c |  0

>>  3 files changed, 7 insertions(+), 11 deletions(-)

>>  create mode 100644 tests/tcg/mips/README

>>  rename tests/tcg/{ => mips}/hello-mips.c (100%)

>>

>> diff --git a/tests/tcg/README b/tests/tcg/README

>> index 625f2326e6..a5643d33e7 100644

>> --- a/tests/tcg/README

>> +++ b/tests/tcg/README

>> @@ -3,17 +3,6 @@ regression testing. Tests are either multi-arch, meaning they can be

>>  built for all guest architectures that support linux-user executable,

>>  or they are architecture specific.

>>  

>> -

>> -

>> -MIPS

>> -====

>> -

>> -hello-mips

>> -----------

>> -

>> -hello-mipsel

>> -------------

>> -

>>  CRIS

>>  ====

>>  The testsuite for CRIS is in tests/tcg/cris.  You can run it

>> diff --git a/tests/tcg/mips/README b/tests/tcg/mips/README

>> new file mode 100644

>> index 0000000000..e5bbc58ec5

>> --- /dev/null

>> +++ b/tests/tcg/mips/README

>> @@ -0,0 +1,7 @@

>> +MIPS

>> +====

>> +

>> +hello-mips

>> +----------

>> +

>> +A very simple inline assembly, write syscall based hello world

>> diff --git a/tests/tcg/hello-mips.c b/tests/tcg/mips/hello-mips.c

>> similarity index 100%

>> rename from tests/tcg/hello-mips.c

>> rename to tests/tcg/mips/hello-mips.c

> 

> tested with:

> 

> -- >8 --

> diff --git a/configure b/configure

> index c98eb01c39..aebe928b3c 100755

> --- a/configure

> +++ b/configure

> @@ -455,6 +455,7 @@ docker="no"

>  # cross compilers defaults, can be overridden with --cross-cc-ARCH

>  cross_cc_aarch64="aarch64-linux-gnu-gcc"

>  cross_cc_arm="arm-linux-gnueabihf-gcc"

> +cross_cc_mips="mipsel-linux-gnu-gcc"

>  cross_cc_powerpc="powerpc-linux-gnu-gcc"

>  cross_cc_i386="i386-pc-linux-gnu-gcc"

>  cross_cc_i386_cflags=""

> @@ -6860,6 +6861,7 @@ case "$target_name" in

>    mips|mipsel)

>      TARGET_ARCH=mips

>      echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak

> +    target_compiler=$cross_cc_mips

>    ;;

>    mipsn32|mipsn32el)

>      TARGET_ARCH=mips64

> diff --git a/tests/tcg/mips/Makefile.target b/tests/tcg/mips/Makefile.target

> new file mode 100644

> index 0000000000..427aafc9e5

> --- /dev/null

> +++ b/tests/tcg/mips/Makefile.target

> @@ -0,0 +1,6 @@

> +# -*- Mode: makefile -*-

> +#

> +# MIPS specific tweaks

> +

> +hello-mips: CFLAGS+=-ffreestanding

> +hello-mips: LDFLAGS+=-nostdlib

> 


oh and tests/tcg/mips/Makefile.include:

-- >8 --
DOCKER_IMAGE=debian-mipsel-cross
DOCKER_CROSS_COMPILER=mipsel-linux-gnu-gcc
--

running "make tcg-tests-mips-linux-user" it works, but "make
tcg-tests-mipsel-linux-user" only build the multiarch tests.

Maybe we need some [mipsel, mips64, mips64el] => "mips" rule somewhere.

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

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Alex Bennée April 16, 2018, 8:56 a.m. | #3
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> On 04/10/2018 04:39 PM, Alex Bennée wrote:

>> These only need to be built for MIPS guests.

>> 

>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>> ---

>>  tests/tcg/README                  | 11 -----------

>>  tests/tcg/mips/README             |  7 +++++++

>>  tests/tcg/{ => mips}/hello-mips.c |  0

>>  3 files changed, 7 insertions(+), 11 deletions(-)

>>  create mode 100644 tests/tcg/mips/README

>>  rename tests/tcg/{ => mips}/hello-mips.c (100%)

>> 

>> diff --git a/tests/tcg/README b/tests/tcg/README

>> index 625f2326e6..a5643d33e7 100644

>> --- a/tests/tcg/README

>> +++ b/tests/tcg/README

>> @@ -3,17 +3,6 @@ regression testing. Tests are either multi-arch, meaning they can be

>>  built for all guest architectures that support linux-user executable,

>>  or they are architecture specific.

>>  

>> -

>> -

>> -MIPS

>> -====

>> -

>> -hello-mips

>> -----------

>> -

>> -hello-mipsel

>> -------------

>> -

>>  CRIS

>>  ====

>>  The testsuite for CRIS is in tests/tcg/cris.  You can run it

>> diff --git a/tests/tcg/mips/README b/tests/tcg/mips/README

>> new file mode 100644

>> index 0000000000..e5bbc58ec5

>> --- /dev/null

>> +++ b/tests/tcg/mips/README

>> @@ -0,0 +1,7 @@

>> +MIPS

>> +====

>> +

>> +hello-mips

>> +----------

>> +

>> +A very simple inline assembly, write syscall based hello world

>> diff --git a/tests/tcg/hello-mips.c b/tests/tcg/mips/hello-mips.c

>> similarity index 100%

>> rename from tests/tcg/hello-mips.c

>> rename to tests/tcg/mips/hello-mips.c

>

> tested with:

>

> -- >8 --

> diff --git a/configure b/configure

> index c98eb01c39..aebe928b3c 100755

> --- a/configure

> +++ b/configure

> @@ -455,6 +455,7 @@ docker="no"

>  # cross compilers defaults, can be overridden with --cross-cc-ARCH

>  cross_cc_aarch64="aarch64-linux-gnu-gcc"

>  cross_cc_arm="arm-linux-gnueabihf-gcc"

> +cross_cc_mips="mipsel-linux-gnu-gcc"

>  cross_cc_powerpc="powerpc-linux-gnu-gcc"

>  cross_cc_i386="i386-pc-linux-gnu-gcc"

>  cross_cc_i386_cflags=""

> @@ -6860,6 +6861,7 @@ case "$target_name" in

>    mips|mipsel)

>      TARGET_ARCH=mips

>      echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak

> +    target_compiler=$cross_cc_mips

>    ;;

>    mipsn32|mipsn32el)

>      TARGET_ARCH=mips64

> diff --git a/tests/tcg/mips/Makefile.target b/tests/tcg/mips/Makefile.target

> new file mode 100644

> index 0000000000..427aafc9e5

> --- /dev/null

> +++ b/tests/tcg/mips/Makefile.target

> @@ -0,0 +1,6 @@

> +# -*- Mode: makefile -*-

> +#

> +# MIPS specific tweaks

> +

> +hello-mips: CFLAGS+=-ffreestanding

> +hello-mips: LDFLAGS+=-nostdlib


I've jiggled things around a bit for v2 to include:

  # The order we include is important. We include multiarch, base arch and finally arch
  -include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target
  -include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.target
  -include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target
 
So hopefully I don't have to split up the current MIPS dir and the
tcg/MIPS/Makefile.target will deal with all the variations.

-- 
Alex Bennée
Philippe Mathieu-Daudé April 16, 2018, 10:21 a.m. | #4
On 04/16/2018 05:56 AM, Alex Bennée wrote:
> 

> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> 

>> On 04/10/2018 04:39 PM, Alex Bennée wrote:

>>> These only need to be built for MIPS guests.

>>>

>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>>> ---

>>>  tests/tcg/README                  | 11 -----------

>>>  tests/tcg/mips/README             |  7 +++++++

>>>  tests/tcg/{ => mips}/hello-mips.c |  0

>>>  3 files changed, 7 insertions(+), 11 deletions(-)

>>>  create mode 100644 tests/tcg/mips/README

>>>  rename tests/tcg/{ => mips}/hello-mips.c (100%)

>>>

>>> diff --git a/tests/tcg/README b/tests/tcg/README

>>> index 625f2326e6..a5643d33e7 100644

>>> --- a/tests/tcg/README

>>> +++ b/tests/tcg/README

>>> @@ -3,17 +3,6 @@ regression testing. Tests are either multi-arch, meaning they can be

>>>  built for all guest architectures that support linux-user executable,

>>>  or they are architecture specific.

>>>  

>>> -

>>> -

>>> -MIPS

>>> -====

>>> -

>>> -hello-mips

>>> -----------

>>> -

>>> -hello-mipsel

>>> -------------

>>> -

>>>  CRIS

>>>  ====

>>>  The testsuite for CRIS is in tests/tcg/cris.  You can run it

>>> diff --git a/tests/tcg/mips/README b/tests/tcg/mips/README

>>> new file mode 100644

>>> index 0000000000..e5bbc58ec5

>>> --- /dev/null

>>> +++ b/tests/tcg/mips/README

>>> @@ -0,0 +1,7 @@

>>> +MIPS

>>> +====

>>> +

>>> +hello-mips

>>> +----------

>>> +

>>> +A very simple inline assembly, write syscall based hello world

>>> diff --git a/tests/tcg/hello-mips.c b/tests/tcg/mips/hello-mips.c

>>> similarity index 100%

>>> rename from tests/tcg/hello-mips.c

>>> rename to tests/tcg/mips/hello-mips.c

>>

>> tested with:

>>

>> -- >8 --

>> diff --git a/configure b/configure

>> index c98eb01c39..aebe928b3c 100755

>> --- a/configure

>> +++ b/configure

>> @@ -455,6 +455,7 @@ docker="no"

>>  # cross compilers defaults, can be overridden with --cross-cc-ARCH

>>  cross_cc_aarch64="aarch64-linux-gnu-gcc"

>>  cross_cc_arm="arm-linux-gnueabihf-gcc"

>> +cross_cc_mips="mipsel-linux-gnu-gcc"

>>  cross_cc_powerpc="powerpc-linux-gnu-gcc"

>>  cross_cc_i386="i386-pc-linux-gnu-gcc"

>>  cross_cc_i386_cflags=""

>> @@ -6860,6 +6861,7 @@ case "$target_name" in

>>    mips|mipsel)

>>      TARGET_ARCH=mips

>>      echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak

>> +    target_compiler=$cross_cc_mips

>>    ;;

>>    mipsn32|mipsn32el)

>>      TARGET_ARCH=mips64

>> diff --git a/tests/tcg/mips/Makefile.target b/tests/tcg/mips/Makefile.target

>> new file mode 100644

>> index 0000000000..427aafc9e5

>> --- /dev/null

>> +++ b/tests/tcg/mips/Makefile.target

>> @@ -0,0 +1,6 @@

>> +# -*- Mode: makefile -*-

>> +#

>> +# MIPS specific tweaks

>> +

>> +hello-mips: CFLAGS+=-ffreestanding

>> +hello-mips: LDFLAGS+=-nostdlib

> 

> I've jiggled things around a bit for v2 to include:

> 

>   # The order we include is important. We include multiarch, base arch and finally arch

>   -include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target

>   -include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.target

>   -include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target

>  

> So hopefully I don't have to split up the current MIPS dir and the

> tcg/MIPS/Makefile.target will deal with all the variations.


Excellent, thanks :)

Patch

diff --git a/tests/tcg/README b/tests/tcg/README
index 625f2326e6..a5643d33e7 100644
--- a/tests/tcg/README
+++ b/tests/tcg/README
@@ -3,17 +3,6 @@  regression testing. Tests are either multi-arch, meaning they can be
 built for all guest architectures that support linux-user executable,
 or they are architecture specific.
 
-
-
-MIPS
-====
-
-hello-mips
-----------
-
-hello-mipsel
-------------
-
 CRIS
 ====
 The testsuite for CRIS is in tests/tcg/cris.  You can run it
diff --git a/tests/tcg/mips/README b/tests/tcg/mips/README
new file mode 100644
index 0000000000..e5bbc58ec5
--- /dev/null
+++ b/tests/tcg/mips/README
@@ -0,0 +1,7 @@ 
+MIPS
+====
+
+hello-mips
+----------
+
+A very simple inline assembly, write syscall based hello world
diff --git a/tests/tcg/hello-mips.c b/tests/tcg/mips/hello-mips.c
similarity index 100%
rename from tests/tcg/hello-mips.c
rename to tests/tcg/mips/hello-mips.c