Skip to content

Sync with v5.15-rc3#500

Merged
ojeda merged 10000 commits intoRust-for-Linux:rustfrom
ojeda:sync
Oct 1, 2021
Merged

Sync with v5.15-rc3#500
ojeda merged 10000 commits intoRust-for-Linux:rustfrom
ojeda:sync

Conversation

@ojeda
Copy link
Copy Markdown
Member

@ojeda ojeda commented Sep 28, 2021

Conflicts & required changes:

  • Refactor tentative flags due to the move of the Clang bits.
  • printk to _printk due to the added indexing support.
  • Adding LLVM_IAS=0 for PowerPC due to the change in default.
Diff of diffs
--- old.diff	2021-09-28 20:32:19.167610832 +0200
+++ new.diff	2021-09-28 20:32:05.171613955 +0200
@@ -1269,10 +1269,10 @@
 +# CONFIG_FEATURE_KMSG_SYSLOG is not set
 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
 new file mode 100644
-index 00000000000..da2087f91db
+index 00000000000..427ffaedc3c
 --- /dev/null
 +++ b/.github/workflows/ci.yaml
-@@ -0,0 +1,408 @@
+@@ -0,0 +1,409 @@
 +on:
 +  pull_request: {}
 +  push:
@@ -1368,6 +1368,7 @@
 +        run: |
 +          echo 'MAKE_ARCH=ARCH=powerpc' >> $GITHUB_ENV
 +          echo 'MAKE_CROSS_COMPILE=CROSS_COMPILE=powerpc64le-linux-gnu-' >> $GITHUB_ENV
++          echo 'MAKE_LLVM_IAS=LLVM_IAS=0' >> $GITHUB_ENV
 +          echo 'IMAGE_PATH=vmlinux' >> $GITHUB_ENV
 +          echo 'QEMU_ARCH=ppc64' >> $GITHUB_ENV
 +          echo 'QEMU_MACHINE=pseries' >> $GITHUB_ENV
@@ -1525,7 +1526,7 @@
 +          mv .config ${{ env.BUILD_DIR }}.config
 +          sed -i 's:samples/rust/:${{ env.BUILD_DIR }}samples/rust/:' .github/workflows/qemu-initramfs.desc
 +
-+      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3
++      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3
 +
 +      # Run
 +      - run: ${{ env.BUILD_DIR }}usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
@@ -1668,16 +1669,16 @@
 +            ${{ env.BUILD_DIR }}vmlinux
 +
 +      # Clippy
-+      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 CLIPPY=1
++      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 CLIPPY=1
 +
 +      # Docs
-+      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 rustdoc
++      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 rustdoc
 +
 +      # Tests
-+      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 rusttest
++      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 rusttest
 +
 +      # Formatting
-+      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 rustfmtcheck
++      - run: make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 rustfmtcheck
 +
 +      # View changes to ccache
 +      - run: ccache -s
@@ -17030,7 +17031,7 @@
  --------------
  Additional options used for $(LD) when linking modules.
 diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst
-index d3a8557b66a..7c38b9d2aec 100644
+index e35ab74a0f8..a9426c055ae 100644
 --- a/Documentation/process/changes.rst
 +++ b/Documentation/process/changes.rst
 @@ -26,11 +26,18 @@ running a Linux kernel.  Also, not all tools are necessary on all
@@ -17045,7 +17046,7 @@
  ====================== ===============  ========================================
          Program        Minimal version       Command to check the version
  ====================== ===============  ========================================
- GNU C                  4.9              gcc --version
+ GNU C                  5.1              gcc --version
  Clang/LLVM (optional)  10.0.1           clang --version
 +rustc (optional)       1.55.0           rustc --version
 +bindgen (optional)     0.56.0           bindgen --version
@@ -17583,10 +17584,10 @@
 +    the ``-Zsymbol-mangling-version=v0`` flag. However, we don't maintain
 +    support for that, so avoid it unless you are in a hurry.
 diff --git a/MAINTAINERS b/MAINTAINERS
