isystem: trim/fixup stdarg.h and other headers
Subsystems (55)
PATCH 1/3 isystem: trim/fixup stdarg.h and other headers
Delete/fixup few includes in anticipation of global -isystem compile option removal.
--- arch/arm/kernel/process.c | 2 -- arch/arm/mach-bcm/bcm_kona_smc.c | 2 -- arch/arm64/kernel/process.c | 3 --- arch/openrisc/kernel/process.c | 2 -- arch/parisc/kernel/process.c | 3 --- arch/powerpc/kernel/prom.c | 1 - arch/sparc/kernel/process_32.c | 3 --- arch/sparc/kernel/process_64.c | 3 --- arch/um/drivers/rtc_user.c | 1 + arch/um/drivers/vector_user.c | 1 + arch/um/include/shared/irq_user.h | 1 - arch/um/include/shared/os.h | 1 - arch/um/os-Linux/signal.c | 2 +- arch/um/os-Linux/util.c | 1 + crypto/aegis128-neon-inner.c | 2 +- drivers/block/xen-blkback/xenbus.c | 1 - drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 1 - drivers/gpu/drm/msm/disp/msm_disp_snapshot.h | 1 - drivers/macintosh/macio-adb.c | 1 - drivers/macintosh/via-macii.c | 2 -- drivers/net/wireless/intersil/orinoco/hermes.c | 1 - drivers/net/wwan/iosm/iosm_ipc_imem.h | 1 - drivers/pinctrl/aspeed/pinmux-aspeed.h | 1 - drivers/scsi/elx/efct/efct_driver.h | 1 - .../media/atomisp/pci/hive_isp_css_common/host/isp_local.h | 2 -- drivers/xen/xen-scsiback.c | 2 -- include/linux/filter.h | 2 -- include/linux/mISDNif.h | 1 - kernel/debug/kdb/kdb_support.c | 1 - sound/aoa/codecs/onyx.h | 1 - sound/aoa/codecs/tas.c | 1 - sound/core/info.c | 1 - 32 files changed, 5 insertions(+), 44 deletions(-)
arch/arm/kernel/process.c +0 -2
@@ -5,8 +5,6 @@* Copyright (C) 1996-2000 Russell King - Converted to ARM. * Original Copyright (C) 1995 Linus Torvalds */ -#include <stdarg.h> -#include <linux/export.h> #include <linux/sched.h> #include <linux/sched/debug.h>
arch/arm/mach-bcm/bcm_kona_smc.c +0 -2
@@ -10,8 +10,6 @@* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ - -#include <stdarg.h> #include <linux/smp.h> #include <linux/io.h> #include <linux/ioport.h>
arch/arm64/kernel/process.c +0 -3
@@ -6,9 +6,6 @@* Copyright (C) 1996-2000 Russell King - Converted to ARM. * Copyright (C) 2012 ARM Ltd. */ - -#include <stdarg.h> -#include <linux/compat.h> #include <linux/efi.h> #include <linux/elf.h>
arch/openrisc/kernel/process.c +0 -2
@@ -14,8 +14,6 @@*/ #define __KERNEL_SYSCALLS__ -#include <stdarg.h> -#include <linux/errno.h> #include <linux/sched.h> #include <linux/sched/debug.h>
arch/parisc/kernel/process.c +0 -3
@@ -17,9 +17,6 @@* Copyright (C) 2001-2014 Helge Deller <[email protected]> * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> */ - -#include <stdarg.h> -#include <linux/elf.h> #include <linux/errno.h> #include <linux/kernel.h>
arch/powerpc/kernel/prom.c +0 -1
@@ -11,7 +11,6 @@#undef DEBUG -#include <stdarg.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/init.h>
arch/sparc/kernel/process_32.c +0 -3
@@ -8,9 +8,6 @@/* * This file handles the architecture-dependent parts of process handling.. */ - -#include <stdarg.h> -#include <linux/elfcore.h> #include <linux/errno.h> #include <linux/module.h>
arch/sparc/kernel/process_64.c +0 -3
@@ -9,9 +9,6 @@/* * This file handles the architecture-dependent parts of process handling.. */ - -#include <stdarg.h> -#include <linux/errno.h> #include <linux/export.h> #include <linux/sched.h>
arch/um/drivers/rtc_user.c +1 -0
@@ -3,6 +3,7 @@* Copyright (C) 2020 Intel Corporation * Author: Johannes Berg <[email protected]> */ +#include <stdbool.h> #include <os.h> #include <errno.h> #include <sched.h>
arch/um/drivers/vector_user.c +1 -0
@@ -3,6 +3,7 @@* Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) */ +#include <stdbool.h> #include <stdio.h> #include <unistd.h> #include <stdarg.h>
arch/um/include/shared/irq_user.h +0 -1
@@ -7,7 +7,6 @@#define __IRQ_USER_H__#include <sysdep/ptrace.h> -#include <stdbool.h> enum um_irq_type {IRQ_READ ,
arch/um/include/shared/os.h +0 -1
@@ -8,7 +8,6 @@#ifndef __OS_H__#define __OS_H__ -#include <stdarg.h> #include <irq_user.h> #include <longjmp.h> #include <mm_id.h>
arch/um/os-Linux/signal.c +1 -1
@@ -67,7 +67,7 @@ int signals_enabled;#ifdef UML_CONFIG_UML_TIME_TRAVEL_SUPPORT static int signals_blocked;#else -#define signals_blocked false +#define signals_blocked 0#endif static unsigned int signals_pending;static unsigned int signals_active =0 ;
arch/um/os-Linux/util.c +1 -0
@@ -3,6 +3,7 @@* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) */ +#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h>
crypto/aegis128-neon-inner.c +1 -1
@@ -15,7 +15,7 @@#define AEGIS_BLOCK_SIZE 16 -#include <stddef.h> +#include <linux/types.h> extern int aegis128_have_aes_insn;
drivers/block/xen-blkback/xenbus.c +0 -1
@@ -8,7 +8,6 @@#define pr_fmt (fmt) "xen-blkback: " fmt -#include <stdarg.h> #include <linux/module.h> #include <linux/kthread.h> #include <xen/events.h>
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +0 -1
@@ -39,7 +39,6 @@#include <linux/types.h> #include <linux/string.h> #include <linux/delay.h> -#include <stdarg.h> #include "atomfirmware.h"
drivers/gpu/drm/msm/disp/msm_disp_snapshot.h +0 -1
@@ -25,7 +25,6 @@#include <linux/pm_runtime.h> #include <linux/kthread.h> #include <linux/devcoredump.h> -#include <stdarg.h> #include "msm_kms.h" #define MSM_DISP_SNAPSHOT_MAX_BLKS 10
drivers/macintosh/macio-adb.c +0 -1
@@ -2,7 +2,6 @@/* * Driver for the ADB controller in the Mac I/O (Hydra) chip. */ -#include <stdarg.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h>
drivers/macintosh/via-macii.c +0 -2
@@ -23,8 +23,6 @@* Apple's "ADB Analyzer" bus sniffer is invaluable: * ftp://ftp.apple.com/developer/Tool_Chest/Devices_-_Hardware/Apple_Desktop_Bus/ */ - -#include <stdarg.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h>
drivers/net/wireless/intersil/orinoco/hermes.c +0 -1
@@ -79,7 +79,6 @@#undef HERMES_DEBUG#ifdef HERMES_DEBUG -#include <stdarg.h> #define DEBUG(lvl, stuff...) if ((lvl) <= HERMES_DEBUG) DMSG(stuff)
drivers/net/wwan/iosm/iosm_ipc_imem.h +0 -1
@@ -7,7 +7,6 @@#define IOSM_IPC_IMEM_H #include <linux/skbuff.h> -#include <stdbool.h> #include "iosm_ipc_mmio.h" #include "iosm_ipc_pcie.h"
drivers/pinctrl/aspeed/pinmux-aspeed.h +0 -1
@@ -5,7 +5,6 @@#define ASPEED_PINMUX_H #include <linux/regmap.h> -#include <stdbool.h> /* * The ASPEED SoCs provide typically more than 200 pins for GPIO and other
drivers/scsi/elx/efct/efct_driver.h +0 -1
@@ -10,7 +10,6 @@/*************************************************************************** * OS specific includes */ -#include <stdarg.h> #include <linux/module.h> #include <linux/debugfs.h> #include <linux/firmware.h>
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/isp_local.h +0 -2
@@ -16,8 +16,6 @@#ifndef __ISP_LOCAL_H_INCLUDED__#define __ISP_LOCAL_H_INCLUDED__ -#include <stdbool.h> -#include "isp_global.h" #include <isp2400_support.h>
drivers/xen/xen-scsiback.c +0 -2
@@ -33,8 +33,6 @@#define pr_fmt (fmt) "xen-pvscsi: " fmt -#include <stdarg.h> -#include <linux/module.h> #include <linux/utsname.h> #include <linux/interrupt.h>
include/linux/filter.h +0 -2
@@ -5,8 +5,6 @@#ifndef __LINUX_FILTER_H__#define __LINUX_FILTER_H__ -#include <stdarg.h> -#include <linux/atomic.h> #include <linux/refcount.h> #include <linux/compat.h>
include/linux/mISDNif.h +0 -1
@@ -18,7 +18,6 @@#ifndef mISDNIF_H#define mISDNIF_H -#include <stdarg.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/socket.h>
kernel/debug/kdb/kdb_support.c +0 -1
@@ -10,7 +10,6 @@* 03/02/13 added new 2.5 kallsyms <[email protected]> */ -#include <stdarg.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/mm.h>
sound/aoa/codecs/onyx.h +0 -1
@@ -6,7 +6,6 @@*/ #ifndef __SND_AOA_CODEC_ONYX_H#define __SND_AOA_CODEC_ONYX_H -#include <stddef.h> #include <linux/i2c.h> #include <asm/pmac_low_i2c.h> #include <asm/prom.h>
sound/aoa/codecs/tas.c +0 -1
@@ -58,7 +58,6 @@* and up to the hardware designer to not wire * them up in some weird unusable way. */ -#include <stddef.h> #include <linux/i2c.h> #include <asm/pmac_low_i2c.h> #include <asm/prom.h>
sound/core/info.c +0 -1
@@ -16,7 +16,6 @@#include <linux/utsname.h> #include <linux/proc_fs.h> #include <linux/mutex.h> -#include <stdarg.h> int snd_info_check_reserved_words (const char *str) {
Signature · 1 line
2.31.1
PATCH 2/3 isystem: ship and use stdarg.h
Ship minimal stdarg.h (1 type, 4 macros) as <linux/stdarg.h>. stdarg.h is the only userspace header commonly used in the kernel.
GPL 2 version of <stdarg.h> can be extracted from
http://archive.debian.org/debian/pool/main/g/gcc-4.2/gcc-4.2_4.2.4.orig.tar.gz
--- arch/parisc/kernel/firmware.c | 2 +- arch/powerpc/kernel/prom_init.c | 2 +- arch/powerpc/kernel/rtas.c | 2 +- arch/powerpc/kernel/udbg.c | 2 +- arch/s390/boot/pgm_check_info.c | 2 +- arch/x86/boot/boot.h | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 2 +- drivers/firmware/efi/libstub/vsprintf.c | 2 +- drivers/gpu/drm/amd/display/dc/dc_helper.c | 2 +- drivers/gpu/drm/drm_print.c | 2 +- drivers/isdn/capi/capiutil.c | 2 +- drivers/macintosh/via-cuda.c | 2 +- drivers/macintosh/via-pmu.c | 2 +- .../atomisp/pci/hive_isp_css_include/print_support.h | 2 +- drivers/staging/media/atomisp/pci/ia_css_env.h | 2 +- .../pci/runtime/debug/interface/ia_css_debug.h | 2 +- drivers/staging/media/atomisp/pci/sh_css_internal.h | 2 +- fs/befs/debug.c | 2 +- fs/reiserfs/prints.c | 2 +- fs/ufs/super.c | 2 +- include/acpi/platform/acgcc.h | 2 +- include/linux/kernel.h | 2 +- include/linux/printk.h | 2 +- include/linux/stdarg.h | 11 +++++++++++ include/linux/string.h | 2 +- lib/debug_info.c | 3 +-- lib/kasprintf.c | 2 +- lib/kunit/string-stream.h | 2 +- lib/vsprintf.c | 2 +- mm/kfence/report.c | 2 +- net/batman-adv/log.c | 2 +- 31 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 include/linux/stdarg.h
arch/parisc/kernel/firmware.c +1 -1
@@ -51,7 +51,7 @@* prumpf 991016 */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/delay.h> #include <linux/init.h>
arch/powerpc/kernel/prom_init.c +1 -1
@@ -14,7 +14,7 @@/* we cannot use FORTIFY as it brings in new symbols */ #define __NO_FORTIFY -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/init.h>
arch/powerpc/kernel/rtas.c +1 -1
@@ -7,7 +7,7 @@* Copyright (C) 2001 IBM. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/spinlock.h>
arch/powerpc/kernel/udbg.c +1 -1
@@ -5,7 +5,7 @@* c 2001 PPC 64 Team, IBM Corp */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/console.h>
arch/s390/boot/pgm_check_info.c +1 -1
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/kernel.h> +#include <linux/stdarg.h> #include <linux/string.h> #include <linux/ctype.h> #include <asm/stacktrace.h>
@@ -8,7 +9,6 @@#include <asm/setup.h> #include <asm/sclp.h> #include <asm/uv.h> -#include <stdarg.h> #include "boot.h" const char hex_asc[] ="0123456789abcdef" ;
arch/x86/boot/boot.h +1 -1
@@ -18,7 +18,7 @@#ifndef __ASSEMBLY__ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/edd.h> #include <asm/setup.h>
drivers/firmware/efi/libstub/efi-stub-helper.c +1 -1
@@ -7,7 +7,7 @@* Copyright 2011 Intel Corporation; author Matt Fleming */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/ctype.h> #include <linux/efi.h>
drivers/firmware/efi/libstub/vsprintf.c +1 -1
@@ -10,7 +10,7 @@* Oh, it's a waste of space, but oh-so-yummy for debugging. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/compiler.h> #include <linux/ctype.h>
drivers/gpu/drm/amd/display/dc/dc_helper.c +1 -1
@@ -28,9 +28,9 @@*/ #include <linux/delay.h> +#include <linux/stdarg.h> #include "dm_services.h" -#include <stdarg.h> #include "dc.h" #include "dc_dmub_srv.h"
drivers/gpu/drm/drm_print.c +1 -1
@@ -25,7 +25,7 @@#define DEBUG /* for pr_debug() */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/io.h> #include <linux/moduleparam.h>
drivers/isdn/capi/capiutil.c +1 -1
@@ -379,7 +379,7 @@ static char *pnames[] = /*2f */ "Useruserdata" }; -#include <stdarg.h> +#include <linux/stdarg.h> /*-------------------------------------------------------*/ static _cdebbuf *bufprint (_cdebbuf *cdb,char *fmt, ...)
drivers/macintosh/via-cuda.c +1 -1
@@ -9,7 +9,7 @@* * Copyright (C) 1996 Paul Mackerras. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h>
drivers/macintosh/via-pmu.c +1 -1
@@ -18,7 +18,7 @@* a sleep or a freq. switch * */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/mutex.h> #include <linux/types.h> #include <linux/errno.h>
drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h +1 -1
@@ -16,7 +16,7 @@#ifndef __PRINT_SUPPORT_H_INCLUDED__#define __PRINT_SUPPORT_H_INCLUDED__ -#include <stdarg.h> +#include <linux/stdarg.h> extern int (*sh_css_printf)(const char *fmt,va_list args);/* depends on host supplied print function in ia_css_init() */
drivers/staging/media/atomisp/pci/ia_css_env.h +1 -1
@@ -17,7 +17,7 @@#define __IA_CSS_ENV_H#include <type_support.h> -#include <stdarg.h> /* va_list */ +#include <linux/stdarg.h> /* va_list */ #include "ia_css_types.h" #include "ia_css_acc_types.h"
drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h +1 -1
@@ -19,7 +19,7 @@/*! \file */ #include <type_support.h> -#include <stdarg.h> +#include <linux/stdarg.h> #include "ia_css_types.h" #include "ia_css_binary.h" #include "ia_css_frame_public.h"
drivers/staging/media/atomisp/pci/sh_css_internal.h +1 -1
@@ -20,7 +20,7 @@#include <math_support.h> #include <type_support.h> #include <platform_support.h> -#include <stdarg.h> +#include <linux/stdarg.h> #if !defined(ISP2401 )#include "input_formatter.h"
fs/befs/debug.c +1 -1
@@ -14,7 +14,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#ifdef __KERNEL__ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/string.h> #include <linux/spinlock.h> #include <linux/kernel.h>
fs/reiserfs/prints.c +1 -1
@@ -8,7 +8,7 @@#include <linux/string.h> #include <linux/buffer_head.h> -#include <stdarg.h> +#include <linux/stdarg.h> static char error_buf[1024 ];static char fmt_buf[1024 ];
fs/ufs/super.c +1 -1
@@ -70,7 +70,7 @@#include <linux/module.h> #include <linux/bitops.h> -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/uaccess.h>
include/acpi/platform/acgcc.h +1 -1
@@ -22,7 +22,7 @@ typedef __builtin_va_list va_list;#define va_arg (v, l) __builtin_va_arg(v, l)#define va_copy (d, s) __builtin_va_copy(d, s)#else -#include <stdarg.h> +#include <linux/stdarg.h> #endif #endif
include/linux/kernel.h +1 -1
@@ -2,7 +2,7 @@#ifndef _LINUX_KERNEL_H#define _LINUX_KERNEL_H -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/align.h> #include <linux/limits.h> #include <linux/linkage.h>
include/linux/printk.h +1 -1
@@ -2,7 +2,7 @@#ifndef __KERNEL_PRINTK__#define __KERNEL_PRINTK__ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/init.h> #include <linux/kern_levels.h> #include <linux/linkage.h>
include/linux/stdarg.h new file +11 -0
@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef _LINUX_STDARG_H +#define _LINUX_STDARG_H + +typedef __builtin_va_list va_list ; +#define va_start (v, l) __builtin_va_start(v, l) +#define va_end (v) __builtin_va_end(v) +#define va_arg (v,T ) __builtin_va_arg(v, T) +#define va_copy (d, s) __builtin_va_copy(d, s) + +#endif
include/linux/string.h +1 -1
@@ -6,7 +6,7 @@#include <linux/types.h> /* for size_t */ #include <linux/stddef.h> /* for NULL */ #include <linux/errno.h> /* for E2BIG */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <uapi/linux/string.h> extern char *strndup_user (const char __user *,long );
lib/debug_info.c +1 -2
@@ -5,8 +5,6 @@* CONFIG_DEBUG_INFO_REDUCED. Please do not add actual code. However, * adding appropriate #includes is fine. */ -#include <stdarg.h> -#include <linux/cred.h> #include <linux/crypto.h> #include <linux/dcache.h>
@@ -22,6 +20,7 @@#include <linux/net.h> #include <linux/sched.h> #include <linux/slab.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <net/addrconf.h> #include <net/sock.h>
lib/kasprintf.c +1 -1
@@ -5,7 +5,7 @@* Copyright (C) 1991, 1992 Linus Torvalds */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/export.h> #include <linux/slab.h> #include <linux/types.h>
lib/kunit/string-stream.h +1 -1
@@ -11,7 +11,7 @@#include <linux/spinlock.h> #include <linux/types.h> -#include <stdarg.h> +#include <linux/stdarg.h> struct string_stream_fragment {struct kunit *test;
lib/vsprintf.c +1 -1
@@ -17,7 +17,7 @@* - scnprintf and vscnprintf */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/build_bug.h> #include <linux/clk.h> #include <linux/clk-provider.h>
mm/kfence/report.c +1 -1
@@ -5,7 +5,7 @@* Copyright (C) 2020, Google LLC. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/kernel.h> #include <linux/lockdep.h>
net/batman-adv/log.c +1 -1
@@ -7,7 +7,7 @@#include "log.h" #include "main.h" -#include <stdarg.h> +#include <linux/stdarg.h> #include "trace.h"
Signature · 1 line
2.31.1
Re: [PATCH 2/3] isystem: ship and use stdarg.h
Quoted 4 lines · Alexey Dobriyan
Ship minimal
stdarg.h(1 type, 4 macros) as <linux/stdarg.h>.stdarg.his the only userspace header commonly used in the kernel.
I /think/ I know why this is a good thing, but it is always better to spell it out.
So with a better explanation in the commit log:
Quoted 470 lines
GPL 2 version of <
stdarg.h> can be extracted from
http://archive.debian.org/debian/pool/main/g/gcc-4.2/gcc-4.2_4.2.4.orig.tar.gzCc "Rafael J. Wysocki" <[email protected]>Cc Len Brown <[email protected]>Cc Ard Biesheuvel <[email protected]>Signed-off-by Alexey Dobriyan <[email protected]>--- arch/parisc/kernel/firmware.c | 2 +- arch/powerpc/kernel/prom_init.c | 2 +- arch/powerpc/kernel/rtas.c | 2 +- arch/powerpc/kernel/udbg.c | 2 +- arch/s390/boot/pgm_check_info.c | 2 +- arch/x86/boot/boot.h | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 2 +- drivers/firmware/efi/libstub/vsprintf.c | 2 +- drivers/gpu/drm/amd/display/dc/dc_helper.c | 2 +- drivers/gpu/drm/drm_print.c | 2 +- drivers/isdn/capi/capiutil.c | 2 +- drivers/macintosh/via-cuda.c | 2 +- drivers/macintosh/via-pmu.c | 2 +- .../atomisp/pci/hive_isp_css_include/print_support.h | 2 +- drivers/staging/media/atomisp/pci/ia_css_env.h | 2 +- .../pci/runtime/debug/interface/ia_css_debug.h | 2 +- drivers/staging/media/atomisp/pci/sh_css_internal.h | 2 +- fs/befs/debug.c | 2 +- fs/reiserfs/prints.c | 2 +- fs/ufs/super.c | 2 +- include/acpi/platform/acgcc.h | 2 +- include/linux/kernel.h | 2 +- include/linux/printk.h | 2 +- include/linux/stdarg.h | 11 +++++++++++ include/linux/string.h | 2 +- lib/debug_info.c | 3 +-- lib/kasprintf.c | 2 +- lib/kunit/string-stream.h | 2 +- lib/vsprintf.c | 2 +- mm/kfence/report.c | 2 +- net/batman-adv/log.c | 2 +- 31 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 include/linux/stdarg.harch/parisc/kernel/firmware.c +1
-1@@ -51,7 +51,7 @@* prumpf 991016 */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/delay.h> #include <linux/init.h> arch/powerpc/kernel/prom_init.c +1
-1@@ -14,7 +14,7 @@/* we cannot use FORTIFY as it brings in new symbols */ #define __NO_FORTIFY -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/init.h> arch/powerpc/kernel/rtas.c +1
-1@@ -7,7 +7,7 @@* Copyright (C) 2001 IBM. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/spinlock.h> arch/powerpc/kernel/udbg.c +1
-1@@ -5,7 +5,7 @@* c 2001 PPC 64 Team, IBM Corp */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/console.h> arch/s390/boot/pgm_check_info.c +1
-1@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/kernel.h> +#include <linux/stdarg.h> #include <linux/string.h> #include <linux/ctype.h> #include <asm/stacktrace.h> @@ -8,7 +9,6 @@#include <asm/setup.h> #include <asm/sclp.h> #include <asm/uv.h> -#include <stdarg.h> #include "boot.h" const char hex_asc[] ="0123456789abcdef" ;arch/x86/boot/boot.h +1
-1@@ -18,7 +18,7 @@#ifndef __ASSEMBLY__ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/edd.h> #include <asm/setup.h> drivers/firmware/efi/libstub/efi-stub-helper.c +1
-1@@ -7,7 +7,7 @@* Copyright 2011 Intel Corporation; author Matt Fleming */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/ctype.h> #include <linux/efi.h> drivers/firmware/efi/libstub/vsprintf.c +1
-1@@ -10,7 +10,7 @@* Oh, it's a waste of space, but oh-so-yummy for debugging. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/compiler.h> #include <linux/ctype.h> drivers/gpu/drm/amd/display/dc/dc_helper.c +1
-1@@ -28,9 +28,9 @@*/ #include <linux/delay.h> +#include <linux/stdarg.h> #include "dm_services.h" -#include <stdarg.h> #include "dc.h" #include "dc_dmub_srv.h" drivers/gpu/drm/drm_print.c +1
-1@@ -25,7 +25,7 @@#define DEBUG /* for pr_debug() */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/io.h> #include <linux/moduleparam.h> drivers/isdn/capi/capiutil.c +1
-1@@ -379,7 +379,7 @@ static char *pnames[] = /*2f */ "Useruserdata" }; -#include <stdarg.h> +#include <linux/stdarg.h> /*-------------------------------------------------------*/ static _cdebbuf *bufprint (_cdebbuf *cdb,char *fmt, ...)drivers/macintosh/via-cuda.c +1
-1@@ -9,7 +9,7 @@* * Copyright (C) 1996 Paul Mackerras. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h> drivers/macintosh/via-pmu.c +1
-1@@ -18,7 +18,7 @@* a sleep or a freq. switch * */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/mutex.h> #include <linux/types.h> #include <linux/errno.h> drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h +1
-1@@ -16,7 +16,7 @@#ifndef __PRINT_SUPPORT_H_INCLUDED__#define __PRINT_SUPPORT_H_INCLUDED__ -#include <stdarg.h> +#include <linux/stdarg.h> extern int (*sh_css_printf)(const char *fmt,va_list args);/* depends on host supplied print function in ia_css_init() */ drivers/staging/media/atomisp/pci/ia_css_env.h +1
-1@@ -17,7 +17,7 @@#define __IA_CSS_ENV_H#include <type_support.h> -#include <stdarg.h> /* va_list */ +#include <linux/stdarg.h> /* va_list */ #include "ia_css_types.h" #include "ia_css_acc_types.h" drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h +1
-1@@ -19,7 +19,7 @@/*! \file */ #include <type_support.h> -#include <stdarg.h> +#include <linux/stdarg.h> #include "ia_css_types.h" #include "ia_css_binary.h" #include "ia_css_frame_public.h" drivers/staging/media/atomisp/pci/sh_css_internal.h +1
-1@@ -20,7 +20,7 @@#include <math_support.h> #include <type_support.h> #include <platform_support.h> -#include <stdarg.h> +#include <linux/stdarg.h> #if !defined(ISP2401 )#include "input_formatter.h" fs/befs/debug.c +1
-1@@ -14,7 +14,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#ifdef __KERNEL__ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/string.h> #include <linux/spinlock.h> #include <linux/kernel.h> fs/reiserfs/prints.c +1
-1@@ -8,7 +8,7 @@#include <linux/string.h> #include <linux/buffer_head.h> -#include <stdarg.h> +#include <linux/stdarg.h> static char error_buf[1024 ];static char fmt_buf[1024 ];fs/ufs/super.c +1
-1@@ -70,7 +70,7 @@#include <linux/module.h> #include <linux/bitops.h> -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/uaccess.h> include/acpi/platform/acgcc.h +1
-1@@ -22,7 +22,7 @@ typedef __builtin_va_list va_list;#define va_arg (v, l) __builtin_va_arg(v, l)#define va_copy (d, s) __builtin_va_copy(d, s)#else -#include <stdarg.h> +#include <linux/stdarg.h> #endif #endif include/linux/kernel.h +1
-1@@ -2,7 +2,7 @@#ifndef _LINUX_KERNEL_H#define _LINUX_KERNEL_H -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/align.h> #include <linux/limits.h> #include <linux/linkage.h> include/linux/printk.h +1
-1@@ -2,7 +2,7 @@#ifndef __KERNEL_PRINTK__#define __KERNEL_PRINTK__ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/init.h> #include <linux/kern_levels.h> #include <linux/linkage.h> include/linux/stdarg.h new file +11
-0@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef _LINUX_STDARG_H +#define _LINUX_STDARG_H + +typedef __builtin_va_list va_list ; +#define va_start (v, l) __builtin_va_start(v, l) +#define va_end (v) __builtin_va_end(v) +#define va_arg (v,T ) __builtin_va_arg(v, T) +#define va_copy (d, s) __builtin_va_copy(d, s) + +#endif include/linux/string.h +1
-1@@ -6,7 +6,7 @@#include <linux/types.h> /* for size_t */ #include <linux/stddef.h> /* for NULL */ #include <linux/errno.h> /* for E2BIG */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <uapi/linux/string.h> extern char *strndup_user (const char __user *,long );lib/debug_info.c +1
-2@@ -5,8 +5,6 @@* CONFIG_DEBUG_INFO_REDUCED. Please do not add actual code. However, * adding appropriate #includes is fine. */ -#include <stdarg.h> -#include <linux/cred.h> #include <linux/crypto.h> #include <linux/dcache.h> @@ -22,6 +20,7 @@#include <linux/net.h> #include <linux/sched.h> #include <linux/slab.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <net/addrconf.h> #include <net/sock.h> lib/kasprintf.c +1
-1@@ -5,7 +5,7 @@* Copyright (C) 1991, 1992 Linus Torvalds */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/export.h> #include <linux/slab.h> #include <linux/types.h> lib/kunit/string-stream.h +1
-1@@ -11,7 +11,7 @@#include <linux/spinlock.h> #include <linux/types.h> -#include <stdarg.h> +#include <linux/stdarg.h> struct string_stream_fragment {struct kunit *test;lib/vsprintf.c +1
-1@@ -17,7 +17,7 @@* - scnprintf and vscnprintf */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/build_bug.h> #include <linux/clk.h> #include <linux/clk-provider.h> mm/kfence/report.c +1
-1@@ -5,7 +5,7 @@* Copyright (C) 2020, Google LLC. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/kernel.h> #include <linux/lockdep.h> net/batman-adv/log.c +1
-2@@ -7,7 +7,7 @@#include "log.h" #include "main.h" -#include <stdarg.h> +#include <linux/stdarg.h> #include "trace.h" --2.31.1
Re: [PATCH 2/3] isystem: ship and use stdarg.h
Quoted 7 lines · Ard Biesheuvel
Quoted 4 lines · Alexey Dobriyan
Ship minimal
stdarg.h(1 type, 4 macros) as <linux/stdarg.h>.stdarg.his the only userspace header commonly used in the kernel.
Quoted 7 lines
I /think/ I know why this is a good thing, but it is always better to spell it out.
So with a better explanation in the commit log:
Acked-by Ard Biesheuvel <[email protected]>
I added your Ack because the benefit of this refactoring is described in this:
https://lore.kernel.org/lkml/[email protected]/
Signature · 2 lines
Best Regards Masahiro Yamada
Re: [PATCH 2/3] isystem: ship and use stdarg.h
In reply to Alexey DobriyanQuoted 7 lines · Alexey Dobriyan
Ship minimal
stdarg.h(1 type, 4 macros) as <linux/stdarg.h>.stdarg.his the only userspace header commonly used in the kernel.GPL 2 version of <
stdarg.h> can be extracted from
http://archive.debian.org/debian/pool/main/g/gcc-4.2/gcc-4.2_4.2.4.orig.tar.gz
Quoted 6 lines
Cc "Rafael J. Wysocki" <[email protected]>Cc Len Brown <[email protected]>Cc Ard Biesheuvel <[email protected]>Signed-off-by Alexey Dobriyan <[email protected]>
For the ACPI part:
Quoted 461 lines
--- arch/parisc/kernel/firmware.c | 2 +- arch/powerpc/kernel/prom_init.c | 2 +- arch/powerpc/kernel/rtas.c | 2 +- arch/powerpc/kernel/udbg.c | 2 +- arch/s390/boot/pgm_check_info.c | 2 +- arch/x86/boot/boot.h | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 2 +- drivers/firmware/efi/libstub/vsprintf.c | 2 +- drivers/gpu/drm/amd/display/dc/dc_helper.c | 2 +- drivers/gpu/drm/drm_print.c | 2 +- drivers/isdn/capi/capiutil.c | 2 +- drivers/macintosh/via-cuda.c | 2 +- drivers/macintosh/via-pmu.c | 2 +- .../atomisp/pci/hive_isp_css_include/print_support.h | 2 +- drivers/staging/media/atomisp/pci/ia_css_env.h | 2 +- .../pci/runtime/debug/interface/ia_css_debug.h | 2 +- drivers/staging/media/atomisp/pci/sh_css_internal.h | 2 +- fs/befs/debug.c | 2 +- fs/reiserfs/prints.c | 2 +- fs/ufs/super.c | 2 +- include/acpi/platform/acgcc.h | 2 +- include/linux/kernel.h | 2 +- include/linux/printk.h | 2 +- include/linux/stdarg.h | 11 +++++++++++ include/linux/string.h | 2 +- lib/debug_info.c | 3 +-- lib/kasprintf.c | 2 +- lib/kunit/string-stream.h | 2 +- lib/vsprintf.c | 2 +- mm/kfence/report.c | 2 +- net/batman-adv/log.c | 2 +- 31 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 include/linux/stdarg.harch/parisc/kernel/firmware.c +1
-1@@ -51,7 +51,7 @@* prumpf 991016 */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/delay.h> #include <linux/init.h> arch/powerpc/kernel/prom_init.c +1
-1@@ -14,7 +14,7 @@/* we cannot use FORTIFY as it brings in new symbols */ #define __NO_FORTIFY -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/init.h> arch/powerpc/kernel/rtas.c +1
-1@@ -7,7 +7,7 @@* Copyright (C) 2001 IBM. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/spinlock.h> arch/powerpc/kernel/udbg.c +1
-1@@ -5,7 +5,7 @@* c 2001 PPC 64 Team, IBM Corp */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/console.h> arch/s390/boot/pgm_check_info.c +1
-1@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/kernel.h> +#include <linux/stdarg.h> #include <linux/string.h> #include <linux/ctype.h> #include <asm/stacktrace.h> @@ -8,7 +9,6 @@#include <asm/setup.h> #include <asm/sclp.h> #include <asm/uv.h> -#include <stdarg.h> #include "boot.h" const char hex_asc[] ="0123456789abcdef" ;arch/x86/boot/boot.h +1
-1@@ -18,7 +18,7 @@#ifndef __ASSEMBLY__ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/edd.h> #include <asm/setup.h> drivers/firmware/efi/libstub/efi-stub-helper.c +1
-1@@ -7,7 +7,7 @@* Copyright 2011 Intel Corporation; author Matt Fleming */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/ctype.h> #include <linux/efi.h> drivers/firmware/efi/libstub/vsprintf.c +1
-1@@ -10,7 +10,7 @@* Oh, it's a waste of space, but oh-so-yummy for debugging. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/compiler.h> #include <linux/ctype.h> drivers/gpu/drm/amd/display/dc/dc_helper.c +1
-1@@ -28,9 +28,9 @@*/ #include <linux/delay.h> +#include <linux/stdarg.h> #include "dm_services.h" -#include <stdarg.h> #include "dc.h" #include "dc_dmub_srv.h" drivers/gpu/drm/drm_print.c +1
-1@@ -25,7 +25,7 @@#define DEBUG /* for pr_debug() */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/io.h> #include <linux/moduleparam.h> drivers/isdn/capi/capiutil.c +1
-1@@ -379,7 +379,7 @@ static char *pnames[] = /*2f */ "Useruserdata" }; -#include <stdarg.h> +#include <linux/stdarg.h> /*-------------------------------------------------------*/ static _cdebbuf *bufprint (_cdebbuf *cdb,char *fmt, ...)drivers/macintosh/via-cuda.c +1
-1@@ -9,7 +9,7 @@* * Copyright (C) 1996 Paul Mackerras. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h> drivers/macintosh/via-pmu.c +1
-1@@ -18,7 +18,7 @@* a sleep or a freq. switch * */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/mutex.h> #include <linux/types.h> #include <linux/errno.h> drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h +1
-1@@ -16,7 +16,7 @@#ifndef __PRINT_SUPPORT_H_INCLUDED__#define __PRINT_SUPPORT_H_INCLUDED__ -#include <stdarg.h> +#include <linux/stdarg.h> extern int (*sh_css_printf)(const char *fmt,va_list args);/* depends on host supplied print function in ia_css_init() */ drivers/staging/media/atomisp/pci/ia_css_env.h +1
-1@@ -17,7 +17,7 @@#define __IA_CSS_ENV_H#include <type_support.h> -#include <stdarg.h> /* va_list */ +#include <linux/stdarg.h> /* va_list */ #include "ia_css_types.h" #include "ia_css_acc_types.h" drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h +1
-1@@ -19,7 +19,7 @@/*! \file */ #include <type_support.h> -#include <stdarg.h> +#include <linux/stdarg.h> #include "ia_css_types.h" #include "ia_css_binary.h" #include "ia_css_frame_public.h" drivers/staging/media/atomisp/pci/sh_css_internal.h +1
-1@@ -20,7 +20,7 @@#include <math_support.h> #include <type_support.h> #include <platform_support.h> -#include <stdarg.h> +#include <linux/stdarg.h> #if !defined(ISP2401 )#include "input_formatter.h" fs/befs/debug.c +1
-1@@ -14,7 +14,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#ifdef __KERNEL__ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/string.h> #include <linux/spinlock.h> #include <linux/kernel.h> fs/reiserfs/prints.c +1
-1@@ -8,7 +8,7 @@#include <linux/string.h> #include <linux/buffer_head.h> -#include <stdarg.h> +#include <linux/stdarg.h> static char error_buf[1024 ];static char fmt_buf[1024 ];fs/ufs/super.c +1
-1@@ -70,7 +70,7 @@#include <linux/module.h> #include <linux/bitops.h> -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/uaccess.h> include/acpi/platform/acgcc.h +1
-1@@ -22,7 +22,7 @@ typedef __builtin_va_list va_list;#define va_arg (v, l) __builtin_va_arg(v, l)#define va_copy (d, s) __builtin_va_copy(d, s)#else -#include <stdarg.h> +#include <linux/stdarg.h> #endif #endif include/linux/kernel.h +1
-1@@ -2,7 +2,7 @@#ifndef _LINUX_KERNEL_H#define _LINUX_KERNEL_H -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/align.h> #include <linux/limits.h> #include <linux/linkage.h> include/linux/printk.h +1
-1@@ -2,7 +2,7 @@#ifndef __KERNEL_PRINTK__#define __KERNEL_PRINTK__ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/init.h> #include <linux/kern_levels.h> #include <linux/linkage.h> include/linux/stdarg.h new file +11
-0@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef _LINUX_STDARG_H +#define _LINUX_STDARG_H + +typedef __builtin_va_list va_list ; +#define va_start (v, l) __builtin_va_start(v, l) +#define va_end (v) __builtin_va_end(v) +#define va_arg (v,T ) __builtin_va_arg(v, T) +#define va_copy (d, s) __builtin_va_copy(d, s) + +#endif include/linux/string.h +1
-1@@ -6,7 +6,7 @@#include <linux/types.h> /* for size_t */ #include <linux/stddef.h> /* for NULL */ #include <linux/errno.h> /* for E2BIG */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <uapi/linux/string.h> extern char *strndup_user (const char __user *,long );lib/debug_info.c +1
-2@@ -5,8 +5,6 @@* CONFIG_DEBUG_INFO_REDUCED. Please do not add actual code. However, * adding appropriate #includes is fine. */ -#include <stdarg.h> -#include <linux/cred.h> #include <linux/crypto.h> #include <linux/dcache.h> @@ -22,6 +20,7 @@#include <linux/net.h> #include <linux/sched.h> #include <linux/slab.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <net/addrconf.h> #include <net/sock.h> lib/kasprintf.c +1
-1@@ -5,7 +5,7 @@* Copyright (C) 1991, 1992 Linus Torvalds */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/export.h> #include <linux/slab.h> #include <linux/types.h> lib/kunit/string-stream.h +1
-1@@ -11,7 +11,7 @@#include <linux/spinlock.h> #include <linux/types.h> -#include <stdarg.h> +#include <linux/stdarg.h> struct string_stream_fragment {struct kunit *test;lib/vsprintf.c +1
-1@@ -17,7 +17,7 @@* - scnprintf and vscnprintf */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/build_bug.h> #include <linux/clk.h> #include <linux/clk-provider.h> mm/kfence/report.c +1
-1@@ -5,7 +5,7 @@* Copyright (C) 2020, Google LLC. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/kernel.h> #include <linux/lockdep.h> net/batman-adv/log.c +1
-2@@ -7,7 +7,7 @@#include "log.h" #include "main.h" -#include <stdarg.h> +#include <linux/stdarg.h> #include "trace.h" --2.31.1
PATCH 3/3 isystem: delete global -isystem compile option
In reply to Alexey DobriyanIn theory, it enables "leakage" of userspace headers into kernel which may present licensing problem.
In practice, only stdarg.h was used, stdbool.h is trivial and SIMD intrinsics are contained to a few architectures and aren't global problem.
In general, kernel is very self contained code and -isystem removal will further isolate it from Ring Threeland influence.
nds32 keeps -isystem globally due to intrisics used in entrenched header.
-isystem is selectively reenabled for some files.
Not compile tested on hexagon.
Compile tested on:
alpha-allmodconfig alpha-allnoconfig alpha-defconfig arm64-allmodconfig arm64-allnoconfig arm64-defconfig arm-am200epdkit arm-aspeed_g4 arm-aspeed_g5 arm-assabet arm-at91_dt arm-axm55xx arm-badge4 arm-bcm2835 arm-cerfcube arm-clps711x arm-cm_x300 arm-cns3420vb arm-colibri_pxa270 arm-colibri_pxa300 arm-collie arm-corgi arm-davinci_all arm-dove arm-ep93xx arm-eseries_pxa arm-exynos arm-ezx arm-footbridge arm-gemini arm-h3600 arm-h5000 arm-hackkit arm-hisi arm-imote2 arm-imx_v4_v5 arm-imx_v6_v7 arm-integrator arm-iop32x arm-ixp4xx arm-jornada720 arm-keystone arm-lart arm-lpc18xx arm-lpc32xx arm-lpd270 arm-lubbock arm-magician arm-mainstone arm-milbeaut_m10v arm-mini2440 arm-mmp2 arm-moxart arm-mps2 arm-multi_v4t arm-multi_v5 arm-multi_v7 arm-mv78xx0 arm-mvebu_v5 arm-mvebu_v7 arm-mxs arm-neponset arm-netwinder arm-nhk8815 arm-omap1 arm-omap2plus arm-orion5x arm-oxnas_v6 arm-palmz72 arm-pcm027 arm-pleb arm-pxa arm-pxa168 arm-pxa255-idp arm-pxa3xx arm-pxa910 arm-qcom arm-realview arm-rpc arm-s3c2410 arm-s3c6400 arm-s5pv210 arm-sama5 arm-shannon arm-shmobile arm-simpad arm-socfpga arm-spear13xx arm-spear3xx arm-spear6xx arm-spitz arm-stm32 arm-sunxi arm-tct_hammer arm-tegra arm-trizeps4 arm-u8500 arm-versatile arm-vexpress arm-vf610m4 arm-viper arm-vt8500_v6_v7 arm-xcep arm-zeus csky-allmodconfig csky-allnoconfig csky-defconfig h8300-edosk2674 h8300-h8300h-sim h8300-h8s-sim i386-allmodconfig i386-allnoconfig i386-defconfig ia64-allmodconfig ia64-allnoconfig ia64-bigsur ia64-generic ia64-gensparse ia64-tiger ia64-zx1 m68k-amcore m68k-amiga m68k-apollo m68k-atari m68k-bvme6000 m68k-hp300 m68k-m5208evb m68k-m5249evb m68k-m5272c3 m68k-m5275evb m68k-m5307c3 m68k-m5407c3 m68k-m5475evb m68k-mac m68k-multi m68k-mvme147 m68k-mvme16x m68k-q40 m68k-stmark2 m68k-sun3 m68k-sun3x microblaze-allmodconfig microblaze-allnoconfig microblaze-mmu mips-ar7 mips-ath25 mips-ath79 mips-bcm47xx mips-bcm63xx mips-bigsur mips-bmips_be mips-bmips_stb mips-capcella mips-cavium_octeon mips-ci20 mips-cobalt mips-cu1000-neo mips-cu1830-neo mips-db1xxx mips-decstation mips-decstation_64 mips-decstation_r4k mips-e55 mips-fuloong2e mips-gcw0 mips-generic mips-gpr mips-ip22 mips-ip27 mips-ip28 mips-ip32 mips-jazz mips-jmr3927 mips-lemote2f mips-loongson1b mips-loongson1c mips-loongson2k mips-loongson3 mips-malta mips-maltaaprp mips-malta_kvm mips-malta_qemu_32r6 mips-maltasmvp mips-maltasmvp_eva mips-maltaup mips-maltaup_xpa mips-mpc30x mips-mtx1 mips-nlm_xlp mips-nlm_xlr mips-omega2p mips-pic32mzda mips-pistachio mips-qi_lb60 mips-rb532 mips-rbtx49xx mips-rm200 mips-rs90 mips-rt305x mips-sb1250_swarm mips-tb0219 mips-tb0226 mips-tb0287 mips-vocore2 mips-workpad mips-xway nds32-allmodconfig nds32-allnoconfig nds32-defconfig nios2-10m50 nios2-3c120 nios2-allmodconfig nios2-allnoconfig openrisc-allmodconfig openrisc-allnoconfig openrisc-or1klitex openrisc-or1ksim openrisc-simple_smp parisc-allnoconfig parisc-generic-32bit parisc-generic-64bit powerpc-acadia powerpc-adder875 powerpc-akebono powerpc-amigaone powerpc-arches powerpc-asp8347 powerpc-bamboo powerpc-bluestone powerpc-canyonlands powerpc-cell powerpc-chrp32 powerpc-cm5200 powerpc-currituck powerpc-ebony powerpc-eiger powerpc-ep8248e powerpc-ep88xc powerpc-fsp2 powerpc-g5 powerpc-gamecube powerpc-ge_imp3a powerpc-holly powerpc-icon powerpc-iss476-smp powerpc-katmai powerpc-kilauea powerpc-klondike powerpc-kmeter1 powerpc-ksi8560 powerpc-linkstation powerpc-lite5200b powerpc-makalu powerpc-maple powerpc-mgcoge powerpc-microwatt powerpc-motionpro powerpc-mpc512x powerpc-mpc5200 powerpc-mpc7448_hpc2 powerpc-mpc8272_ads powerpc-mpc8313_rdb powerpc-mpc8315_rdb powerpc-mpc832x_mds powerpc-mpc832x_rdb powerpc-mpc834x_itx powerpc-mpc834x_itxgp powerpc-mpc834x_mds powerpc-mpc836x_mds powerpc-mpc836x_rdk powerpc-mpc837x_mds powerpc-mpc837x_rdb powerpc-mpc83xx powerpc-mpc8540_ads powerpc-mpc8560_ads powerpc-mpc85xx_cds powerpc-mpc866_ads powerpc-mpc885_ads powerpc-mvme5100 powerpc-obs600 powerpc-pasemi powerpc-pcm030 powerpc-pmac32 powerpc-powernv powerpc-ppa8548 powerpc-ppc40x powerpc-ppc44x powerpc-ppc64 powerpc-ppc64e powerpc-ppc6xx powerpc-pq2fads powerpc-ps3 powerpc-pseries powerpc-rainier powerpc-redwood powerpc-sam440ep powerpc-sbc8548 powerpc-sequoia powerpc-skiroot powerpc-socrates powerpc-storcenter powerpc-stx_gp3 powerpc-taishan powerpc-tqm5200 powerpc-tqm8540 powerpc-tqm8541 powerpc-tqm8548 powerpc-tqm8555 powerpc-tqm8560 powerpc-tqm8xx powerpc-walnut powerpc-warp powerpc-wii powerpc-xes_mpc85xx riscv-allmodconfig riscv-allnoconfig riscv-nommu_k210 riscv-nommu_k210_sdcard riscv-nommu_virt riscv-rv32 s390-allmodconfig s390-allnoconfig s390-debug s390-zfcpdump sh-ap325rxa sh-apsh4a3a sh-apsh4ad0a sh-dreamcast sh-ecovec24 sh-ecovec24-romimage sh-edosk7705 sh-edosk7760 sh-espt sh-hp6xx sh-j2 sh-kfr2r09 sh-kfr2r09-romimage sh-landisk sh-lboxre2 sh-magicpanelr2 sh-microdev sh-migor sh-polaris sh-r7780mp sh-r7785rp sh-rsk7201 sh-rsk7203 sh-rsk7264 sh-rsk7269 sh-rts7751r2d1 sh-rts7751r2dplus sh-sdk7780 sh-sdk7786 sh-se7206 sh-se7343 sh-se7619 sh-se7705 sh-se7712 sh-se7721 sh-se7722 sh-se7724 sh-se7750 sh-se7751 sh-se7780 sh-secureedge5410 sh-sh03 sh-sh2007 sh-sh7710voipgw sh-sh7724_generic sh-sh7757lcr sh-sh7763rdp sh-sh7770_generic sh-sh7785lcr sh-sh7785lcr_32bit sh-shmin sh-shx3 sh-titan sh-ul2 sh-urquell sparc-allmodconfig sparc-allnoconfig sparc-sparc32 sparc-sparc64 um-i386-allmodconfig um-i386-allnoconfig um-i386-defconfig um-x86_64-allmodconfig um-x86_64-allnoconfig x86_64-allmodconfig x86_64-allnoconfig x86_64-defconfig xtensa-allmodconfig xtensa-allnoconfig xtensa-audio_kc705 xtensa-cadence_csp xtensa-common xtensa-generic_kc705 xtensa-iss xtensa-nommu_kc705 xtensa-smp_lx200 xtensa-virt xtensa-xip_kc705
--- Makefile | 2 +- arch/arm64/lib/Makefile | 2 ++ arch/nds32/Makefile | 2 ++ arch/powerpc/lib/Makefile | 2 ++ crypto/Makefile | 2 ++ lib/raid6/Makefile | 4 ++++ 6 files changed, 13 insertions(+), 1 deletion(-)
Makefile +1 -1
@@ -979,7 +979,7 @@ KBUILD_CFLAGS += -falign-functions=64 endif # arch Makefile may override CC so keep this after arch Makefile is included -NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) +NOSTDINC_FLAGS += -nostdinc # warn about C99 declaration after statement KBUILD_CFLAGS += -Wdeclaration-after-statement
arch/arm64/lib/Makefile +2 -0
@@ -9,6 +9,8 @@ ifeq ($(CONFIG_KERNEL_MODE_NEON), y) obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o CFLAGS_REMOVE_xor-neon.o += -mgeneral-regs-only CFLAGS_xor-neon.o += -ffreestanding +# Enable <arm_neon.h> +CFLAGS_xor-neon.o += -isystem $(shell $(CC) -print-file-name=include) endif lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o
arch/nds32/Makefile +2 -0
@@ -9,6 +9,8 @@ endif # Avoid generating FPU instructions arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft +# Enable <nds32_intrinsic.h> +KBUILD_CFLAGS += -isystem $(shell $(CC) -print-file-name=include) KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog) KBUILD_CFLAGS += -mcmodel=large
arch/powerpc/lib/Makefile +2 -0
@@ -65,5 +65,7 @@ obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o obj-$(CONFIG_ALTIVEC) += xor_vmx.o xor_vmx_glue.o CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec) +# Enable <altivec.h> +CFLAGS_xor_vmx.o += -isystem $(shell $(CC) -print-file-name=include) obj-$(CONFIG_PPC64) += $(obj64-y)
crypto/Makefile +2 -0
@@ -117,6 +117,8 @@ aegis128-cflags-$(CONFIG_CC_IS_GCC) += -ffixed-q16 -ffixed-q17 -ffixed-q18 \ -ffixed-q28 -ffixed-q29 -ffixed-q30 \ -ffixed-q31 CFLAGS_aegis128-neon-inner.o += $(aegis128-cflags-y) +# Enable <arm_neon.h> +CFLAGS_aegis128-neon-inner.o += -isystem $(shell $(CC) -print-file-name=include) CFLAGS_REMOVE_aegis128-neon-inner.o += -mgeneral-regs-only aegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o endif
lib/raid6/Makefile +4 -0
@@ -14,6 +14,8 @@ hostprogs += mktables ifeq ($(CONFIG_ALTIVEC),y) altivec_flags := -maltivec $(call cc-option,-mabi=altivec) +# Enable <altivec.h> +altivec_flags += -isystem $(shell $(CC) -print-file-name=include) ifdef CONFIG_CC_IS_CLANG # clang ppc port does not yet support -maltivec when -msoft-float is
@@ -34,6 +36,8 @@ endif # ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel) ifeq ($(CONFIG_KERNEL_MODE_NEON),y) NEON_FLAGS := -ffreestanding +# Enable <arm_neon.h> +NEON_FLAGS += -isystem $(shell $(CC) -print-file-name=include) ifeq ($(ARCH),arm) NEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon endif
Signature · 1 line
2.31.1
Re: [PATCH 3/3] isystem: delete global -isystem compile option
Makefile KBUILD_CFLAGS += -falign-functions=64 · line 982
Quoted 5 lines · Alexey Dobriyan
In theory, it enables "leakage" of userspace headers into kernel which may present licensing problem.
Makefile +1
-1-NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) +NOSTDINC_FLAGS += -nostdinc
This is removing the compiler's own include files. These are required for all kinds of basic features, and required to be compliant to the C standard at all. These are not "userspace headers", that is what -nostdinc takes care of already.
In the case of GCC all these headers are GPL-with-runtime-exception, so claiming this can cause licensing problems is fearmongering.
I strongly advise against doing this.
Segher
Re: [PATCH 3/3] isystem: delete global -isystem compile option
Quoted 10 lines · Segher Boessenkool
Makefile KBUILD_CFLAGS += -falign-functions=64 · line 982
Quoted 5 lines · Alexey Dobriyan
In theory, it enables "leakage" of userspace headers into kernel which may present licensing problem.
Makefile +1
-1-NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) +NOSTDINC_FLAGS += -nostdincThis is removing the compiler's own include files. These are required for all kinds of basic features, and required to be compliant to the C standard at all.
No they are not required. Kernel uses its own bool, uintptr_t and static_assert, memset(), CHAR_BIT. noreturn, alignas newest C standard are next.
This version changelog didn't mention but kernel would use -ffreestanding too if not other problems with the flag.
Quoted 2 lines
These are not "userspace headers", that is what
-nostdinc takes care of already.
They are userspace headers in the sense they are external to the project just like userspace programs are external to the kernel.
Quoted 2 lines
In the case of GCC all these headers are GPL-with-runtime-exception, so claiming this can cause licensing problems is fearmongering.
I agree licensing problem doesn't really exist.
It would take gcc drop-in replacement with authors insane enough to not license standard headers properly.
Quoted 1 line
I strongly advise against doing this.
Kernel chose to be self-contained. -isystem removal makes sense then. It will be used for intrinsics where necessary.
Re: [PATCH 3/3] isystem: delete global -isystem compile option
Quoted 5 lines · Alexey Dobriyan
Quoted 4 lines · Segher Boessenkool
Quoted 2 lines · Alexey Dobriyan
In theory, it enables "leakage" of userspace headers into kernel which may present licensing problem.
Quoted 8 lines
Quoted 6 lines
Makefile KBUILD_CFLAGS += -falign-functions=64 · line 982
Quoted 2 lines
Makefile +1
-1-NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) +NOSTDINC_FLAGS += -nostdincThis is removing the compiler's own include files. These are required for all kinds of basic features, and required to be compliant to the C standard at all.
No they are not required.
This is false, they *are* required, whenever you want to use these features. If you do not include the required headers you get undefined behaviour.
Quoted 2 lines
Kernel uses its own bool,
uintptr_tandstatic_assert,memset(),CHAR_BIT.
Yes, and it occasionally gets it wrong. Great fun. See c46bbf5d2def for the latest episode in this saga. (Yes I know this is uapi so maybe not the best example here, but it isn't like the kernel gets such things wrong so often these days ;-) )
The kernel *cannot* make up its own types for this. It has to use the types it is required to use (by C, by the ABIs, etc.) So why reimplement this?
Quoted 2 lines
noreturn, alignas newest C standard
are next.
What is wrong with <stdalign.h> and <stdnoreturn.h>?
Quoted 2 lines
This version changelog didn't mention but kernel would use -ffreestanding too if not other problems with the flag.
It is still true for freestanding C implementations, you just get a severely reduced standard library,
Quoted 5 lines
Quoted 2 lines
These are not "userspace headers", that is what
-nostdinc takes care of already.They are userspace headers in the sense they are external to the project just like userspace programs are external to the kernel.
So you are going to rewrite all of the rest of GCC inside the kernel project as well?
Quoted 6 lines
Quoted 2 lines
In the case of GCC all these headers are GPL-with-runtime-exception, so claiming this can cause licensing problems is fearmongering.
I agree licensing problem doesn't really exist.
It would take gcc drop-in replacement with authors insane enough to not license standard headers properly.
There does still not exist a drop-in replacement for GCC, not if you look closely and/or rely on details (like the kernel does). Some of the differences are hidden by "linux/compiler-*.h", but hardly all.
Quoted 3 lines
Quoted 1 line
I strongly advise against doing this.
Kernel chose to be self-contained.
That is largely historical, imo. Nowadays this is less necessary.
Also, the kernel chose to *do* use the compiler include files. It is you who wants to abolish that here.
Quoted 1 line
-isystem removal makes sense then.
-nostdinc -isystem $(shell $(CC) -print-file-name=include) makes sense for that: you do indeed not want the userspace headers. Maiming the compiler (by removing some of its functional parts, namely, its generic headers) does not make sense.
Quoted 1 line
It will be used for intrinsics where necessary.
Like, everywhere.
Segher
Re: [PATCH 3/3] isystem: delete global -isystem compile option
Quoted 22 lines · Segher Boessenkool
Quoted 5 lines · Alexey Dobriyan
Quoted 4 lines · Segher Boessenkool
Quoted 2 lines · Alexey Dobriyan
In theory, it enables "leakage" of userspace headers into kernel which may present licensing problem.
Quoted 8 lines
Quoted 6 lines
Makefile KBUILD_CFLAGS += -falign-functions=64 · line 982
Quoted 2 lines
Makefile +1
-1-NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) +NOSTDINC_FLAGS += -nostdincThis is removing the compiler's own include files. These are required for all kinds of basic features, and required to be compliant to the C standard at all.
No they are not required.
This is false, they *are* required, whenever you want to use these features. If you do not include the required headers you get undefined behaviour.
Quoted 2 lines
Kernel uses its own bool,
uintptr_tandstatic_assert,memset(),CHAR_BIT.
Quoted 8 lines
Yes, and it occasionally gets it wrong. Great fun. See
c46bbf5d2deffor the latest episode in this saga. (Yes I know this is uapi so maybe not the best example here, but it isn't like the kernel gets such things wrong so often these days ;-) )The kernel *cannot* make up its own types for this. It has to use the types it is required to use (by C, by the ABIs, etc.) So why reimplement this?
Yes, it can. gcc headers have stuff like this:
#define __PTRDIFF_TYPE__ long int #define __SIZE_TYPE__ long unsigned int
If gcc can defined standard types, kernel can too.
Quoted 4 lines
Quoted 2 lines
noreturn, alignas newest C standard
are next.What is wrong with <
stdalign.h> and <stdnoreturn.h>?
These two are actually quite nice.
Have you seen <stddef.h>? Loads of macrology crap. Kernel can ship nicer one.
Quoted 6 lines
Quoted 2 lines
This version changelog didn't mention but kernel would use -ffreestanding too if not other problems with the flag.
It is still true for freestanding C implementations, you just get a severely reduced standard library,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
These are not "userspace headers", that is what
-nostdinc takes care of already.They are userspace headers in the sense they are external to the project just like userspace programs are external to the kernel.
So you are going to rewrite all of the rest of GCC inside the kernel project as well?
What an argument. "the rest of GCC" is already there except for stdarg.h.
Quoted 11 lines
Quoted 6 lines
Quoted 2 lines
In the case of GCC all these headers are GPL-with-runtime-exception, so claiming this can cause licensing problems is fearmongering.
I agree licensing problem doesn't really exist.
It would take gcc drop-in replacement with authors insane enough to not license standard headers properly.There does still not exist a drop-in replacement for GCC, not if you look closely and/or rely on details (like the kernel does). Some of the differences are hidden by "
linux/compiler-*.h", but hardly all.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
I strongly advise against doing this.
Kernel chose to be self-contained.
That is largely historical, imo. Nowadays this is less necessary.
I kind of agree as in kernel should use int8_t and stuff because they are standard.
Also, -isystem removal disables <float.h> and <stdatomic.h> which is desireable.
Quoted 5 lines
Also, the kernel chose to *do* use the compiler include files. It is you who wants to abolish that here.
Quoted 1 line
-isystem removal makes sense then.
Quoted 8 lines
-nostdinc -isystem $(shell $(CC) -print-file-name=include) makes sense for that: you do indeed not want the userspace headers. Maiming the compiler (by removing some of its functional parts, namely, its generic headers) does not make sense.
Quoted 1 line
It will be used for intrinsics where necessary.
Like, everywhere.
No, where necessary. Patch demostrates there are only a few places which want -isystem back.
Re: [PATCH 3/3] isystem: delete global -isystem compile option
Quoted 11 lines · Alexey Dobriyan
Quoted 3 lines · Segher Boessenkool
The kernel *cannot* make up its own types for this. It has to use the types it is required to use (by C, by the ABIs, etc.) So why reimplement this?
Yes, it can. gcc headers have stuff like this:
#define __PTRDIFF_TYPE__ long int #define __SIZE_TYPE__ long unsigned intIf gcc can defined standard types, kernel can too.
The kernel *has to* use those exact same types. So why on earth do you feel you should reimplement this?
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
noreturn, alignas newest C standard
are next.What is wrong with <
stdalign.h> and <stdnoreturn.h>?These two are actually quite nice.
Have you seen <
stddef.h>? Loads of macrology crap. Kernel can ship nicer one.
It is a pretty tame file. And it works correctly for *all* targets, including all Linux targets. Why reimplement this? No, it takes virtually no resources to compile this. And you do not have to maintain it *at all*, the compiler will take care of it. It is standard.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
They are userspace headers in the sense they are external to the project just like userspace programs are external to the kernel.
So you are going to rewrite all of the rest of GCC inside the kernel project as well?
What an argument. "the rest of GCC" is already there except for
stdarg.h.
???
That is there as well. But you want to remove it.
"The rest of GCC" is everything in cc1 (the compiler binary), in libgcc (not that the kernel wants that either on most targets, although it is required), etc. A few GB of binary goodness.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Kernel chose to be self-contained.
That is largely historical, imo. Nowadays this is less necessary.
I kind of agree as in kernel should use
int8_tand stuff because they are standard.
s8 is a much nicer name, heh. But it could
#define s8 int8_t
certainly.
What I meant was the kernel wanted to avoid standard headers because those traditionally have been a bit problematic. But decades have gone by, and nowadays the kernel's own headers are at least as bad.
Quoted 2 lines
Also, -isystem removal disables <
float.h> and <stdatomic.h> which is desireable.
Why? Do you think #include <float.h> will ever make it past code review? Do you need to throw up extra barriers so people will have a harder time changing that policy, if ever they think that a good idea?
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
It will be used for intrinsics where necessary.
Like, everywhere.
No, where necessary. Patch demostrates there are only a few places which want -isystem back.
Yes, where necessary, that is what I said. So, potentially everywhere. An arch can decide to use some builtin in a generic header, for example.
Your patch makes for more work in the future, that is the best it does.
Segher
kernel test robot
build botRe: [PATCH 3/3] isystem: delete global -isystem compile option
In reply to Alexey DobriyanThank you for the patch! Yet something to improve:
Hi Alexey,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on linuxtv-media/master linus/master v5.14-rc3 next-20210730] [cannot apply to uml/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Alexey-Dobriyan/isystem-trim-fixup-stdarg-h-and-other-headers/20210802-041553 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: arm-allyesconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/68fed7fc2569ffbc882f0a36ecb4095d953de63c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexey-Dobriyan/isystem-trim-fixup-stdarg-h-and-other-headers/20210802-041553 git checkout 68fed7fc2569ffbc882f0a36ecb4095d953de63c
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> crypto/aegis128-neon-inner.c:11:10: fatal error: arm_neon.h: No such file or directory
11 | #include <arm_neon.h>
| ^~~~~~~~~~~~compilation terminated.
vim +11 crypto/aegis128-neon-inner.c
a4397635afea5d Ard Biesheuvel 2019-08-12 8
a4397635afea5d Ard Biesheuvel 2019-08-12 9 #define AES_ROUND "aese %0.16b, %1.16b \n\t aesmc %0.16b, %0.16b" a4397635afea5d Ard Biesheuvel 2019-08-12 10 #else a4397635afea5d Ard Biesheuvel 2019-08-12 @11 #include <arm_neon.h>
a4397635afea5d Ard Biesheuvel 2019-08-12 12
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [PATCH 3/3] isystem: delete global -isystem compile option
In reply to Alexey DobriyanQuoted 7 lines · Alexey Dobriyan
In theory, it enables "leakage" of userspace headers into kernel which may present licensing problem.
In practice, only
stdarg.hwas used,stdbool.his trivial and SIMD intrinsics are contained to a few architectures and aren't global problem.
Quoted 8 lines
In general, kernel is very self contained code and -isystem removal will further isolate it from Ring Threeland influence.
nds32 keeps -isystem globally due to intrisics used in entrenched header.
-isystem is selectively reenabled for some files.
Not compile tested on hexagon.
With this series on top of v5.14-rc4 and a tangential patch to fix another issue, ARCH=hexagon defconfig and allmodconfig show no issues.
Quoted 195 lines
Compile tested on:
alpha-allmodconfig alpha-allnoconfig alpha-defconfig arm64-allmodconfig arm64-allnoconfig arm64-defconfig arm-am200epdkit arm-aspeed_g4 arm-aspeed_g5 arm-assabet arm-at91_dt arm-axm55xx arm-badge4 arm-bcm2835 arm-cerfcube arm-clps711x arm-cm_x300 arm-cns3420vb arm-colibri_pxa270 arm-colibri_pxa300 arm-collie arm-corgi arm-davinci_all arm-dove arm-ep93xx arm-eseries_pxa arm-exynos arm-ezx arm-footbridge arm-gemini arm-h3600 arm-h5000 arm-hackkit arm-hisi arm-imote2 arm-imx_v4_v5 arm-imx_v6_v7 arm-integrator arm-iop32x arm-ixp4xx arm-jornada720 arm-keystone arm-lart arm-lpc18xx arm-lpc32xx arm-lpd270 arm-lubbock arm-magician arm-mainstone arm-milbeaut_m10v arm-mini2440 arm-mmp2 arm-moxart arm-mps2 arm-multi_v4t arm-multi_v5 arm-multi_v7 arm-mv78xx0 arm-mvebu_v5 arm-mvebu_v7 arm-mxs arm-neponset arm-netwinder arm-nhk8815 arm-omap1 arm-omap2plus arm-orion5x arm-oxnas_v6 arm-palmz72 arm-pcm027 arm-pleb arm-pxa arm-pxa168 arm-pxa255-idp arm-pxa3xx arm-pxa910 arm-qcom arm-realview arm-rpc arm-s3c2410 arm-s3c6400 arm-s5pv210 arm-sama5 arm-shannon arm-shmobile arm-simpad arm-socfpga arm-spear13xx arm-spear3xx arm-spear6xx arm-spitz arm-stm32 arm-sunxi arm-tct_hammer arm-tegra arm-trizeps4 arm-u8500 arm-versatile arm-vexpress arm-vf610m4 arm-viper arm-vt8500_v6_v7 arm-xcep arm-zeus csky-allmodconfig csky-allnoconfig csky-defconfig h8300-edosk2674 h8300-h8300h-sim h8300-h8s-sim i386-allmodconfig i386-allnoconfig i386-defconfig ia64-allmodconfig ia64-allnoconfig ia64-bigsur ia64-generic ia64-gensparse ia64-tiger ia64-zx1 m68k-amcore m68k-amiga m68k-apollo m68k-atari m68k-bvme6000 m68k-hp300 m68k-m5208evb m68k-m5249evb m68k-m5272c3 m68k-m5275evb m68k-m5307c3 m68k-m5407c3 m68k-m5475evb m68k-mac m68k-multi m68k-mvme147 m68k-mvme16x m68k-q40 m68k-stmark2 m68k-sun3 m68k-sun3x microblaze-allmodconfig microblaze-allnoconfig microblaze-mmu mips-ar7 mips-ath25 mips-ath79 mips-bcm47xx mips-bcm63xx mips-bigsur mips-bmips_be mips-bmips_stb mips-capcella mips-cavium_octeon mips-ci20 mips-cobalt mips-cu1000-neo mips-cu1830-neo mips-db1xxx mips-decstation mips-decstation_64 mips-decstation_r4k mips-e55 mips-fuloong2e mips-gcw0 mips-generic mips-gpr mips-ip22 mips-ip27 mips-ip28 mips-ip32 mips-jazz mips-jmr3927 mips-lemote2f mips-loongson1b mips-loongson1c mips-loongson2k mips-loongson3 mips-malta mips-maltaaprp mips-malta_kvm mips-malta_qemu_32r6 mips-maltasmvp mips-maltasmvp_eva mips-maltaup mips-maltaup_xpa mips-mpc30x mips-mtx1 mips-nlm_xlp mips-nlm_xlr mips-omega2p mips-pic32mzda mips-pistachio mips-qi_lb60 mips-rb532 mips-rbtx49xx mips-rm200 mips-rs90 mips-rt305x mips-sb1250_swarm mips-tb0219 mips-tb0226 mips-tb0287 mips-vocore2 mips-workpad mips-xway nds32-allmodconfig nds32-allnoconfig nds32-defconfig nios2-10m50 nios2-3c120 nios2-allmodconfig nios2-allnoconfig openrisc-allmodconfig openrisc-allnoconfig openrisc-or1klitex openrisc-or1ksim openrisc-simple_smp parisc-allnoconfig parisc-generic-32bit parisc-generic-64bit powerpc-acadia powerpc-adder875 powerpc-akebono powerpc-amigaone powerpc-arches powerpc-asp8347 powerpc-bamboo powerpc-bluestone powerpc-canyonlands powerpc-cell powerpc-chrp32 powerpc-cm5200 powerpc-currituck powerpc-ebony powerpc-eiger powerpc-ep8248e powerpc-ep88xc powerpc-fsp2 powerpc-g5 powerpc-gamecube powerpc-ge_imp3a powerpc-holly powerpc-icon powerpc-iss476-smp powerpc-katmai powerpc-kilauea powerpc-klondike powerpc-kmeter1 powerpc-ksi8560 powerpc-linkstation powerpc-lite5200b powerpc-makalu powerpc-maple powerpc-mgcoge powerpc-microwatt powerpc-motionpro powerpc-mpc512x powerpc-mpc5200 powerpc-mpc7448_hpc2 powerpc-mpc8272_ads powerpc-mpc8313_rdb powerpc-mpc8315_rdb powerpc-mpc832x_mds powerpc-mpc832x_rdb powerpc-mpc834x_itx powerpc-mpc834x_itxgp powerpc-mpc834x_mds powerpc-mpc836x_mds powerpc-mpc836x_rdk powerpc-mpc837x_mds powerpc-mpc837x_rdb powerpc-mpc83xx powerpc-mpc8540_ads powerpc-mpc8560_ads powerpc-mpc85xx_cds powerpc-mpc866_ads powerpc-mpc885_ads powerpc-mvme5100 powerpc-obs600 powerpc-pasemi powerpc-pcm030 powerpc-pmac32 powerpc-powernv powerpc-ppa8548 powerpc-ppc40x powerpc-ppc44x powerpc-ppc64 powerpc-ppc64e powerpc-ppc6xx powerpc-pq2fads powerpc-ps3 powerpc-pseries powerpc-rainier powerpc-redwood powerpc-sam440ep powerpc-sbc8548 powerpc-sequoia powerpc-skiroot powerpc-socrates powerpc-storcenter powerpc-stx_gp3 powerpc-taishan powerpc-tqm5200 powerpc-tqm8540 powerpc-tqm8541 powerpc-tqm8548 powerpc-tqm8555 powerpc-tqm8560 powerpc-tqm8xx powerpc-walnut powerpc-warp powerpc-wii powerpc-xes_mpc85xx riscv-allmodconfig riscv-allnoconfig riscv-nommu_k210 riscv-nommu_k210_sdcard riscv-nommu_virt riscv-rv32 s390-allmodconfig s390-allnoconfig s390-debug s390-zfcpdump sh-ap325rxa sh-apsh4a3a sh-apsh4ad0a sh-dreamcast sh-ecovec24 sh-ecovec24-romimage sh-edosk7705 sh-edosk7760 sh-espt sh-hp6xx sh-j2 sh-kfr2r09 sh-kfr2r09-romimage sh-landisk sh-lboxre2 sh-magicpanelr2 sh-microdev sh-migor sh-polaris sh-r7780mp sh-r7785rp sh-rsk7201 sh-rsk7203 sh-rsk7264 sh-rsk7269 sh-rts7751r2d1 sh-rts7751r2dplus sh-sdk7780 sh-sdk7786 sh-se7206 sh-se7343 sh-se7619 sh-se7705 sh-se7712 sh-se7721 sh-se7722 sh-se7724 sh-se7750 sh-se7751 sh-se7780 sh-secureedge5410 sh-sh03 sh-sh2007 sh-sh7710voipgw sh-sh7724_generic sh-sh7757lcr sh-sh7763rdp sh-sh7770_generic sh-sh7785lcr sh-sh7785lcr_32bit sh-shmin sh-shx3 sh-titan sh-ul2 sh-urquell sparc-allmodconfig sparc-allnoconfig sparc-sparc32 sparc-sparc64 um-i386-allmodconfig um-i386-allnoconfig um-i386-defconfig um-x86_64-allmodconfig um-x86_64-allnoconfig x86_64-allmodconfig x86_64-allnoconfig x86_64-defconfig xtensa-allmodconfig xtensa-allnoconfig xtensa-audio_kc705 xtensa-cadence_csp xtensa-common xtensa-generic_kc705 xtensa-iss xtensa-nommu_kc705 xtensa-smp_lx200 xtensa-virt xtensa-xip_kc705
Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc Michael Ellerman <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc Paul Mackerras <[email protected]>Signed-off-by Alexey Dobriyan <[email protected]>--- Makefile | 2 +- arch/arm64/lib/Makefile | 2 ++ arch/nds32/Makefile | 2 ++ arch/powerpc/lib/Makefile | 2 ++ crypto/Makefile | 2 ++ lib/raid6/Makefile | 4 ++++ 6 files changed, 13 insertions(+), 1 deletion(-)Makefile +1
-1@@ -979,7 +979,7 @@ KBUILD_CFLAGS += -falign-functions=64 endif # arch Makefile may override CC so keep this after arch Makefile is included -NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) +NOSTDINC_FLAGS += -nostdinc # warn about C99 declaration after statement KBUILD_CFLAGS += -Wdeclaration-after-statementarch/arm64/lib/Makefile +2
-0@@ -9,6 +9,8 @@ ifeq ($(CONFIG_KERNEL_MODE_NEON), y) obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o CFLAGS_REMOVE_xor-neon.o += -mgeneral-regs-only CFLAGS_xor-neon.o += -ffreestanding +# Enable <arm_neon.h> +CFLAGS_xor-neon.o += -isystem $(shell $(CC) -print-file-name=include) endif lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.oarch/nds32/Makefile +2
-0@@ -9,6 +9,8 @@ endif # Avoid generating FPU instructions arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft +# Enable <nds32_intrinsic.h> +KBUILD_CFLAGS += -isystem $(shell $(CC) -print-file-name=include) KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog) KBUILD_CFLAGS += -mcmodel=largearch/powerpc/lib/Makefile +2
-0@@ -65,5 +65,7 @@ obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o obj-$(CONFIG_ALTIVEC) += xor_vmx.o xor_vmx_glue.o CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec) +# Enable <altivec.h> +CFLAGS_xor_vmx.o += -isystem $(shell $(CC) -print-file-name=include) obj-$(CONFIG_PPC64) += $(obj64-y)crypto/Makefile +2
-0@@ -117,6 +117,8 @@ aegis128-cflags-$(CONFIG_CC_IS_GCC) += -ffixed-q16 -ffixed-q17 -ffixed-q18 \ -ffixed-q28 -ffixed-q29 -ffixed-q30 \ -ffixed-q31 CFLAGS_aegis128-neon-inner.o += $(aegis128-cflags-y) +# Enable <arm_neon.h> +CFLAGS_aegis128-neon-inner.o += -isystem $(shell $(CC) -print-file-name=include) CFLAGS_REMOVE_aegis128-neon-inner.o += -mgeneral-regs-only aegis128-$(CONFIG_CRYPTO_AEGIS128_SIMD) += aegis128-neon.o aegis128-neon-inner.o endiflib/raid6/Makefile +4
-0@@ -14,6 +14,8 @@ hostprogs += mktables ifeq ($(CONFIG_ALTIVEC),y) altivec_flags := -maltivec $(call cc-option,-mabi=altivec) +# Enable <altivec.h> +altivec_flags += -isystem $(shell $(CC) -print-file-name=include) ifdef CONFIG_CC_IS_CLANG # clang ppc port does not yet support -maltivec when -msoft-float is@@ -34,6 +36,8 @@ endif # ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel) ifeq ($(CONFIG_KERNEL_MODE_NEON),y) NEON_FLAGS := -ffreestanding +# Enable <arm_neon.h> +NEON_FLAGS += -isystem $(shell $(CC) -print-file-name=include) ifeq ($(ARCH),arm) NEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon endifSignature · 1 line
2.31.1
Re: [PATCH 3/3] isystem: delete global -isystem compile option
Quoted 13 lines · Nathan Chancellor
Quoted 12 lines · Alexey Dobriyan
In theory, it enables "leakage" of userspace headers into kernel which may present licensing problem.
In practice, only
stdarg.hwas used,stdbool.his trivial and SIMD intrinsics are contained to a few architectures and aren't global problem.In general, kernel is very self contained code and -isystem removal will further isolate it from Ring Threeland influence.
nds32 keeps -isystem globally due to intrisics used in entrenched header.
Quoted 8 lines
Quoted 3 lines
-isystem is selectively reenabled for some files.
Not compile tested on hexagon.
With this series on top of v5.14-rc4 and a tangential patch to fix another issue, ARCH=hexagon defconfig and allmodconfig show no issues.
Oh wow, small miracle. Thank you!
Where can I find a cross-compiler? This link doesn't seem to have one
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/11.1.0/
Nathan Chancellor
maintainerRe: [PATCH 3/3] isystem: delete global -isystem compile option
Quoted 21 lines · Alexey Dobriyan
Quoted 20 lines · Nathan Chancellor
Quoted 7 lines · Alexey Dobriyan
In theory, it enables "leakage" of userspace headers into kernel which may present licensing problem.
In practice, only
stdarg.hwas used,stdbool.his trivial and SIMD intrinsics are contained to a few architectures and aren't global problem.Quoted 8 lines
In general, kernel is very self contained code and -isystem removal will further isolate it from Ring Threeland influence.
nds32 keeps -isystem globally due to intrisics used in entrenched header.
-isystem is selectively reenabled for some files.
Not compile tested on hexagon.
With this series on top of v5.14-rc4 and a tangential patch to fix another issue, ARCH=hexagon defconfig and allmodconfig show no issues.
Quoted 6 lines
Quoted 1 line
Oh wow, small miracle. Thank you!
Where can I find a cross-compiler? This link doesn't seem to have one
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/11.1.0/
Hexagon only builds with LLVM now because of the bump to require gcc 4.9: https://lore.kernel.org/r/[email protected]/
Brian Cain has a link in that thread to an LLVM toolchain that works well for defconfig (allmodconfig requires LLVM 13/14 from git). Otherwise, https://apt.llvm.org or LLVM from your package manager should be sufficient for the same targets.
$ make -skj"$(nproc)" ARCH=hexagon CROSS_COMPILE=hexagon-linux-musl- LLVM=1 LLVM_IAS=1 defconfig all
should work fine as long as the bin folder for whatever toolchain you download is in your PATH.
Cheers,
Nathan
kernel test robot
build botThank you for the patch! Yet something to improve:
Hi Alexey,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on linuxtv-media/master linus/master v5.14-rc3 next-20210730] [cannot apply to uml/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Alexey-Dobriyan/isystem-trim-fixup-stdarg-h-and-other-headers/20210802-041553 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: arm-allyesconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/f3863b25ccfb7c85602695bb13517c7f4e75cd23
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexey-Dobriyan/isystem-trim-fixup-stdarg-h-and-other-headers/20210802-041553 git checkout f3863b25ccfb7c85602695bb13517c7f4e75cd23
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Note: the linux-review/Alexey-Dobriyan/isystem-trim-fixup-stdarg-h-and-other-headers/20210802-041553 HEAD 68fed7fc2569ffbc882f0a36ecb4095d953de63c builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
In file included from crypto/aegis128-neon-inner.c:18:
>> include/linux/types.h:37:24: error: conflicting types for 'uintptr_t'
37 | typedef unsigned long uintptr_t;
| ^~~~~~~~~
In file included from /opt/cross/gcc-10.3.0-nolibc/arm-linux-gnueabi/lib/gcc/arm-linux-gnueabi/10.3.0/include/stdint.h:11,
from /opt/cross/gcc-10.3.0-nolibc/arm-linux-gnueabi/lib/gcc/arm-linux-gnueabi/10.3.0/include/arm_fp16.h:34,
from /opt/cross/gcc-10.3.0-nolibc/arm-linux-gnueabi/lib/gcc/arm-linux-gnueabi/10.3.0/include/arm_neon.h:41,
from crypto/aegis128-neon-inner.c:11:
/opt/cross/gcc-10.3.0-nolibc/arm-linux-gnueabi/lib/gcc/arm-linux-gnueabi/10.3.0/include/stdint-gcc.h:86:26: note: previous declaration of 'uintptr_t' was here
86 | typedef __UINTPTR_TYPE__ uintptr_t;
| ^~~~~~~~~ crypto/aegis128-neon-inner.c:134:6: warning: no previous prototype for 'crypto_aegis128_init_neon' [-Wmissing-prototypes]
134 | void crypto_aegis128_init_neon(void *state, const void *key, const void *iv)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
crypto/aegis128-neon-inner.c:164:6: warning: no previous prototype for 'crypto_aegis128_update_neon' [-Wmissing-prototypes]
164 | void crypto_aegis128_update_neon(void *state, const void *msg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/aegis128-neon-inner.c:221:6: warning: no previous prototype for 'crypto_aegis128_encrypt_chunk_neon' [-Wmissing-prototypes]
221 | void crypto_aegis128_encrypt_chunk_neon(void *state, void *dst, const void *src,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/aegis128-neon-inner.c:270:6: warning: no previous prototype for 'crypto_aegis128_decrypt_chunk_neon' [-Wmissing-prototypes]
270 | void crypto_aegis128_decrypt_chunk_neon(void *state, void *dst, const void *src,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/aegis128-neon-inner.c:316:5: warning: no previous prototype for 'crypto_aegis128_final_neon' [-Wmissing-prototypes]
316 | int crypto_aegis128_final_neon(void *state, void *tag_xor,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/uintptr_t +37 include/linux/types.h
^1da177e4c3f41 Linus Torvalds 2005-04-16 36142956af525002 Al Viro 2007-10-29 @37 typedef unsigned long uintptr_t;142956af525002 Al Viro 2007-10-29 38
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org