mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
tools/nolibc: add libc-test binary
This can be used to easily compare the behavior of nolibc to the system libc. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
2df07fc55d
commit
fc82d7dbca
1
tools/testing/selftests/nolibc/.gitignore
vendored
1
tools/testing/selftests/nolibc/.gitignore
vendored
|
|
@ -1,4 +1,5 @@
|
|||
/initramfs/
|
||||
/libc-test
|
||||
/nolibc-test
|
||||
/run.out
|
||||
/sysroot/
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ help:
|
|||
@echo " help this help"
|
||||
@echo " sysroot create the nolibc sysroot here (uses \$$ARCH)"
|
||||
@echo " nolibc-test build the executable (uses \$$CC and \$$CROSS_COMPILE)"
|
||||
@echo " libc-test build an executable using the compiler's default libc instead"
|
||||
@echo " run-user runs the executable under QEMU (uses \$$ARCH, \$$TEST)"
|
||||
@echo " initramfs prepare the initramfs with nolibc-test"
|
||||
@echo " defconfig create a fresh new default config (uses \$$ARCH)"
|
||||
|
|
@ -128,6 +129,9 @@ nolibc-test: nolibc-test.c sysroot/$(ARCH)/include
|
|||
$(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ \
|
||||
-nostdlib -static -Isysroot/$(ARCH)/include $< -lgcc
|
||||
|
||||
libc-test: nolibc-test.c
|
||||
$(QUIET_CC)$(CC) -o $@ $<
|
||||
|
||||
# qemu user-land test
|
||||
run-user: nolibc-test
|
||||
$(Q)qemu-$(QEMU_ARCH) ./nolibc-test > "$(CURDIR)/run.out" || :
|
||||
|
|
@ -159,6 +163,8 @@ clean:
|
|||
$(Q)rm -rf sysroot
|
||||
$(call QUIET_CLEAN, nolibc-test)
|
||||
$(Q)rm -f nolibc-test
|
||||
$(call QUIET_CLEAN, libc-test)
|
||||
$(Q)rm -f libc-test
|
||||
$(call QUIET_CLEAN, initramfs)
|
||||
$(Q)rm -rf initramfs
|
||||
$(call QUIET_CLEAN, run.out)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user