-index 19135a9d778..726e8b9dfe2 100644
+index 5b33791bb8e..05f33198df0 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -16109,6 +16109,20 @@ L:	linux-rdma@vger.kernel.org
+@@ -16272,6 +16272,20 @@ L:	linux-rdma@vger.kernel.org
  S:	Maintained
  F:	drivers/infiniband/ulp/rtrs/
  
@@ -17608,7 +17609,7 @@
  M:	David Howells <dhowells@redhat.com>
  M:	Marc Dionne <marc.dionne@auristor.com>
 diff --git a/Makefile b/Makefile
-index 6b555f64df0..b56269fa95e 100644
+index 437ccc66a1c..35e9d1e5b94 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -120,6 +120,13 @@ endif
@@ -17625,7 +17626,7 @@
  # Use make M=dir or set the environment variable KBUILD_EXTMOD to specify the
  # directory of external module to build. Setting M= takes precedence.
  ifeq ("$(origin M)", "command line")
-@@ -268,7 +275,7 @@ no-dot-config-targets := $(clean-targets) \
+@@ -267,7 +274,7 @@ no-dot-config-targets := $(clean-targets) \
  			 cscope gtags TAGS tags help% %docs check% coccicheck \
  			 $(version_h) headers headers_% archheaders archscripts \
  			 %asm-generic kernelversion %src-pkg dt_binding_check \
@@ -17634,7 +17635,7 @@
  # Installation targets should not require compiler. Unfortunately, vdso_install
  # is an exception where build artifacts may be updated. This must be fixed.
  no-compiler-targets := $(no-dot-config-targets) install dtbs_install \
-@@ -457,6 +464,12 @@ OBJDUMP		= $(CROSS_COMPILE)objdump
+@@ -461,6 +468,12 @@ OBJDUMP		= $(CROSS_COMPILE)objdump
  READELF		= $(CROSS_COMPILE)readelf
  STRIP		= $(CROSS_COMPILE)strip
  endif
@@ -17647,7 +17648,7 @@
  PAHOLE		= pahole
  RESOLVE_BTFIDS	= $(objtree)/tools/bpf/resolve_btfids/resolve_btfids
  LEX		= flex
-@@ -480,9 +493,11 @@ CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
+@@ -484,9 +497,11 @@ CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
  		  -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
  NOSTDINC_FLAGS :=
  CFLAGS_MODULE   =
@@ -17659,7 +17660,7 @@
  AFLAGS_KERNEL	=
  LDFLAGS_vmlinux =
  
-@@ -511,15 +526,41 @@ KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
+@@ -515,15 +530,41 @@ KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
  		   -Werror=return-type -Wno-format-security \
  		   -std=gnu89
  KBUILD_CPPFLAGS := -D__KERNEL__
@@ -17701,7 +17702,7 @@
  export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
  export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
  export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
-@@ -527,9 +568,10 @@ export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
+@@ -531,9 +572,10 @@ export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
  
  export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
  export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
@@ -17714,37 +17715,17 @@
  
  # Files to ignore in find ... statements
  
-@@ -585,18 +627,23 @@ endif
+@@ -588,9 +630,7 @@ endif
  # and from include/config/auto.conf.cmd to detect the compiler upgrade.
- CC_VERSION_TEXT = $(subst $(pound),,$(shell $(CC) --version 2>/dev/null | head -n 1))
+ CC_VERSION_TEXT = $(subst $(pound),,$(shell LC_ALL=C $(CC) --version 2>/dev/null | head -n 1))
  
 -ifneq ($(findstring clang,$(CC_VERSION_TEXT)),)
