Commit 015a99fa authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'nolibc-20250526-for-6.16-1' of...

Merge tag 'nolibc-20250526-for-6.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc

Pull nolibc updates from Thomas Weißschuh:

 - New supported architectures: m68k, SPARC (32 and 64 bit)

 - Compatibility with kselftest_harness.h

 - A more robust mechanism to include all of nolibc from each header

 - Split existing features into new headers to simplify adoption

 - Compatibility with UBSAN and it is used in the testsuite

 - Many small new features focussing on usage in kselftests

* tag 'nolibc-20250526-for-6.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc: (83 commits)
  selftests: harness: Stop using setjmp()/longjmp()
  selftests: harness: Add "variant" and "self" to test metadata
  selftests: harness: Add teardown callback to test metadata
  selftests: harness: Move teardown conditional into test metadata
  selftests: harness: Don't set setup_completed for fixtureless tests
  selftests: harness: Implement test timeouts through pidfd
  selftests: harness: Remove dependency on libatomic
  selftests: harness: Remove inline qualifier for wrappers
  selftests: harness: Mark functions without prototypes static
  selftests: harness: Ignore unused variant argument warning
  selftests: harness: Use C89 comment style
  selftests: harness: Add kselftest harness selftest
  selftests/nolibc: drop include guards around standard headers
  tools/nolibc: move NULL and offsetof() to sys/stddef.h
  tools/nolibc: move uname() and friends to sys/utsname.h
  tools/nolibc: move makedev() and friends to sys/sysmacros.h
  tools/nolibc: move getrlimit() and friends to sys/resource.h
  tools/nolibc: move reboot() to sys/reboot.h
  tools/nolibc: move prctl() to sys/prctl.h
  tools/nolibc: move mount() to sys/mount.h
  ...
parents 3e443d16 869c7889
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21971,6 +21971,7 @@ F: include/linux/seccomp.h
F:	include/uapi/linux/seccomp.h
F:	kernel/seccomp.c
F:	tools/testing/selftests/kselftest_harness.h
F:	tools/testing/selftests/kselftest_harness/
F:	tools/testing/selftests/seccomp/*
K:	\bsecure_computing
K:	\bTIF_SECCOMP\b
+33 −1
Original line number Diff line number Diff line
@@ -30,18 +30,41 @@ all_files := \
		crt.h \
		ctype.h \
		dirent.h \
		elf.h \
		errno.h \
		fcntl.h \
		getopt.h \
		limits.h \
		math.h \
		nolibc.h \
		poll.h \
		sched.h \
		signal.h \
		stackprotector.h \
		std.h \
		stdarg.h \
		stdbool.h \
		stddef.h \
		stdint.h \
		stdlib.h \
		string.h \
		sys.h \
		sys/auxv.h \
		sys/ioctl.h \
		sys/mman.h \
		sys/mount.h \
		sys/prctl.h \
		sys/random.h \
		sys/reboot.h \
		sys/resource.h \
		sys/stat.h \
		sys/syscall.h \
		sys/sysmacros.h \
		sys/time.h \
		sys/timerfd.h \
		sys/types.h \
		sys/utsname.h \
		sys/wait.h \
		time.h \
		types.h \
		unistd.h \
@@ -72,7 +95,7 @@ help:
headers:
	$(Q)mkdir -p $(OUTPUT)sysroot
	$(Q)mkdir -p $(OUTPUT)sysroot/include
	$(Q)cp $(all_files) $(OUTPUT)sysroot/include/
	$(Q)cp --parents $(all_files) $(OUTPUT)sysroot/include/
	$(Q)if [ "$(ARCH)" = "x86" ]; then      \
		sed -e                          \
		  's,^#ifndef _NOLIBC_ARCH_X86_64_H,#if !defined(_NOLIBC_ARCH_X86_64_H) \&\& defined(__x86_64__),' \
@@ -91,5 +114,14 @@ headers_standalone: headers
	$(Q)$(MAKE) -C $(srctree) headers
	$(Q)$(MAKE) -C $(srctree) headers_install INSTALL_HDR_PATH=$(OUTPUT)sysroot

# GCC uses "s390", clang "systemz"
CLANG_CROSS_FLAGS := $(subst --target=s390-linux,--target=systemz-linux,$(CLANG_CROSS_FLAGS))

headers_check: headers_standalone
	for header in $(filter-out crt.h std.h,$(all_files)); do \
		$(CC) $(CLANG_CROSS_FLAGS) -Wall -Werror -nostdinc -fsyntax-only -x c /dev/null \
			-I$(or $(objtree),$(srctree))/usr/include -include $$header -include $$header || exit 1; \
	done

clean:
	$(call QUIET_CLEAN, nolibc) rm -rf "$(OUTPUT)sysroot"
+0 −1
Original line number Diff line number Diff line
@@ -146,7 +146,6 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoint __no_stack_protector _s
{
	__asm__ volatile (
		"mov x0, sp\n"          /* save stack pointer to x0, as arg1 of _start_c */
		"and sp, x0, -16\n"     /* sp must be 16-byte aligned in the callee      */
		"bl  _start_c\n"        /* transfer to c runtime                         */
	);
	__nolibc_entrypoint_epilogue();
+0 −2
Original line number Diff line number Diff line
@@ -189,8 +189,6 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoint __no_stack_protector _s
{
	__asm__ volatile (
		"mov r0, sp\n"          /* save stack pointer to %r0, as arg1 of _start_c */
		"and ip, r0, #-8\n"     /* sp must be 8-byte aligned in the callee        */
		"mov sp, ip\n"
		"bl  _start_c\n"        /* transfer to c runtime                          */
	);
	__nolibc_entrypoint_epilogue();
+0 −2
Original line number Diff line number Diff line
@@ -167,8 +167,6 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoint __no_stack_protector _s
	__asm__ volatile (
		"xor  %ebp, %ebp\n"       /* zero the stack frame                                */
		"mov  %esp, %eax\n"       /* save stack pointer to %eax, as arg1 of _start_c     */
		"add  $12, %esp\n"        /* avoid over-estimating after the 'and' & 'sub' below */
		"and  $-16, %esp\n"       /* the %esp must be 16-byte aligned on 'call'          */
		"sub  $12, %esp\n"        /* sub 12 to keep it aligned after the push %eax       */
		"push %eax\n"             /* push arg1 on stack to support plain stack modes too */
		"call _start_c\n"         /* transfer to c runtime                               */
Loading