* [PATCH 1/5] selftests/prctl: build generated tests for the target architecture
2026-10-14 20:01 [PATCH 0/5] selftests: target selection fixes for cross and LLVM builds Sasha Levin
@ 2026-10-14 20:01 ` Sasha Levin
2026-10-14 20:01 ` [PATCH 2/5] selftests/prctl: skip the anonymous VMA naming test when unsupported Sasha Levin
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Shuah Khan; +Cc: Sasha Levin, linux-kselftest, linux-kernel
The prctl Makefile builds nothing when CROSS_COMPILE is set, even when
the target is x86, and it lists its compiled programs in TEST_PROGS,
which lib.mk treats as source-tree scripts. The binaries are therefore
built into the source directory rather than OUTPUT. The architecture
check also restricts set-anon-vma-name-test and set-process-name to x86
although neither depends on the architecture.
Build the programs as TEST_GEN_PROGS, build the two generic tests on
every architecture, and keep only the TSC tests x86 specific. Select
them from the target ARCH when it is given and from the host's SUBARCH
otherwise, using a private ARCH_PROCESSED instead of overriding ARCH.
The override added by commit 5a1292137e89 ("selftests: fix ARCH
normalization to handle command-line argument") changed the value that
lib.mk uses to choose the clang target: leaving ARCH unset again lets
lib.mk use the compiler's native triple. A command-line ARCH such as
x86_64 is still normalized for the TSC test selection, while an ARCH
spelling that lib.mk does not know, such as i686 with LLVM=1, is
rejected in the same way as for the other selftests.
Fixes: f59514b6a8c5 ("Documentation/prctl: don't build tsc tests when cross compiling")
Fixes: 5290586186d2 ("selftests: prctl: Add new prctl test for PR_SET_VMA action")
Fixes: e0606daeaab4 ("selftests: prctl: Add new prctl test for PR_SET_NAME")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/prctl/Makefile | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/prctl/Makefile b/tools/testing/selftests/prctl/Makefile
index e770e86fad9ac..123f884e9dfa5 100644
--- a/tools/testing/selftests/prctl/Makefile
+++ b/tools/testing/selftests/prctl/Makefile
@@ -1,14 +1,12 @@
# SPDX-License-Identifier: GPL-2.0
-ifndef CROSS_COMPILE
-ARCH ?= $(shell uname -m 2>/dev/null || echo not)
-override ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+top_srcdir = ../../../..
+include $(top_srcdir)/scripts/subarch.include
+ARCH_PROCESSED := $(shell echo $(or $(ARCH),$(SUBARCH)) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
-ifeq ($(ARCH),x86)
-TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \
- disable-tsc-test set-anon-vma-name-test set-process-name
-all: $(TEST_PROGS)
+TEST_GEN_PROGS := set-anon-vma-name-test set-process-name
+ifeq ($(ARCH_PROCESSED),x86)
+TEST_GEN_PROGS += disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \
+ disable-tsc-test
+endif
include ../lib.mk
-
-endif
-endif
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 2/5] selftests/prctl: skip the anonymous VMA naming test when unsupported
2026-10-14 20:01 [PATCH 0/5] selftests: target selection fixes for cross and LLVM builds Sasha Levin
2026-10-14 20:01 ` [PATCH 1/5] selftests/prctl: build generated tests for the target architecture Sasha Levin
@ 2026-10-14 20:01 ` Sasha Levin
2026-10-14 20:01 ` [PATCH 3/5] selftests/thermal: allow cross builds of the Intel tests Sasha Levin
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Shuah Khan; +Cc: Sasha Levin, Ivan Orlov, linux-kselftest, linux-kernel
PR_SET_VMA_ANON_NAME is only implemented when CONFIG_ANON_VMA_NAME is
enabled. Without it, set_anon_vma_name() returns -EINVAL for every
request, so set-anon-vma-name-test reports a failure on kernels that
simply do not provide the feature:
# renaming: Expected rename_vma(...) (-22) >= 0
not ok 1 vma.renaming
Probe the interface in the fixture setup by clearing the name of the
anonymous mapping, which succeeds whenever the feature is available,
and skip the test when the kernel rejects the request with EINVAL.
Fixes: 5290586186d2 ("selftests: prctl: Add new prctl test for PR_SET_VMA action")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/prctl/set-anon-vma-name-test.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/prctl/set-anon-vma-name-test.c b/tools/testing/selftests/prctl/set-anon-vma-name-test.c
index 5f9589534da8e..d3854ccb2a7a3 100644
--- a/tools/testing/selftests/prctl/set-anon-vma-name-test.c
+++ b/tools/testing/selftests/prctl/set-anon-vma-name-test.c
@@ -93,6 +93,9 @@ FIXTURE_SETUP(vma) {
MAP_PRIVATE, self->fd_not_anon, 0);
ASSERT_NE(self->ptr_not_anon, MAP_FAILED);
close(self->fd_not_anon);
+
+ if (rename_vma((unsigned long)self->ptr_anon, AREA_SIZE, NULL) == -EINVAL)
+ SKIP(return, "PR_SET_VMA_ANON_NAME is not supported");
}
FIXTURE_TEARDOWN(vma) {
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 3/5] selftests/thermal: allow cross builds of the Intel tests
2026-10-14 20:01 [PATCH 0/5] selftests: target selection fixes for cross and LLVM builds Sasha Levin
2026-10-14 20:01 ` [PATCH 1/5] selftests/prctl: build generated tests for the target architecture Sasha Levin
2026-10-14 20:01 ` [PATCH 2/5] selftests/prctl: skip the anonymous VMA naming test when unsupported Sasha Levin
@ 2026-10-14 20:01 ` Sasha Levin
2026-10-14 20:01 ` [PATCH 4/5] selftests/kexec: select tests using the target compiler Sasha Levin
2026-10-14 20:01 ` [PATCH 5/5] selftests/size: use nolibc startup and syscall wrappers Sasha Levin
4 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Shuah Khan
Cc: Sasha Levin, Rafael J. Wysocki, Srinivas Pandruvada,
Daniel Lezcano, linux-pm, linux-kselftest, linux-kernel
The power_floor and workload_hint Makefiles build nothing when
CROSS_COMPILE is set, even for an x86 target, and they include lib.mk
only on x86. Other architectures therefore have no install or
emit_tests rules for these suites, and their installation fails with a
missing target.
Select the x86 tests from the target ARCH when it is given and from the
host's SUBARCH otherwise, and include lib.mk unconditionally so that the
suites install and emit an empty runlist on other architectures. Use a
private ARCH_PROCESSED instead of the ARCH override added by
commit 5a1292137e89 ("selftests: fix ARCH normalization to handle
command-line argument"): the override changed the value lib.mk uses to
pick the clang target, whereas leaving ARCH unset lets lib.mk use the
compiler's native triple. A command-line ARCH such as x86_64 is still
normalized for the selection, while an ARCH spelling that lib.mk does
not know, such as i686 with LLVM=1, is rejected as in other selftests.
Fixes: 27801542b2b8 ("selftests/thermel/intel: Add test to read workload hint")
Fixes: d4d27e5a1a88 ("selftests/thermel/intel: Add test to read power floor status")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../selftests/thermal/intel/power_floor/Makefile | 12 +++++-------
.../selftests/thermal/intel/workload_hint/Makefile | 12 +++++-------
2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/tools/testing/selftests/thermal/intel/power_floor/Makefile b/tools/testing/selftests/thermal/intel/power_floor/Makefile
index 07463c2160e09..16d26eab55652 100644
--- a/tools/testing/selftests/thermal/intel/power_floor/Makefile
+++ b/tools/testing/selftests/thermal/intel/power_floor/Makefile
@@ -1,12 +1,10 @@
# SPDX-License-Identifier: GPL-2.0
-ifndef CROSS_COMPILE
-ARCH ?= $(shell uname -m 2>/dev/null || echo not)
-override ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+top_srcdir = ../../../../../..
+include $(top_srcdir)/scripts/subarch.include
+ARCH_PROCESSED := $(shell echo $(or $(ARCH),$(SUBARCH)) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
-ifeq ($(ARCH),x86)
+ifeq ($(ARCH_PROCESSED),x86)
TEST_GEN_PROGS := power_floor_test
+endif
include ../../../lib.mk
-
-endif
-endif
diff --git a/tools/testing/selftests/thermal/intel/workload_hint/Makefile b/tools/testing/selftests/thermal/intel/workload_hint/Makefile
index 49e3bc2b20f9d..e53d6ecd9f8de 100644
--- a/tools/testing/selftests/thermal/intel/workload_hint/Makefile
+++ b/tools/testing/selftests/thermal/intel/workload_hint/Makefile
@@ -1,12 +1,10 @@
# SPDX-License-Identifier: GPL-2.0
-ifndef CROSS_COMPILE
-ARCH ?= $(shell uname -m 2>/dev/null || echo not)
-override ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+top_srcdir = ../../../../../..
+include $(top_srcdir)/scripts/subarch.include
+ARCH_PROCESSED := $(shell echo $(or $(ARCH),$(SUBARCH)) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
-ifeq ($(ARCH),x86)
+ifeq ($(ARCH_PROCESSED),x86)
TEST_GEN_PROGS := workload_hint_test
+endif
include ../../../lib.mk
-
-endif
-endif
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 4/5] selftests/kexec: select tests using the target compiler
2026-10-14 20:01 [PATCH 0/5] selftests: target selection fixes for cross and LLVM builds Sasha Levin
` (2 preceding siblings ...)
2026-10-14 20:01 ` [PATCH 3/5] selftests/thermal: allow cross builds of the Intel tests Sasha Levin
@ 2026-10-14 20:01 ` Sasha Levin
2026-10-14 20:01 ` [PATCH 5/5] selftests/size: use nolibc startup and syscall wrappers Sasha Levin
4 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Shuah Khan
Cc: Sasha Levin, David Woodhouse, Nageswara R Sastry, kexec,
linux-kselftest, linux-kernel
The kexec Makefile recognizes PowerPC only through the ppc64le spelling
of ARCH, so the canonical ARCH=powerpc used for cross builds omits the
tests. The x86 jump test is selected with IS_64_BIT from
scripts/Makefile.arch, which describes the build host rather than the
compiler being used. On other architectures the Makefile includes no
lib.mk rules at all, so installation and runlist generation fail with
missing targets.
Select x86 and PowerPC from the target ARCH when it is given and from
the host's SUBARCH otherwise, without assigning ARCH, so that lib.mk
keeps choosing the compiler's native clang target. Ask the selected
compiler, including USERCFLAGS, whether it targets a 64-bit x86 ABI
and whether it targets little-endian 64-bit PowerPC. lib.mk expands the
generated program list before it appends USERCFLAGS to CFLAGS, so the
flags are passed explicitly to keep both probes consistent. If the
compiler cannot be run, select the jump test so that the build fails
instead of silently dropping it. Include lib.mk unconditionally so that
unsupported targets build, install and emit an empty runlist.
Fixes: 65e38e32a959 ("selftests/kexec: Enable secureboot tests for PowerPC")
Fixes: 7615b94b6371 ("selftests/kexec: Add x86_64 selftest for kexec-jump and exception handling")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/kexec/Makefile | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/tools/testing/selftests/kexec/Makefile b/tools/testing/selftests/kexec/Makefile
index 874cfdd3b75b3..97d5dd10208a1 100644
--- a/tools/testing/selftests/kexec/Makefile
+++ b/tools/testing/selftests/kexec/Makefile
@@ -1,20 +1,22 @@
# SPDX-License-Identifier: GPL-2.0-only
# Makefile for kexec tests
-ARCH ?= $(shell uname -m 2>/dev/null || echo not)
-ARCH_PROCESSED := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+top_srcdir = ../../../..
+include $(top_srcdir)/scripts/subarch.include
+ARCH_PROCESSED := $(shell echo $(or $(ARCH),$(SUBARCH)) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
-ifeq ($(ARCH_PROCESSED),$(filter $(ARCH_PROCESSED),x86 ppc64le))
-TEST_PROGS := test_kexec_load.sh test_kexec_file_load.sh
-TEST_FILES := kexec_common_lib.sh
+PROBE_CC = $(filter-out -fuse-ld=%,$(CC)) $(CFLAGS) $(USERCFLAGS) -E -P -x c -
+CC_IS_64BIT = $(shell echo __SIZEOF_LONG__ | $(PROBE_CC) || echo 8)
+PPC64LE = $(shell printf '\043if defined(__powerpc64__) && __BYTE_ORDER__ == \
+ __ORDER_LITTLE_ENDIAN__\n1\n\043endif\n' | $(PROBE_CC))
-include ../../../scripts/Makefile.arch
-
-ifeq ($(IS_64_BIT)$(ARCH_PROCESSED),1x86)
-TEST_PROGS += test_kexec_jump.sh
-TEST_GEN_PROGS := test_kexec_jump
+ifeq ($(ARCH_PROCESSED),x86)
+TEST_PROGS = test_kexec_load.sh test_kexec_file_load.sh \
+ $(if $(filter 8,$(CC_IS_64BIT)),test_kexec_jump.sh)
+TEST_GEN_PROGS = $(if $(filter 8,$(CC_IS_64BIT)),test_kexec_jump)
+else ifneq (,$(filter powerpc ppc64le,$(ARCH_PROCESSED)))
+TEST_PROGS = $(if $(filter 1,$(PPC64LE)),test_kexec_load.sh test_kexec_file_load.sh)
endif
+TEST_FILES = $(if $(TEST_PROGS),kexec_common_lib.sh)
include ../lib.mk
-
-endif
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 5/5] selftests/size: use nolibc startup and syscall wrappers
2026-10-14 20:01 [PATCH 0/5] selftests: target selection fixes for cross and LLVM builds Sasha Levin
` (3 preceding siblings ...)
2026-10-14 20:01 ` [PATCH 4/5] selftests/kexec: select tests using the target compiler Sasha Levin
@ 2026-10-14 20:01 ` Sasha Levin
2026-10-14 20:51 ` Thomas Weißschuh
4 siblings, 1 reply; 7+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Shuah Khan
Cc: Sasha Levin, Willy Tarreau, Thomas Weißschuh, Wake Liu,
linux-kselftest, linux-kernel, stable
get_size provides its own _start and is linked statically against the C
library with -nostartfiles. That combination assumes startup and TLS
details that vary between architectures and C library versions: errno
lives in thread-local storage that is never set up, and the static link
expects symbols from the skipped startup files. CI builds have failed
with undefined _init/_fini on ARM with clang and an undefined _DYNAMIC
on LoongArch.
Build the test with the in-tree nolibc instead. nolibc provides the
startup code, so the test returns from main(), and it provides the
write() and syscall() wrappers without the TLS errno problem. A failing
sysinfo() is now reported as a TAP failure instead of crashing the
test. Keep the static link and the existing TAP output.
Since the test no longer uses the system C library headers, the kernel
UAPI headers have to be installed before it is built. Add the headers
target as an order-only prerequisite, as nolibc-test does, so that a
standalone build installs them. Link libgcc only when the selected
compiler is GCC, which needs it for division helpers on ARM, and detect
that from the compiler rather than from LLVM so that CC=clang builds do
not try to link a libgcc that clang does not provide.
nolibc does not support arc, csky, microblaze, nios2 or xtensa, so the
test can no longer be built for those architectures. This conversion
also makes the separate i386 vDSO workaround proposed for get_size
unnecessary.
Link: https://lore.kernel.org/r/20260929043637.1917707-1-wakel@google.com
Fixes: 3ce51050fadd ("selftest: size: Add size test for Linux kernel")
Cc: stable@vger.kernel.org # 6.18.x
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/size/Makefile | 9 ++++++-
tools/testing/selftests/size/get_size.c | 33 +++++++------------------
2 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
index b87facc00a6e9..884b42d7fd0e2 100644
--- a/tools/testing/selftests/size/Makefile
+++ b/tools/testing/selftests/size/Makefile
@@ -1,6 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-only
-CFLAGS := -static -ffreestanding -nostartfiles -s
+CFLAGS = -Os -static -nostdlib -nostdinc -ffreestanding -fno-stack-protector -s
+CFLAGS += -isystem $(top_srcdir)/tools/include/nolibc $(KHDR_INCLUDES)
TEST_GEN_PROGS := get_size
include ../lib.mk
+
+CC_IS_GCC := $(shell printf '\043if defined(__GNUC__) && !defined(__clang__)\nGCC\n\043endif\n' | \
+ $(CC) $(CFLAGS) -E -P -x c - 2>/dev/null)
+LDLIBS += $(if $(filter GCC,$(CC_IS_GCC)),-lgcc)
+
+$(OUTPUT)/get_size: | headers
diff --git a/tools/testing/selftests/size/get_size.c b/tools/testing/selftests/size/get_size.c
index 2980b1a63366b..ada6a271711a7 100644
--- a/tools/testing/selftests/size/get_size.c
+++ b/tools/testing/selftests/size/get_size.c
@@ -11,26 +11,12 @@
* own execution. It also attempts to have as few dependencies
* on kernel features as possible.
*
- * It should be statically linked, with startup libs avoided. It uses
- * no library calls except the syscall() function for the following 3
- * syscalls:
- * sysinfo(), write(), and _exit()
- *
- * For output, it avoids printf (which in some C libraries
- * has large external dependencies) by implementing it's own
- * number output and print routines, and using __builtin_strlen()
- *
- * The test may crash if any of the above syscalls fails because in some
- * libc implementations (e.g. the GNU C Library) errno is saved in
- * thread-local storage, which does not get initialized due to avoiding
- * startup libs.
+ * It is statically linked with nolibc startup and syscall wrappers.
+ * For output, it avoids printf by implementing its own print routines.
*/
-#include <sys/sysinfo.h>
-#include <unistd.h>
-#include <sys/syscall.h>
-
-#define STDOUT_FILENO 1
+#include <nolibc.h>
+#include <linux/sysinfo.h>
static int print(const char *s)
{
@@ -39,7 +25,7 @@ static int print(const char *s)
while (s[len] != '\0')
len++;
- return syscall(SYS_write, STDOUT_FILENO, s, len);
+ return write(STDOUT_FILENO, s, len);
}
static inline char *num_to_str(unsigned long num, char *buf, int len)
@@ -80,8 +66,7 @@ static int print_k_value(const char *s, unsigned long num, unsigned long units)
return ccode;
}
-/* this program has no main(), as startup libraries are not used */
-void _start(void)
+int main(void)
{
int ccode;
struct sysinfo info;
@@ -91,12 +76,12 @@ void _start(void)
print("TAP version 13\n");
print("# Testing system size.\n");
- ccode = syscall(SYS_sysinfo, &info);
+ ccode = syscall(__NR_sysinfo, &info);
if (ccode < 0) {
print("not ok 1");
print(test_name);
print(" ---\n reason: \"could not get sysinfo\"\n ...\n");
- syscall(SYS_exit, ccode);
+ return 1;
}
print("ok 1");
print(test_name);
@@ -112,5 +97,5 @@ void _start(void)
print(" ...\n");
print("1..1\n");
- syscall(SYS_exit, 0);
+ return 0;
}
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 5/5] selftests/size: use nolibc startup and syscall wrappers
2026-10-14 20:01 ` [PATCH 5/5] selftests/size: use nolibc startup and syscall wrappers Sasha Levin
@ 2026-10-14 20:51 ` Thomas Weißschuh
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Weißschuh @ 2026-10-14 20:51 UTC (permalink / raw)
To: Sasha Levin
Cc: Shuah Khan, Willy Tarreau, Wake Liu, linux-kselftest,
linux-kernel, stable
On 2026-10-14 16:01:27-0400, Sasha Levin wrote:
> get_size provides its own _start and is linked statically against the C
> library with -nostartfiles. That combination assumes startup and TLS
> details that vary between architectures and C library versions: errno
> lives in thread-local storage that is never set up, and the static link
> expects symbols from the skipped startup files. CI builds have failed
> with undefined _init/_fini on ARM with clang and an undefined _DYNAMIC
> on LoongArch.
I get the _DYNAMIC failures even on my boring x86_64 distro setup.
> Build the test with the in-tree nolibc instead. nolibc provides the
> startup code, so the test returns from main(), and it provides the
> write() and syscall() wrappers without the TLS errno problem. A failing
> sysinfo() is now reported as a TAP failure instead of crashing the
> test. Keep the static link and the existing TAP output.
>
> Since the test no longer uses the system C library headers, the kernel
> UAPI headers have to be installed before it is built. Add the headers
> target as an order-only prerequisite, as nolibc-test does, so that a
> standalone build installs them. Link libgcc only when the selected
> compiler is GCC, which needs it for division helpers on ARM, and detect
> that from the compiler rather than from LLVM so that CC=clang builds do
> not try to link a libgcc that clang does not provide.
>
> nolibc does not support arc, csky, microblaze, nios2 or xtensa,
yet...
> so the
> test can no longer be built for those architectures. This conversion
> also makes the separate i386 vDSO workaround proposed for get_size
> unnecessary.
Nobody seems to build the selftests for these architectures anyways.
> Link: https://lore.kernel.org/r/20260929043637.1917707-1-wakel@google.com
> Fixes: 3ce51050fadd ("selftest: size: Add size test for Linux kernel")
> Cc: stable@vger.kernel.org # 6.18.x
I am not so excited about Fixes and Cc: stable.
But if it breaks, it will land on your plate anyways :-)
> Signed-off-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> tools/testing/selftests/size/Makefile | 9 ++++++-
> tools/testing/selftests/size/get_size.c | 33 +++++++------------------
> 2 files changed, 17 insertions(+), 25 deletions(-)
(...)
> --- a/tools/testing/selftests/size/get_size.c
> +++ b/tools/testing/selftests/size/get_size.c
(...)
> -#include <sys/sysinfo.h>
> -#include <unistd.h>
> -#include <sys/syscall.h>
> -
> -#define STDOUT_FILENO 1
> +#include <nolibc.h>
Note:
The newfangled way to use nolibc would be to stick to the regular libc
includes:
#include <unistd.h>
#include <sys/syscall.h>
#include <linux/sysinfo.h>
But what you have also works, obviously.
> +#include <linux/sysinfo.h>
(...)
^ permalink raw reply [flat|nested] 7+ messages in thread