-+TENTATIVE_CLANG_FLAGS := -Werror=unknown-warning-option
-+
- ifneq ($(CROSS_COMPILE),)
--CLANG_FLAGS	+= --target=$(notdir $(CROSS_COMPILE:%-=%))
-+TENTATIVE_CLANG_FLAGS	+= --target=$(notdir $(CROSS_COMPILE:%-=%))
- endif
- ifeq ($(LLVM_IAS),1)
--CLANG_FLAGS	+= -integrated-as
-+TENTATIVE_CLANG_FLAGS	+= -integrated-as
- else
--CLANG_FLAGS	+= -no-integrated-as
-+TENTATIVE_CLANG_FLAGS	+= -no-integrated-as
- GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
--CLANG_FLAGS	+= --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
-+TENTATIVE_CLANG_FLAGS	+= --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
- endif
--CLANG_FLAGS	+= -Werror=unknown-warning-option
-+
-+export TENTATIVE_CLANG_FLAGS
-+
-+ifneq ($(findstring clang,$(CC_VERSION_TEXT)),)
-+CLANG_FLAGS	+= $(TENTATIVE_CLANG_FLAGS)
- KBUILD_CFLAGS	+= $(CLANG_FLAGS)
- KBUILD_AFLAGS	+= $(CLANG_FLAGS)
- export CLANG_FLAGS
-@@ -731,7 +778,7 @@ $(KCONFIG_CONFIG):
+ include $(srctree)/scripts/Makefile.clang
+-endif
+ 
+ # Include this also for config targets because some architectures need
+ # cc-cross-prefix to determine CROSS_COMPILE.
+@@ -724,7 +764,7 @@ $(KCONFIG_CONFIG):
  #
  # Do not use $(call cmd,...) here. That would suppress prompts from syncconfig,
  # so you cannot notice that Kconfig is waiting for the user input.
@@ -17753,7 +17734,7 @@
  	$(Q)$(kecho) "  SYNC    $@"
  	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
  else # !may-sync-config
-@@ -758,12 +805,43 @@ KBUILD_CFLAGS	+= $(call cc-disable-warning, format-truncation)
+@@ -751,12 +791,43 @@ KBUILD_CFLAGS	+= $(call cc-disable-warning, format-truncation)
  KBUILD_CFLAGS	+= $(call cc-disable-warning, format-overflow)
  KBUILD_CFLAGS	+= $(call cc-disable-warning, address-of-packed-member)
  
@@ -17797,26 +17778,25 @@
  endif
  
  # Tell gcc to never replace conditional load with a non-conditional one
-@@ -813,6 +891,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
- KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
+@@ -813,6 +884,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
+ 
  ifdef CONFIG_FRAME_POINTER
  KBUILD_CFLAGS	+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
 +KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y
  else
  # Some targets (ARM with Thumb2, for example), can't be built with frame
  # pointers.  For those, we don't have FUNCTION_TRACER automatically
-@@ -850,6 +929,8 @@ ifdef CONFIG_CC_IS_GCC
- DEBUG_CFLAGS	+= $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments))
+@@ -848,6 +920,7 @@ KBUILD_CFLAGS	+= -fzero-call-used-regs=used-gpr
  endif
  
-+DEBUG_RUSTFLAGS :=
-+
+ DEBUG_CFLAGS	:=
++DEBUG_RUSTFLAGS	:=
+ 
  ifdef CONFIG_DEBUG_INFO
  
- ifdef CONFIG_DEBUG_INFO_SPLIT
-@@ -860,6 +941,11 @@ endif
+@@ -859,6 +932,11 @@ endif
  
- ifneq ($(LLVM_IAS),1)
+ ifndef CONFIG_AS_IS_LLVM
  KBUILD_AFLAGS	+= -Wa,-gdwarf-2
 +ifdef CONFIG_DEBUG_INFO_REDUCED
 +DEBUG_RUSTFLAGS += -Cdebuginfo=1
@@ -17826,7 +17806,7 @@
  endif
  
  ifndef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
-@@ -884,6 +970,9 @@ endif # CONFIG_DEBUG_INFO
+@@ -885,6 +963,9 @@ endif # CONFIG_DEBUG_INFO
  KBUILD_CFLAGS += $(DEBUG_CFLAGS)
  export DEBUG_CFLAGS
  
@@ -17836,7 +17816,7 @@
  ifdef CONFIG_FUNCTION_TRACER
  ifdef CONFIG_FTRACE_MCOUNT_USE_CC
    CC_FLAGS_FTRACE	+= -mrecord-mcount
