Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'kbuild-fixes-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

- remove unneeded ar-option and KBUILD_ARFLAGS

- remove long-deprecated SUBDIRS

- fix modpost to suppress false-positive warnings for UML builds

- fix namespace.pl to handle relative paths to ${objtree}, ${srctree}

- make setlocalversion work for /bin/sh

- make header archive reproducible

- fix some Makefiles and documents

* tag 'kbuild-fixes-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kheaders: make headers archive reproducible
kbuild: update compile-test header list for v5.4-rc2
kbuild: two minor updates for Documentation/kbuild/modules.rst
scripts/setlocalversion: clear local variable to make it work for sh
namespace: fix namespace.pl script to support relative paths
video/logo: do not generate unneeded logo C files
video/logo: remove unneeded *.o pattern from clean-files
integrity: remove pointless subdir-$(CONFIG_...)
integrity: remove unneeded, broken attempt to add -fshort-wchar
modpost: fix static EXPORT_SYMBOL warnings for UML build
kbuild: correct formatting of header in kbuild module docs
kbuild: remove SUBDIRS support
kbuild: remove ar-option and KBUILD_ARFLAGS

+41 -86
-5
Documentation/kbuild/makefiles.rst
··· 954 954 955 955 From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). 956 956 957 - KBUILD_ARFLAGS Options for $(AR) when creating archives 958 - 959 - $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic 960 - mode) if this option is supported by $(AR). 961 - 962 957 KBUILD_LDS 963 958 964 959 The linker script with full path. Assigned by the top-level Makefile.
+4 -3
Documentation/kbuild/modules.rst
··· 498 498 will be written containing all exported symbols that were not 499 499 defined in the kernel. 500 500 501 - --- 6.3 Symbols From Another External Module 501 + 6.3 Symbols From Another External Module 502 + ---------------------------------------- 502 503 503 504 Sometimes, an external module uses exported symbols from 504 - another external module. kbuild needs to have full knowledge of 505 + another external module. Kbuild needs to have full knowledge of 505 506 all symbols to avoid spitting out warnings about undefined 506 507 symbols. Three solutions exist for this situation. 507 508 ··· 522 521 The top-level kbuild file would then look like:: 523 522 524 523 #./Kbuild (or ./Makefile): 525 - obj-y := foo/ bar/ 524 + obj-m := foo/ bar/ 526 525 527 526 And executing:: 528 527
+9 -4
Documentation/kbuild/reproducible-builds.rst
··· 16 16 Timestamps 17 17 ---------- 18 18 19 - The kernel embeds a timestamp in two places: 19 + The kernel embeds timestamps in three places: 20 20 21 21 * The version string exposed by ``uname()`` and included in 22 22 ``/proc/version`` 23 23 24 24 * File timestamps in the embedded initramfs 25 25 26 - By default the timestamp is the current time. This must be overridden 27 - using the `KBUILD_BUILD_TIMESTAMP`_ variable. If you are building 28 - from a git commit, you could use its commit date. 26 + * If enabled via ``CONFIG_IKHEADERS``, file timestamps of kernel 27 + headers embedded in the kernel or respective module, 28 + exposed via ``/sys/kernel/kheaders.tar.xz`` 29 + 30 + By default the timestamp is the current time and in the case of 31 + ``kheaders`` the various files' modification times. This must 32 + be overridden using the `KBUILD_BUILD_TIMESTAMP`_ variable. 33 + If you are building from a git commit, you could use its commit date. 29 34 30 35 The kernel does *not* use the ``__DATE__`` and ``__TIME__`` macros, 31 36 and enables warnings if they are used. If you incorporate external
+2 -22
Makefile
··· 206 206 KBUILD_CHECKSRC = 0 207 207 endif 208 208 209 - # Use make M=dir to specify directory of external module to build 210 - # Old syntax make ... SUBDIRS=$PWD is still supported 211 - # Setting the environment variable KBUILD_EXTMOD take precedence 212 - ifdef SUBDIRS 213 - $(warning ================= WARNING ================) 214 - $(warning 'SUBDIRS' will be removed after Linux 5.3) 215 - $(warning ) 216 - $(warning If you are building an individual subdirectory) 217 - $(warning in the kernel tree, you can do like this:) 218 - $(warning $$ make path/to/dir/you/want/to/build/) 219 - $(warning (Do not forget the trailing slash)) 220 - $(warning ) 221 - $(warning If you are building an external module,) 222 - $(warning Please use 'M=' or 'KBUILD_EXTMOD' instead) 223 - $(warning ==========================================) 224 - KBUILD_EXTMOD ?= $(SUBDIRS) 225 - endif 226 - 209 + # Use make M=dir or set the environment variable KBUILD_EXTMOD to specify the 210 + # directory of external module to build. Setting M= takes precedence. 227 211 ifeq ("$(origin M)", "command line") 228 212 KBUILD_EXTMOD := $(M) 229 213 endif ··· 482 498 export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE 483 499 export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE 484 500 export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL 485 - export KBUILD_ARFLAGS 486 501 487 502 # Files to ignore in find ... statements 488 503 ··· 896 913 ifdef CONFIG_RETPOLINE 897 914 KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) 898 915 endif 899 - 900 - # use the deterministic mode of AR if available 901 - KBUILD_ARFLAGS := $(call ar-option,D) 902 916 903 917 include scripts/Makefile.kasan 904 918 include scripts/Makefile.extrawarn
+1 -1
arch/powerpc/boot/Makefile
··· 50 50 51 51 BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc 52 52 53 - BOOTARFLAGS := -cr$(KBUILD_ARFLAGS) 53 + BOOTARFLAGS := -crD 54 54 55 55 ifdef CONFIG_CC_IS_CLANG 56 56 BOOTCFLAGS += $(CLANG_FLAGS)
+2 -19
drivers/video/logo/Makefile
··· 18 18 19 19 # How to generate logo's 20 20 21 - # Use logo-cfiles to retrieve list of .c files to be built 22 - logo-cfiles = $(notdir $(patsubst %.$(2), %.c, \ 23 - $(wildcard $(srctree)/$(src)/*$(1).$(2)))) 24 - 25 - 26 - # Mono logos 27 - extra-y += $(call logo-cfiles,_mono,pbm) 28 - 29 - # VGA16 logos 30 - extra-y += $(call logo-cfiles,_vga16,ppm) 31 - 32 - # 224 Logos 33 - extra-y += $(call logo-cfiles,_clut224,ppm) 34 - 35 - # Gray 256 36 - extra-y += $(call logo-cfiles,_gray256,pgm) 37 - 38 21 pnmtologo := scripts/pnmtologo 39 22 40 23 # Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..." ··· 38 55 $(obj)/%_gray256.c: $(src)/%_gray256.pgm $(pnmtologo) FORCE 39 56 $(call if_changed,logo) 40 57 41 - # Files generated that shall be removed upon make clean 42 - clean-files := *.o *_mono.c *_vga16.c *_clut224.c *_gray256.c 58 + # generated C files 59 + targets += *_mono.c *_vga16.c *_clut224.c *_gray256.c
+4 -1
kernel/gen_kheaders.sh
··· 71 71 find $cpio_dir -type f -print0 | 72 72 xargs -0 -P8 -n1 perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\///smg;' 73 73 74 - tar -Jcf $tarfile -C $cpio_dir/ . > /dev/null 74 + # Create archive and try to normalize metadata for reproducibility 75 + tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \ 76 + --owner=0 --group=0 --sort=name --numeric-owner \ 77 + -Jcf $tarfile -C $cpio_dir/ . > /dev/null 75 78 76 79 echo "$src_files_md5" > kernel/kheaders.md5 77 80 echo "$obj_files_md5" >> kernel/kheaders.md5
-5
scripts/Kbuild.include
··· 143 143 # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) 144 144 ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) 145 145 146 - # ar-option 147 - # Usage: KBUILD_ARFLAGS := $(call ar-option,D) 148 - # Important: no spaces around options 149 - ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2)) 150 - 151 146 # ld-version 152 147 # Note this is mainly for HJ Lu's 3 number binutil versions 153 148 ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
+1 -1
scripts/Makefile.build
··· 389 389 ifdef builtin-target 390 390 391 391 quiet_cmd_ar_builtin = AR $@ 392 - cmd_ar_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) 392 + cmd_ar_builtin = rm -f $@; $(AR) cDPrST $@ $(real-prereqs) 393 393 394 394 $(builtin-target): $(real-obj-y) FORCE 395 395 $(call if_changed,ar_builtin)
+1 -1
scripts/Makefile.lib
··· 232 232 # --------------------------------------------------------------------------- 233 233 234 234 quiet_cmd_ar = AR $@ 235 - cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) 235 + cmd_ar = rm -f $@; $(AR) cDPrsT $@ $(real-prereqs) 236 236 237 237 # Objcopy 238 238 # ---------------------------------------------------------------------------
+9 -4
scripts/mod/modpost.c
··· 2652 2652 fatal("modpost: Section mismatches detected.\n" 2653 2653 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); 2654 2654 for (n = 0; n < SYMBOL_HASH_SIZE; n++) { 2655 - struct symbol *s = symbolhash[n]; 2655 + struct symbol *s; 2656 2656 2657 - while (s) { 2657 + for (s = symbolhash[n]; s; s = s->next) { 2658 + /* 2659 + * Do not check "vmlinux". This avoids the same warnings 2660 + * shown twice, and false-positives for ARCH=um. 2661 + */ 2662 + if (is_vmlinux(s->module->name) && !s->module->is_dot_o) 2663 + continue; 2664 + 2658 2665 if (s->is_static) 2659 2666 warn("\"%s\" [%s] is a static %s\n", 2660 2667 s->name, s->module->name, 2661 2668 export_str(s->export)); 2662 - 2663 - s = s->next; 2664 2669 } 2665 2670 } 2666 2671
+7 -6
scripts/namespace.pl
··· 65 65 use warnings; 66 66 use strict; 67 67 use File::Find; 68 + use File::Spec; 68 69 69 70 my $nm = ($ENV{'NM'} || "nm") . " -p"; 70 71 my $objdump = ($ENV{'OBJDUMP'} || "objdump") . " -s -j .comment"; 71 - my $srctree = ""; 72 - my $objtree = ""; 73 - $srctree = "$ENV{'srctree'}/" if (exists($ENV{'srctree'})); 74 - $objtree = "$ENV{'objtree'}/" if (exists($ENV{'objtree'})); 72 + my $srctree = File::Spec->curdir(); 73 + my $objtree = File::Spec->curdir(); 74 + $srctree = File::Spec->rel2abs($ENV{'srctree'}) if (exists($ENV{'srctree'})); 75 + $objtree = File::Spec->rel2abs($ENV{'objtree'}) if (exists($ENV{'objtree'})); 75 76 76 77 if ($#ARGV != -1) { 77 78 print STDERR "usage: $0 takes no parameters\n"; ··· 232 231 } 233 232 ($source = $basename) =~ s/\.o$//; 234 233 if (-e "$source.c" || -e "$source.S") { 235 - $source = "$objtree$File::Find::dir/$source"; 234 + $source = File::Spec->catfile($objtree, $File::Find::dir, $source) 236 235 } else { 237 - $source = "$srctree$File::Find::dir/$source"; 236 + $source = File::Spec->catfile($srctree, $File::Find::dir, $source) 238 237 } 239 238 if (! -e "$source.c" && ! -e "$source.S") { 240 239 # No obvious source, exclude the object if it is conglomerate
+1 -1
scripts/setlocalversion
··· 126 126 127 127 collect_files() 128 128 { 129 - local file res 129 + local file res= 130 130 131 131 for file; do 132 132 case "$file" in
-3
security/integrity/Makefile
··· 13 13 integrity-$(CONFIG_LOAD_UEFI_KEYS) += platform_certs/efi_parser.o \ 14 14 platform_certs/load_uefi.o 15 15 integrity-$(CONFIG_LOAD_IPL_KEYS) += platform_certs/load_ipl_s390.o 16 - $(obj)/load_uefi.o: KBUILD_CFLAGS += -fshort-wchar 17 16 18 - subdir-$(CONFIG_IMA) += ima 19 17 obj-$(CONFIG_IMA) += ima/ 20 - subdir-$(CONFIG_EVM) += evm 21 18 obj-$(CONFIG_EVM) += evm/
-10
usr/include/Makefile
··· 29 29 header-test-$(CONFIG_CPU_BIG_ENDIAN) += linux/byteorder/big_endian.h 30 30 header-test-$(CONFIG_CPU_LITTLE_ENDIAN) += linux/byteorder/little_endian.h 31 31 header-test- += linux/coda.h 32 - header-test- += linux/coda_psdev.h 33 32 header-test- += linux/elfcore.h 34 33 header-test- += linux/errqueue.h 35 34 header-test- += linux/fsmap.h 36 35 header-test- += linux/hdlc/ioctl.h 37 36 header-test- += linux/ivtv.h 38 - header-test- += linux/jffs2.h 39 37 header-test- += linux/kexec.h 40 38 header-test- += linux/matroxfb.h 41 39 header-test- += linux/netfilter_ipv4/ipt_LOG.h ··· 53 55 header-test- += linux/v4l2-subdev.h 54 56 header-test- += linux/videodev2.h 55 57 header-test- += linux/vm_sockets.h 56 - header-test- += scsi/scsi_bsg_fc.h 57 - header-test- += scsi/scsi_netlink.h 58 - header-test- += scsi/scsi_netlink_fc.h 59 58 header-test- += sound/asequencer.h 60 59 header-test- += sound/asoc.h 61 60 header-test- += sound/asound.h 62 61 header-test- += sound/compress_offload.h 63 62 header-test- += sound/emu10k1.h 64 63 header-test- += sound/sfnt_info.h 65 - header-test- += sound/sof/eq.h 66 - header-test- += sound/sof/fw.h 67 - header-test- += sound/sof/header.h 68 - header-test- += sound/sof/manifest.h 69 - header-test- += sound/sof/trace.h 70 64 header-test- += xen/evtchn.h 71 65 header-test- += xen/gntdev.h 72 66 header-test- += xen/privcmd.h