selftests/nolibc: add test support for ppc64le
authorZhangjin Wu <falcon@tinylab.org>
Sat, 5 Aug 2023 18:43:53 +0000 (02:43 +0800)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2023 03:17:07 +0000 (05:17 +0200)
commit8a5040cb3f5ac3b1bea5aaa1150daf43b883f938
tree50b4c4b984b722b76f739c1226abbd1d34fcd54c
parent587e98459102448d77c6d06aaca88aa99d3b8279
selftests/nolibc: add test support for ppc64le

Kernel uses ARCH=powerpc for both 32-bit and 64-bit PowerPC, here adds a
ppc64le variant for little endian 64-bit PowerPC, users can pass
XARCH=ppc64le to test it.

The powernv machine of qemu-system-ppc64le is used for there is just a
working powernv_defconfig.

As the document [1] shows:

  PowerNV (as Non-Virtualized) is the “bare metal” platform using the
  OPAL firmware. It runs Linux on IBM and OpenPOWER systems and it can be
  used as an hypervisor OS, running KVM guests, or simply as a host OS.

Notes,

- since the VSX support may be disabled in kernel side, to avoid
  "illegal instruction" errors due to missing VSX kernel support, let's
  simply let compiler not generate vector/scalar (VSX) instructions via
  the '-mno-vsx' option.

- little endian ppc64 prefers elfv2 to elfv1 if the toolchain (e.g. gcc
  13.1.0) supports it, let's align with kernel, otherwise, our elfv1
  binary will not run on kernel with elfv2 ABI.

[1]: https://qemu.readthedocs.io/en/latest/system/ppc/powernv.html

Suggested-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/lkml/20230722120747.GC17311@1wt.eu/
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
tools/testing/selftests/nolibc/Makefile