-@@ -1039,10 +1128,11 @@ include $(addprefix $(srctree)/, $(include-y))
+@@ -1045,10 +1126,11 @@ include $(addprefix $(srctree)/, $(include-y))
  # Do not add $(call cc-option,...) below this line. When you build the kernel
  # from the clean source tree, the GCC plugins do not exist at this point.
  
@@ -17849,7 +17829,7 @@
  
  KBUILD_LDFLAGS_MODULE += --build-id=sha1
  LDFLAGS_vmlinux += --build-id=sha1
-@@ -1111,6 +1201,10 @@ export MODULES_NSDEPS := $(extmod_prefix)modules.nsdeps
+@@ -1117,6 +1199,10 @@ export MODULES_NSDEPS := $(extmod_prefix)modules.nsdeps
  ifeq ($(KBUILD_EXTMOD),)
  core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
  
@@ -17860,7 +17840,7 @@
  vmlinux-dirs	:= $(patsubst %/,%,$(filter %/, \
  		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
  		     $(libs-y) $(libs-m)))
-@@ -1211,6 +1305,9 @@ archprepare: outputmakefile archheaders archscripts scripts include/config/kerne
+@@ -1217,6 +1303,9 @@ archprepare: outputmakefile archheaders archscripts scripts include/config/kerne
  prepare0: archprepare
  	$(Q)$(MAKE) $(build)=scripts/mod
  	$(Q)$(MAKE) $(build)=.
@@ -17870,7 +17850,7 @@
  
  # All the preparing..
  prepare: prepare0
-@@ -1501,7 +1598,7 @@ endif # CONFIG_MODULES
+@@ -1517,7 +1606,7 @@ endif # CONFIG_MODULES
  # Directories & files removed with 'make clean'
  CLEAN_FILES += include/ksym vmlinux.symvers modules-only.symvers \
  	       modules.builtin modules.builtin.modinfo modules.nsdeps \
@@ -17879,7 +17859,7 @@
  
  # Directories & files removed with 'make mrproper'
  MRPROPER_FILES += include/config include/generated          \
-@@ -1512,7 +1609,8 @@ MRPROPER_FILES += include/config include/generated          \
+@@ -1528,7 +1617,8 @@ MRPROPER_FILES += include/config include/generated          \
  		  certs/signing_key.pem certs/signing_key.x509 \
  		  certs/x509.genkey \
  		  vmlinux-gdb.py \
@@ -17889,7 +17869,7 @@
  
  # clean - Delete most, but leave enough to build external modules
  #
-@@ -1624,6 +1722,17 @@ help:
+@@ -1640,6 +1730,17 @@ help:
  	@echo  '  kselftest-merge   - Merge all the config dependencies of'
  	@echo  '		      kselftest to existing .config.'
  	@echo  ''
@@ -17907,7 +17887,7 @@
  	@$(if $(dtstree), \
  		echo 'Devicetree:'; \
  		echo '* dtbs             - Build device tree blobs for enabled boards'; \
-@@ -1695,6 +1804,47 @@ PHONY += $(DOC_TARGETS)
+@@ -1711,6 +1812,47 @@ PHONY += $(DOC_TARGETS)
  $(DOC_TARGETS):
  	$(Q)$(MAKE) $(build)=Documentation $@
  
@@ -17955,7 +17935,7 @@
  # Misc
  # ---------------------------------------------------------------------------
  
-@@ -1852,6 +2002,7 @@ clean: $(clean-dirs)
+@@ -1878,6 +2020,7 @@ clean: $(clean-dirs)
  	$(call cmd,rmfiles)
  	@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
  		\( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
@@ -18295,7 +18275,7 @@
 +  "target-pointer-width": "64"
 +}
 diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
-index bc74afdbf31..d87a6ace9bb 100644
+index 0eb4568fbd2..7b5b3ff0e59 100644
 --- a/arch/riscv/Makefile
 +++ b/arch/riscv/Makefile
 @@ -54,6 +54,7 @@ riscv-march-$(CONFIG_FPU)		:= $(riscv-march-y)fd
@@ -21986,7 +21966,7 @@
 +    }
 +}
 diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
