Skip to content

Commit

Permalink
Merge tag 'kbuild-fixes-v6.11-2' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Eliminate the fdtoverlay command duplication in scripts/Makefile.lib

 - Fix 'make compile_commands.json' for external modules

 - Ensure scripts/kconfig/merge_config.sh handles missing newlines

 - Fix some build errors on macOS

* tag 'kbuild-fixes-v6.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: fix typos "prequisites" to "prerequisites"
  Documentation/llvm: turn make command for ccache into code block
  kbuild: avoid scripts/kallsyms parsing /dev/null
  treewide: remove unnecessary <linux/version.h> inclusion
  scripts: kconfig: merge_config: config files: add a trailing newline
  Makefile: add $(srctree) to dependency of compile_commands.json target
  kbuild: clean up code duplication in cmd_fdtoverlay
  • Loading branch information
Linus Torvalds committed Aug 22, 2024
2 parents 872cf28 + 8fb4ac1 commit 3f44ae9
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Documentation/kbuild/llvm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Ccache

``ccache`` can be used with ``clang`` to improve subsequent builds, (though
KBUILD_BUILD_TIMESTAMP_ should be set to a deterministic value between builds
in order to avoid 100% cache misses, see Reproducible_builds_ for more info):
in order to avoid 100% cache misses, see Reproducible_builds_ for more info)::

KBUILD_BUILD_TIMESTAMP='' make LLVM=1 CC="ccache clang"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,7 @@ nsdeps: modules
quiet_cmd_gen_compile_commands = GEN $@
cmd_gen_compile_commands = $(PYTHON3) $< -a $(AR) -o $@ $(filter-out $<, $(real-prereqs))

$(extmod_prefix)compile_commands.json: scripts/clang-tools/gen_compile_commands.py \
$(extmod_prefix)compile_commands.json: $(srctree)/scripts/clang-tools/gen_compile_commands.py \
$(if $(KBUILD_EXTMOD),, vmlinux.a $(KBUILD_VMLINUX_LIBS)) \
$(if $(CONFIG_MODULES), $(MODORDER)) FORCE
$(call if_changed,gen_compile_commands)
Expand Down
1 change: 0 additions & 1 deletion drivers/accessibility/speakup/genmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <stdio.h>
#include <libgen.h>
#include <string.h>
#include <linux/version.h>
#include <ctype.h>
#include "utils.h"

Expand Down
1 change: 0 additions & 1 deletion drivers/accessibility/speakup/makemapdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <stdio.h>
#include <libgen.h>
#include <string.h>
#include <linux/version.h>
#include <ctype.h>
#include "utils.h"

Expand Down
1 change: 0 additions & 1 deletion drivers/staging/media/atomisp/include/linux/atomisp.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define _ATOM_ISP_H

#include <linux/types.h>
#include <linux/version.h>

/* struct media_device_info.hw_revision */
#define ATOMISP_HW_REVISION_MASK 0x0000ff00
Expand Down
1 change: 0 additions & 1 deletion samples/trace_events/trace_custom_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#define pr_fmt(fmt) fmt

#include <linux/trace_events.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/sched.h>

Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ $(subdir-ym):
need-modorder=$(if $(filter $@/modules.order, $(subdir-modorder)),1) \
$(filter $@/%, $(single-subdir-goals))

# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# Add FORCE to the prerequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------

PHONY += FORCE
Expand Down
28 changes: 10 additions & 18 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -400,26 +400,23 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
$(call if_changed,wrap_S_dtb)

quiet_cmd_dtc = DTC $@
quiet_dtb_check_tag = $(if $(dtb-check-enabled),[C], )
cmd_dtb_check = $(if $(dtb-check-enabled),; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true)

quiet_cmd_dtc = DTC $(quiet_dtb_check_tag) $@
cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
$(DTC) -o $@ -b 0 \
$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)

DT_CHECK_CMD = $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA)
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) \
$(cmd_dtb_check)

# NOTE:
# Do not replace $(filter %.dtb %.dtbo, $^) with $(real-prereqs). When a single
# DTB is turned into a multi-blob DTB, $^ will contain header file dependencies
# recorded in the .*.cmd file.
ifneq ($(CHECK_DTBS),)
quiet_cmd_fdtoverlay = DTOVLCH $@
cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(filter %.dtb %.dtbo, $^) ; $(DT_CHECK_CMD) $@ || true
else
quiet_cmd_fdtoverlay = DTOVL $@
cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(filter %.dtb %.dtbo, $^)
endif
quiet_cmd_fdtoverlay = OVL $(quiet_dtb_check_tag) $@
cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(filter %.dtb %.dtbo, $^) $(cmd_dtb_check)

$(multi-dtb-y): FORCE
$(call if_changed,fdtoverlay)
Expand All @@ -430,16 +427,11 @@ DT_CHECKER ?= dt-validate
DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),-l $(DT_SCHEMA_FILES),-m)
DT_BINDING_DIR := Documentation/devicetree/bindings
DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json

quiet_cmd_dtb = DTC_CHK $@
cmd_dtb = $(cmd_dtc) ; $(DT_CHECK_CMD) $@ || true
else
quiet_cmd_dtb = $(quiet_cmd_dtc)
cmd_dtb = $(cmd_dtc)
dtb-check-enabled = $(if $(filter %.dtb, $@),y)
endif

$(obj)/%.dtb: $(obj)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
$(call if_changed_dep,dtb)
$(call if_changed_dep,dtc)

$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
$(call if_changed_dep,dtc)
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.modfinal
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ endif

targets += $(modules:%.o=%.ko) $(modules:%.o=%.mod.o)

# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# Add FORCE to the prerequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------

PHONY += FORCE
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.vmlinux
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ targets += vmlinux
vmlinux: scripts/link-vmlinux.sh vmlinux.o $(KBUILD_LDS) FORCE
+$(call if_changed_dep,link_vmlinux)

# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# Add FORCE to the prerequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------

PHONY += FORCE
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.vmlinux_o
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ targets += modules.builtin
modules.builtin: modules.builtin.modinfo FORCE
$(call if_changed,modules_builtin)

# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# Add FORCE to the prerequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------

PHONY += FORCE
Expand Down
2 changes: 2 additions & 0 deletions scripts/kconfig/merge_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do
sed -i "/$CFG[ =]/d" $MERGE_FILE
fi
done
# In case the previous file lacks a new line at the end
echo >> $TMP_FILE
cat $MERGE_FILE >> $TMP_FILE
done

Expand Down
3 changes: 2 additions & 1 deletion scripts/link-vmlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ kallsymso=
strip_debug=

if is_enabled CONFIG_KALLSYMS; then
kallsyms /dev/null .tmp_vmlinux0.kallsyms
truncate -s0 .tmp_vmlinux.kallsyms0.syms
kallsyms .tmp_vmlinux.kallsyms0.syms .tmp_vmlinux0.kallsyms
fi

if is_enabled CONFIG_KALLSYMS || is_enabled CONFIG_DEBUG_INFO_BTF; then
Expand Down
1 change: 0 additions & 1 deletion sound/soc/codecs/cs42l42.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/delay.h>
Expand Down

0 comments on commit 3f44ae9

Please sign in to comment.