Skip to content

Commit 207f75c

Browse files
committed
Merge tag 'kbuild-fixes-v5.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - fix __uint128_t capability test in Kconfig when GCC that defaults to 32-bit is used to build the 64-bit kernel - suppress new noisy Clang warnings -Wpointer-to-enum-cast - move the namespace field in Module.symvers for the backward compatibility reason for the depmod tool - use available compression for initramdisk when INTRAMFS_SOURCE is defined, which was the original behavior - fix modpost to handle correct large section numbers when it refers to modversion CRCs and module namespaces - fix comments and documents * tag 'kbuild-fixes-v5.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: scripts/kallsyms: fix wrong kallsyms_relative_base modpost: Get proper section index by get_secindex() instead of st_shndx initramfs: restore default compression behavior modpost: move the namespace field in Module.symvers last kbuild: Disable -Wpointer-to-enum-cast kbuild: doc: fix references to other documents int128: fix __uint128_t compiler test in Kconfig kconfig: introduce m32-flag and m64-flag kbuild: Fix inconsistent comment
2 parents 5d89291 + 7883a14 commit 207f75c

File tree

12 files changed

+47
-39
lines changed

12 files changed

+47
-39
lines changed

Documentation/kbuild/kbuild.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ This is solely useful to speed up test compiles.
237237
KBUILD_EXTRA_SYMBOLS
238238
--------------------
239239
For modules that use symbols from other modules.
240-
See more details in modules.txt.
240+
See more details in modules.rst.
241241

242242
ALLSOURCE_ARCHS
243243
---------------

Documentation/kbuild/kconfig-macro-language.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ intermediate::
4444
def_bool y
4545

4646
Then, Kconfig moves onto the evaluation stage to resolve inter-symbol
47-
dependency as explained in kconfig-language.txt.
47+
dependency as explained in kconfig-language.rst.
4848

4949

5050
Variables

Documentation/kbuild/makefiles.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ When kbuild executes, the following steps are followed (roughly):
924924
$(KBUILD_AFLAGS_MODULE) is used to add arch-specific options that
925925
are used for assembler.
926926

927-
From commandline AFLAGS_MODULE shall be used (see kbuild.txt).
927+
From commandline AFLAGS_MODULE shall be used (see kbuild.rst).
928928

929929
KBUILD_CFLAGS_KERNEL
930930
$(CC) options specific for built-in
@@ -937,15 +937,15 @@ When kbuild executes, the following steps are followed (roughly):
937937

938938
$(KBUILD_CFLAGS_MODULE) is used to add arch-specific options that
939939
are used for $(CC).
940-
From commandline CFLAGS_MODULE shall be used (see kbuild.txt).
940+
From commandline CFLAGS_MODULE shall be used (see kbuild.rst).
941941

942942
KBUILD_LDFLAGS_MODULE
943943
Options for $(LD) when linking modules
944944

945945
$(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options
946946
used when linking modules. This is often a linker script.
947947

948-
From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
948+
From commandline LDFLAGS_MODULE shall be used (see kbuild.rst).
949949

950950
KBUILD_LDS
951951

Documentation/kbuild/modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,9 @@ build.
470470

471471
The syntax of the Module.symvers file is::
472472

473-
<CRC> <Symbol> <Namespace> <Module> <Export Type>
473+
<CRC> <Symbol> <Module> <Export Type> <Namespace>
474474

475-
0xe1cc2a05 usb_stor_suspend USB_STORAGE drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL
475+
0xe1cc2a05 usb_stor_suspend drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL USB_STORAGE
476476

477477
The fields are separated by tabs and values may be empty (e.g.
478478
if no namespace is defined for an exported symbol).

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ existing-targets := $(wildcard $(sort $(targets)))
18041804

18051805
-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
18061806

1807-
endif # config-targets
1807+
endif # config-build
18081808
endif # mixed-build
18091809
endif # need-sub-make
18101810

init/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,7 @@ config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
767767
bool
768768

769769
config CC_HAS_INT128
770-
def_bool y
771-
depends on !$(cc-option,-D__SIZEOF_INT128__=0)
770+
def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT
772771

773772
#
774773
# For architectures that know their GCC __int128 support is sound

scripts/Kconfig.include

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ $(error-if,$(success, $(LD) -v | grep -q gold), gold linker '$(LD)' not supporte
4444

4545
# gcc version including patch level
4646
gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC))
47+
48+
# machine bit flags
49+
# $(m32-flag): -m32 if the compiler supports it, or an empty string otherwise.
50+
# $(m64-flag): -m64 if the compiler supports it, or an empty string otherwise.
51+
cc-option-bit = $(if-success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null,$(1))
52+
m32-flag := $(cc-option-bit,-m32)
53+
m64-flag := $(cc-option-bit,-m64)

scripts/Makefile.extrawarn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ KBUILD_CFLAGS += -Wno-initializer-overrides
4848
KBUILD_CFLAGS += -Wno-format
4949
KBUILD_CFLAGS += -Wno-sign-compare
5050
KBUILD_CFLAGS += -Wno-format-zero-length
51+
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
5152
endif
5253

5354
endif

scripts/export_report.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ sub collectcfiles {
9494
#
9595
while ( <$module_symvers> ) {
9696
chomp;
97-
my (undef, $symbol, $namespace, $module, $gpl) = split('\t');
97+
my (undef, $symbol, $module, $gpl, $namespace) = split('\t');
9898
$SYMBOL { $symbol } = [ $module , "0" , $symbol, $gpl];
9999
}
100100
close($module_symvers);

scripts/kallsyms.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ static struct sym_entry *read_symbol(FILE *in)
195195
return NULL;
196196
}
197197

198-
if (is_ignored_symbol(name, type))
199-
return NULL;
200-
201-
/* Ignore most absolute/undefined (?) symbols. */
202198
if (strcmp(name, "_text") == 0)
203199
_text = addr;
204200

201+
/* Ignore most absolute/undefined (?) symbols. */
202+
if (is_ignored_symbol(name, type))
203+
return NULL;
204+
205205
check_symbol_range(name, addr, text_ranges, ARRAY_SIZE(text_ranges));
206206
check_symbol_range(name, addr, &percpu_range, 1);
207207

0 commit comments

Comments
 (0)