-index 3f166c8a409..4155643fbc8 100644
+index 239eca4d680..158c5388a5e 100644
 --- a/drivers/char/hw_random/Kconfig
 +++ b/drivers/char/hw_random/Kconfig
 @@ -98,6 +98,19 @@ config HW_RANDOM_BCM2835
@@ -22010,7 +21990,7 @@
  	tristate "Broadcom iProc/STB RNG200 support"
  	depends on ARCH_BCM_IPROC || ARCH_BCM2835 || ARCH_BRCMSTB
 diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile
-index 8933fada74f..3e14586f2b3 100644
+index a5a1c765a39..ae08f6ce8a8 100644
 --- a/drivers/char/hw_random/Makefile
 +++ b/drivers/char/hw_random/Makefile
 @@ -31,6 +31,7 @@ obj-$(CONFIG_HW_RANDOM_PSERIES) += pseries-rng.o
@@ -22125,10 +22105,10 @@
  			(KSYM_NAME_LEN - 1) + \
  			2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + \
 diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
-index 79897841a2c..a022992725b 100644
+index 45310ea1b1d..76a855b3ecd 100644
 --- a/include/linux/spinlock.h
 +++ b/include/linux/spinlock.h
-@@ -331,12 +331,17 @@ static __always_inline raw_spinlock_t *spinlock_check(spinlock_t *lock)
+@@ -340,12 +340,17 @@ static __always_inline raw_spinlock_t *spinlock_check(spinlock_t *lock)
  
  #ifdef CONFIG_DEBUG_SPINLOCK
  
@@ -22153,10 +22133,10 @@
  
  #else
 diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h
-index 20e435fe657..9fca291e013 100644
+index 3246f2c7469..ad619623571 100644
 --- a/include/uapi/linux/android/binder.h
 +++ b/include/uapi/linux/android/binder.h
