File tree Expand file tree Collapse file tree 11 files changed +46
-12
lines changed Expand file tree Collapse file tree 11 files changed +46
-12
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,21 @@ The kernel embeds the building user and host names in
46
46
`KBUILD_BUILD_USER and KBUILD_BUILD_HOST `_ variables. If you are
47
47
building from a git commit, you could use its committer address.
48
48
49
+ Absolute filenames
50
+ ------------------
51
+
52
+ When the kernel is built out-of-tree, debug information may include
53
+ absolute filenames for the source files. This must be overridden by
54
+ including the ``-fdebug-prefix-map `` option in the `KCFLAGS `_ variable.
55
+
56
+ Depending on the compiler used, the ``__FILE__ `` macro may also expand
57
+ to an absolute filename in an out-of-tree build. Kbuild automatically
58
+ uses the ``-fmacro-prefix-map `` option to prevent this, if it is
59
+ supported.
60
+
61
+ The Reproducible Builds web site has more information about these
62
+ `prefix-map options `_.
63
+
49
64
Generated files in source packages
50
65
----------------------------------
51
66
@@ -116,5 +131,7 @@ See ``scripts/setlocalversion`` for details.
116
131
117
132
.. _KBUILD_BUILD_TIMESTAMP : kbuild.html#kbuild-build-timestamp
118
133
.. _KBUILD_BUILD_USER and KBUILD_BUILD_HOST : kbuild.html#kbuild-build-user-kbuild-build-host
134
+ .. _KCFLAGS : kbuild.html#kcflags
135
+ .. _prefix-map options : https://reproducible-builds.org/docs/build-path/
119
136
.. _Reproducible Builds project : https://reproducible-builds.org/
120
137
.. _SOURCE_DATE_EPOCH : https://reproducible-builds.org/docs/source-date-epoch/
Original file line number Diff line number Diff line change @@ -1068,8 +1068,7 @@ KBUILD_CFLAGS += -fno-builtin-wcslen
1068
1068
1069
1069
# change __FILE__ to the relative path to the source directory
1070
1070
ifdef building_out_of_srctree
1071
- KBUILD_CPPFLAGS += $(call cc-option,-ffile-prefix-map=$(srcroot ) /=)
1072
- KBUILD_RUSTFLAGS += --remap-path-prefix=$(srcroot ) /=
1071
+ KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srcroot ) /=)
1073
1072
endif
1074
1073
1075
1074
# include additional Makefiles when needed
Original file line number Diff line number Diff line change @@ -154,5 +154,6 @@ MRPROPER_FILES += $(HOST_DIR)/include/generated
154
154
archclean :
155
155
@find . \( -name ' *.bb' -o -name ' *.bbg' -o -name ' *.da' \
156
156
-o -name ' *.gcov' \) -type f -print | xargs rm -f
157
+ $(Q )$(MAKE ) -f $(srctree ) /Makefile ARCH=$(HEADER_ARCH ) clean
157
158
158
159
export HEADER_ARCH SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING DEV_NULL_PATH
Original file line number Diff line number Diff line change @@ -87,11 +87,6 @@ config CC_CAN_LINK
87
87
default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag)) if 64BIT
88
88
default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag))
89
89
90
- config CC_CAN_LINK_STATIC
91
- bool
92
- default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag) -static) if 64BIT
93
- default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag) -static)
94
-
95
90
# Fixed in GCC 14, 13.3, 12.4 and 11.5
96
91
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921
97
92
config GCC_ASM_GOTO_OUTPUT_BROKEN
Original file line number Diff line number Diff line change @@ -192,6 +192,11 @@ config GENDWARFKSYMS
192
192
depends on !DEBUG_INFO_REDUCED && !DEBUG_INFO_SPLIT
193
193
# Requires ELF object files.
194
194
depends on !LTO
195
+ # To avoid conflicts with the discarded __gendwarfksyms_ptr symbols on
196
+ # X86, requires pahole before commit 47dcb534e253 ("btf_encoder: Stop
197
+ # indexing symbols for VARs") or after commit 9810758003ce ("btf_encoder:
198
+ # Verify 0 address DWARF variables are in ELF section").
199
+ depends on !X86 || !DEBUG_INFO_BTF || PAHOLE_VERSION < 128 || PAHOLE_VERSION > 129
195
200
help
196
201
Calculate symbol versions from DWARF debugging information using
197
202
gendwarfksyms. Requires DEBUG_INFO to be enabled.
Original file line number Diff line number Diff line change @@ -37,6 +37,18 @@ KBUILD_CFLAGS += -Wno-gnu
37
37
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111219
38
38
KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow-non-kprintf)
39
39
KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation-non-kprintf)
40
+
41
+ # Clang may emit a warning when a const variable, such as the dummy variables
42
+ # in typecheck(), or const member of an aggregate type are not initialized,
43
+ # which can result in unexpected behavior. However, in many audited cases of
44
+ # the "field" variant of the warning, this is intentional because the field is
45
+ # never used within a particular call path, the field is within a union with
46
+ # other non-const members, or the containing object is not const so the field
47
+ # can be modified via memcpy() / memset(). While the variable warning also gets
48
+ # disabled with this same switch, there should not be too much coverage lost
49
+ # because -Wuninitialized will still flag when an uninitialized const variable
50
+ # is used.
51
+ KBUILD_CFLAGS += $(call cc-disable-warning, default-const-init-unsafe)
40
52
else
41
53
42
54
# gcc inanely warns about local variables called 'main'
Original file line number Diff line number Diff line change @@ -94,10 +94,10 @@ $(vmlinux-final): $(RESOLVE_BTFIDS)
94
94
endif
95
95
96
96
ifdef CONFIG_BUILDTIME_TABLE_SORT
97
- vmlinux: scripts/sorttable
97
+ $( vmlinux-final) : scripts/sorttable
98
98
endif
99
99
100
- # module .builtin.ranges
100
+ # modules .builtin.ranges
101
101
# ---------------------------------------------------------------------------
102
102
ifdef CONFIG_BUILTIN_MODULE_RANGES
103
103
__default: modules.builtin.ranges
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ vmlinux.o: $(initcalls-lds) vmlinux.a $(KBUILD_VMLINUX_LIBS) FORCE
73
73
74
74
targets += vmlinux.o
75
75
76
- # module .builtin.modinfo
76
+ # modules .builtin.modinfo
77
77
# ---------------------------------------------------------------------------
78
78
79
79
OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary
@@ -82,7 +82,7 @@ targets += modules.builtin.modinfo
82
82
modules.builtin.modinfo: vmlinux.o FORCE
83
83
$(call if_changed,objcopy)
84
84
85
- # module .builtin
85
+ # modules .builtin
86
86
# ---------------------------------------------------------------------------
87
87
88
88
# The second line aids cases where multiple modules share the same object.
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ Source1: config
16
16
Source2: diff.patch
17
17
Provides: kernel-%{KERNELRELEASE }
18
18
BuildRequires: bc binutils bison dwarves
19
+ BuildRequires: (elfutils-devel or libdw-devel)
19
20
BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
20
21
BuildRequires: gcc make openssl openssl-devel perl python3 rsync
21
22
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ Rules-Requires-Root: no
210
210
Build-Depends: debhelper-compat (= 12)
211
211
Build-Depends-Arch: bc, bison, flex,
212
212
gcc-${host_gnu} <!pkg.${sourcename} .nokernelheaders>,
213
- kmod, libelf-dev:native,
213
+ kmod, libdw-dev:native, libelf-dev:native,
214
214
libssl-dev:native, libssl-dev <!pkg.${sourcename} .nokernelheaders>,
215
215
python3:native, rsync
216
216
Homepage: https://www.kernel.org/
Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ ifeq ($(SRCARCH),arc)
59
59
no-header-test += linux/bpf_perf_event.h
60
60
endif
61
61
62
+ ifeq ($(SRCARCH ) ,openrisc)
63
+ no-header-test += linux/bpf_perf_event.h
64
+ endif
65
+
62
66
ifeq ($(SRCARCH ) ,powerpc)
63
67
no-header-test += linux/bpf_perf_event.h
64
68
endif
You can’t perform that action at this time.
0 commit comments