selftests: arm64: za-fork.c build failed with clang-16 due to below warnings / errors on Linux next-20230725.
Build failed for: - selftests: arm64: za-fork - selftests: arm64: za-ptrace
Reported-by: Linux Kernel Functional Testing lkft@linaro.org
clang --target=aarch64-linux-gnu -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -Werror=option-ignored -Werror=unused-command-line-argument --target=aarch64-linux-gnu -fintegrated-as -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib \ -include ../../../../include/nolibc/nolibc.h -I../..\ -static -ffreestanding -Wall za-fork.c /home/tuxbuild/.cache/tuxmake/builds/1/build/kselftest/arm64/fp/za-fork-asm.o -o /home/tuxbuild/.cache/tuxmake/builds/1/build/kselftest/arm64/fp/za-fork In file included from <built-in>:1: In file included from ./../../../../include/nolibc/nolibc.h:97: In file included from ./../../../../include/nolibc/arch.h:25: ./../../../../include/nolibc/arch-aarch64.h:178:35: warning: unknown attribute 'optimize' ignored [-Wunknown-attributes] void __attribute__((weak,noreturn,optimize("omit-frame-pointer"))) __no_stack_protector _start(void) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from za-fork.c:12: ../../kselftest.h:123:2: error: call to undeclared function 'setvbuf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] setvbuf(stdout, NULL, _IOLBF, 0); ^ ../../kselftest.h:123:24: error: use of undeclared identifier '_IOLBF' setvbuf(stdout, NULL, _IOLBF, 0); ^ 1 warning and 2 errors generated. make[5]: Leaving directory '/builds/linux/tools/testing/selftests/arm64/fp'
Links: - https://storage.tuxsuite.com/public/linaro/lkft/builds/2T3676HpK243gMBLYJCp4... - https://storage.tuxsuite.com/public/linaro/lkft/builds/2T3676HpK243gMBLYJCp4...
steps to reproduce: --- # tuxmake \ --runtime podman \ --target-arch arm64 \ --toolchain clang-16 \ --kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2T3676HpK243gMBLYJCp4... LLVM=1 LLVM_IAS=1 dtbs dtbs-legacy headers kernel kselftest modules
-- Linaro LKFT https://lkft.linaro.org
On Tue, Jul 25, 2023 at 06:26:34PM +0530, Naresh Kamboju wrote:
selftests: arm64: za-fork.c build failed with clang-16 due to below warnings / errors on Linux next-20230725.
Ryan, this looks to be your setvbuf() change:
Build failed for:
- selftests: arm64: za-fork
- selftests: arm64: za-ptrace
Reported-by: Linux Kernel Functional Testing lkft@linaro.org
clang --target=aarch64-linux-gnu -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -Werror=option-ignored -Werror=unused-command-line-argument --target=aarch64-linux-gnu -fintegrated-as -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib \ -include ../../../../include/nolibc/nolibc.h -I../..\ -static -ffreestanding -Wall za-fork.c /home/tuxbuild/.cache/tuxmake/builds/1/build/kselftest/arm64/fp/za-fork-asm.o -o /home/tuxbuild/.cache/tuxmake/builds/1/build/kselftest/arm64/fp/za-fork In file included from <built-in>:1: In file included from ./../../../../include/nolibc/nolibc.h:97: In file included from ./../../../../include/nolibc/arch.h:25: ./../../../../include/nolibc/arch-aarch64.h:178:35: warning: unknown attribute 'optimize' ignored [-Wunknown-attributes] void __attribute__((weak,noreturn,optimize("omit-frame-pointer"))) __no_stack_protector _start(void) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from za-fork.c:12: ../../kselftest.h:123:2: error: call to undeclared function 'setvbuf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] setvbuf(stdout, NULL, _IOLBF, 0); ^ ../../kselftest.h:123:24: error: use of undeclared identifier '_IOLBF' setvbuf(stdout, NULL, _IOLBF, 0); ^ 1 warning and 2 errors generated. make[5]: Leaving directory '/builds/linux/tools/testing/selftests/arm64/fp'
Links:
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2T3676HpK243gMBLYJCp4...
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2T3676HpK243gMBLYJCp4...
steps to reproduce:
# tuxmake \ --runtime podman \ --target-arch arm64 \ --toolchain clang-16 \ --kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2T3676HpK243gMBLYJCp4... LLVM=1 LLVM_IAS=1 dtbs dtbs-legacy headers kernel kselftest modules
-- Linaro LKFT https://lkft.linaro.org
On 25/07/2023 14:00, Mark Brown wrote:
On Tue, Jul 25, 2023 at 06:26:34PM +0530, Naresh Kamboju wrote:
selftests: arm64: za-fork.c build failed with clang-16 due to below warnings / errors on Linux next-20230725.
Ryan, this looks to be your setvbuf() change:
Thanks, Mark, for adding me in. Yes this is due to my change ensure that stdout is never block buffered, since this was causing a lot of duplicated output for mm selftests due to lots of in-test fork()ing.
It looks like these tests are using nolibc, which doesn't implement setvbuf(). I'm working on a fix, which will add setvbuf() to nolibc (which will be a nop since nolibc never buffers).
Thanks, Ryan
On 25/07/2023 15:47, Ryan Roberts wrote:
On 25/07/2023 14:00, Mark Brown wrote:
On Tue, Jul 25, 2023 at 06:26:34PM +0530, Naresh Kamboju wrote:
selftests: arm64: za-fork.c build failed with clang-16 due to below warnings / errors on Linux next-20230725.
Ryan, this looks to be your setvbuf() change:
Thanks, Mark, for adding me in. Yes this is due to my change ensure that stdout is never block buffered, since this was causing a lot of duplicated output for mm selftests due to lots of in-test fork()ing.
It looks like these tests are using nolibc, which doesn't implement setvbuf(). I'm working on a fix, which will add setvbuf() to nolibc (which will be a nop since nolibc never buffers).
FYI fix posted here: https://lore.kernel.org/lkml/20230726070655.2713530-1-ryan.roberts@arm.com/
Thanks, Ryan
linux-kselftest-mirror@lists.linaro.org