-@@ -229,19 +229,21 @@ struct binder_frozen_status_info {
+@@ -236,19 +236,21 @@ struct binder_frozen_status_info {
  	__u32            async_recv;
  };
  
@@ -22192,7 +22172,7 @@
  /*
   * NOTE: Two special error codes you should check for when calling
 diff --git a/init/Kconfig b/init/Kconfig
-index 55f9f7738eb..bbeda645e2f 100644
+index 11f8a845f25..f494e405c15 100644
 --- a/init/Kconfig
 +++ b/init/Kconfig
 @@ -60,6 +60,15 @@ config LLD_VERSION
@@ -22211,7 +22191,7 @@
  config CC_CAN_LINK
  	bool
  	default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag)) if 64BIT
-@@ -2014,6 +2023,25 @@ config PROFILING
+@@ -2037,6 +2046,25 @@ config PROFILING
  	  Say Y here to enable the extended profiling support mechanisms used
  	  by profilers.
  
@@ -22278,10 +22258,10 @@
  		if (cnt != 3) {
  			pr_err("symbol %s has an incorrectly formatted name\n",
 diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
-index 142a58d124d..154abbebbbf 100644
+index a8d0a58deeb..54566b82a5d 100644
 --- a/kernel/printk/printk.c
 +++ b/kernel/printk/printk.c
-@@ -397,7 +397,10 @@ static struct latched_seq clear_seq = {
+@@ -392,7 +392,10 @@ static struct latched_seq clear_seq = {
  /* the maximum size of a formatted record (i.e. with prefix added per line) */
  #define CONSOLE_LOG_MAX		1024
  
@@ -22294,10 +22274,10 @@
  
  #define LOG_LEVEL(v)		((v) & 0x07)
 diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
-index 83121272292..b07d4979a01 100644
+index 2a9b6dcdac4..2ff6d84198d 100644
 --- a/lib/Kconfig.debug
 +++ b/lib/Kconfig.debug
-@@ -2652,6 +2652,150 @@ config HYPERV_TESTING
+@@ -2637,6 +2637,150 @@ config HYPERV_TESTING
  
  endmenu # "Kernel Testing and Coverage"
  
@@ -22449,7 +22429,7 @@
  
  endmenu # Kernel hacking
 diff --git a/lib/vsprintf.c b/lib/vsprintf.c
-index 26c83943748..dd006adfe85 100644
+index d7ad44f2c8f..67a96165e58 100644
 --- a/lib/vsprintf.c
 +++ b/lib/vsprintf.c
 @@ -2225,6 +2225,10 @@ char *fwnode_string(char *buf, char *end, struct fwnode_handle *fwnode,
@@ -46197,7 +46177,7 @@
 +pub use crate::traits::TryPin;
 diff --git a/rust/kernel/print.rs b/rust/kernel/print.rs
 new file mode 100644
-index 00000000000..902effe4099
+index 00000000000..328d893f87a
 --- /dev/null
 +++ b/rust/kernel/print.rs
 @@ -0,0 +1,441 @@
@@ -46273,12 +46253,12 @@
 +    /// The length of the fixed format strings.
 +    pub const LENGTH: usize = 10;
 +
-+    /// Generates a fixed format string for the kernel's [`printk`].
++    /// Generates a fixed format string for the kernel's [`_printk`].
 +    ///
 +    /// The format string is always the same for a given level, i.e. for a
 +    /// given `prefix`, which are the kernel's `KERN_*` constants.
 +    ///
-+    /// [`printk`]: ../../../../include/linux/printk.h
++    /// [`_printk`]: ../../../../include/linux/printk.h
 +    const fn generate(is_cont: bool, prefix: &[u8; 3]) -> [u8; LENGTH] {
 +        // Ensure the `KERN_*` macros are what we expect.
 +        assert!(prefix[0] == b'\x01');
@@ -46318,7 +46298,7 @@
 +    pub static CONT: [u8; LENGTH] = generate(true, bindings::KERN_CONT);
 +}
 +
-+/// Prints a message via the kernel's [`printk`].
++/// Prints a message via the kernel's [`_printk`].
 +///
 +/// Public but hidden since it should only be used from public macros.
 +///
@@ -46327,16 +46307,16 @@
 +/// The format string must be one of the ones in [`format_strings`], and
 +/// the module name must be null-terminated.
 +///
-+/// [`printk`]: ../../../../include/linux/printk.h
++/// [`_printk`]: ../../../../include/linux/_printk.h
 +#[doc(hidden)]
 +pub unsafe fn call_printk(
 +    format_string: &[u8; format_strings::LENGTH],
 +    module_name: &[u8],
 +    args: fmt::Arguments<'_>,
 +) {
-+    // `printk` does not seem to fail in any path.
++    // `_printk` does not seem to fail in any path.
 +    unsafe {
-+        bindings::printk(
++        bindings::_printk(
 +            format_string.as_ptr() as _,
 +            module_name.as_ptr(),
 +            &args as *const _ as *const c_void,
@@ -46344,18 +46324,18 @@
 +    }
 +}
 +
-+/// Prints a message via the kernel's [`printk`] for the `CONT` level.
++/// Prints a message via the kernel's [`_printk`] for the `CONT` level.
 +///
 +/// Public but hidden since it should only be used from public macros.
 +///
-+/// [`printk`]: ../../../../include/linux/printk.h
++/// [`_printk`]: ../../../../include/linux/printk.h
 +#[doc(hidden)]
 +pub fn call_printk_cont(args: fmt::Arguments<'_>) {
-+    // `printk` does not seem to fail in any path.
++    // `_printk` does not seem to fail in any path.
 +    //
 +    // SAFETY: The format string is fixed.
 +    unsafe {
-+        bindings::printk(
++        bindings::_printk(
 +            format_strings::CONT.as_ptr() as _,
 +            &args as *const _ as *const c_void,
 +        );
@@ -51857,7 +51837,7 @@
 +    }
 +}
 diff --git a/scripts/Makefile.build b/scripts/Makefile.build
-index 02197cb8e3a..7b0defd0c18 100644
+index 3efc984d4c6..bad29117c44 100644
 --- a/scripts/Makefile.build
 +++ b/scripts/Makefile.build
 @@ -26,6 +26,7 @@ EXTRA_CPPFLAGS :=
@@ -51868,7 +51848,7 @@
  cppflags-y :=
  ldflags-y  :=
  
-@@ -287,6 +288,27 @@ quiet_cmd_cc_lst_c = MKLST   $@
+@@ -314,6 +315,27 @@ quiet_cmd_cc_lst_c = MKLST   $@
  $(obj)/%.lst: $(src)/%.c FORCE
  	$(call if_changed_dep,cc_lst_c)
  
@@ -51896,8 +51876,57 @@
  # Compile assembler sources (.S)
  # ---------------------------------------------------------------------------
  
+diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang
+index 51fc23e2e9e..38f555d0cb0 100644
+--- a/scripts/Makefile.clang
++++ b/scripts/Makefile.clang
+@@ -12,29 +12,37 @@ CLANG_TARGET_FLAGS_s390		:= s390x-linux-gnu
+ CLANG_TARGET_FLAGS_x86		:= x86_64-linux-gnu
+ CLANG_TARGET_FLAGS		:= $(CLANG_TARGET_FLAGS_$(SRCARCH))
+ 
++TENTATIVE_CLANG_FLAGS :=
++
+ ifeq ($(CROSS_COMPILE),)
+ ifeq ($(CLANG_TARGET_FLAGS),)
+ $(error Specify CROSS_COMPILE or add '--target=' option to scripts/Makefile.clang)
+ else
+-CLANG_FLAGS	+= --target=$(CLANG_TARGET_FLAGS)
++TENTATIVE_CLANG_FLAGS	+= --target=$(CLANG_TARGET_FLAGS)
+ endif # CLANG_TARGET_FLAGS
+ else
+-CLANG_FLAGS	+= --target=$(notdir $(CROSS_COMPILE:%-=%))
++TENTATIVE_CLANG_FLAGS	+= --target=$(notdir $(CROSS_COMPILE:%-=%))
+ endif # CROSS_COMPILE
+ 
+ ifeq ($(LLVM_IAS),0)
+-CLANG_FLAGS	+= -fno-integrated-as
++TENTATIVE_CLANG_FLAGS	+= -fno-integrated-as
+ GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
+-CLANG_FLAGS	+= --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
++TENTATIVE_CLANG_FLAGS	+= --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
+ else
+-CLANG_FLAGS	+= -fintegrated-as
++TENTATIVE_CLANG_FLAGS	+= -fintegrated-as
+ endif
+ # By default, clang only warns when it encounters an unknown warning flag or
+ # certain optimization flags it knows it has not implemented.
+ # Make it behave more like gcc by erroring when these flags are encountered
+ # so they can be implemented or wrapped in cc-option.
+-CLANG_FLAGS	+= -Werror=unknown-warning-option
+-CLANG_FLAGS	+= -Werror=ignored-optimization-argument
++TENTATIVE_CLANG_FLAGS	+= -Werror=unknown-warning-option
++TENTATIVE_CLANG_FLAGS	+= -Werror=ignored-optimization-argument
++
++export TENTATIVE_CLANG_FLAGS
++
++ifneq ($(findstring clang,$(CC_VERSION_TEXT)),)
++CLANG_FLAGS	+= $(TENTATIVE_CLANG_FLAGS)
+ KBUILD_CFLAGS	+= $(CLANG_FLAGS)
+ KBUILD_AFLAGS	+= $(CLANG_FLAGS)
+ export CLANG_FLAGS
++endif
 diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
-index 10950559b22..cee5af32c65 100644
+index 54582673fc1..273b20bab77 100644
 --- a/scripts/Makefile.lib
 +++ b/scripts/Makefile.lib
 @@ -8,6 +8,7 @@ ldflags-y  += $(EXTRA_LDFLAGS)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.