Skip to content

Commit

Permalink
Merge tag 'kbuild-fixes-v5.6-3' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Mar 19, 2020
2 parents 5d89291 + 7883a14 commit 207f75c
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Documentation/kbuild/kbuild.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ This is solely useful to speed up test compiles.
KBUILD_EXTRA_SYMBOLS
--------------------
For modules that use symbols from other modules.
See more details in modules.txt.
See more details in modules.rst.

ALLSOURCE_ARCHS
---------------
Expand Down
2 changes: 1 addition & 1 deletion Documentation/kbuild/kconfig-macro-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ intermediate::
def_bool y

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


Variables
Expand Down
6 changes: 3 additions & 3 deletions Documentation/kbuild/makefiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ When kbuild executes, the following steps are followed (roughly):
$(KBUILD_AFLAGS_MODULE) is used to add arch-specific options that
are used for assembler.

From commandline AFLAGS_MODULE shall be used (see kbuild.txt).
From commandline AFLAGS_MODULE shall be used (see kbuild.rst).

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

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

KBUILD_LDFLAGS_MODULE
Options for $(LD) when linking modules

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

From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
From commandline LDFLAGS_MODULE shall be used (see kbuild.rst).

KBUILD_LDS

Expand Down
4 changes: 2 additions & 2 deletions Documentation/kbuild/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,9 @@ build.

The syntax of the Module.symvers file is::

<CRC> <Symbol> <Namespace> <Module> <Export Type>
<CRC> <Symbol> <Module> <Export Type> <Namespace>

0xe1cc2a05 usb_stor_suspend USB_STORAGE drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL
0xe1cc2a05 usb_stor_suspend drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL USB_STORAGE

The fields are separated by tabs and values may be empty (e.g.
if no namespace is defined for an exported symbol).
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ existing-targets := $(wildcard $(sort $(targets)))

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

endif # config-targets
endif # config-build
endif # mixed-build
endif # need-sub-make

Expand Down
3 changes: 1 addition & 2 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,7 @@ config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
bool

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

#
# For architectures that know their GCC __int128 support is sound
Expand Down
7 changes: 7 additions & 0 deletions scripts/Kconfig.include
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ $(error-if,$(success, $(LD) -v | grep -q gold), gold linker '$(LD)' not supporte

# gcc version including patch level
gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC))

# machine bit flags
# $(m32-flag): -m32 if the compiler supports it, or an empty string otherwise.
# $(m64-flag): -m64 if the compiler supports it, or an empty string otherwise.
cc-option-bit = $(if-success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null,$(1))
m32-flag := $(cc-option-bit,-m32)
m64-flag := $(cc-option-bit,-m64)
1 change: 1 addition & 0 deletions scripts/Makefile.extrawarn
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ KBUILD_CFLAGS += -Wno-initializer-overrides
KBUILD_CFLAGS += -Wno-format
KBUILD_CFLAGS += -Wno-sign-compare
KBUILD_CFLAGS += -Wno-format-zero-length
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
endif

endif
Expand Down
2 changes: 1 addition & 1 deletion scripts/export_report.pl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ sub collectcfiles {
#
while ( <$module_symvers> ) {
chomp;
my (undef, $symbol, $namespace, $module, $gpl) = split('\t');
my (undef, $symbol, $module, $gpl, $namespace) = split('\t');
$SYMBOL { $symbol } = [ $module , "0" , $symbol, $gpl];
}
close($module_symvers);
Expand Down
8 changes: 4 additions & 4 deletions scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ static struct sym_entry *read_symbol(FILE *in)
return NULL;
}

if (is_ignored_symbol(name, type))
return NULL;

/* Ignore most absolute/undefined (?) symbols. */
if (strcmp(name, "_text") == 0)
_text = addr;

/* Ignore most absolute/undefined (?) symbols. */
if (is_ignored_symbol(name, type))
return NULL;

check_symbol_range(name, addr, text_ranges, ARRAY_SIZE(text_ranges));
check_symbol_range(name, addr, &percpu_range, 1);

Expand Down
27 changes: 14 additions & 13 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ static const char *sec_name(struct elf_info *elf, int secindex)

static void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym)
{
Elf_Shdr *sechdr = &info->sechdrs[sym->st_shndx];
unsigned int secindex = get_secindex(info, sym);
Elf_Shdr *sechdr = &info->sechdrs[secindex];
unsigned long offset;

offset = sym->st_value;
Expand Down Expand Up @@ -2427,7 +2428,7 @@ static void write_if_changed(struct buffer *b, const char *fname)
}

/* parse Module.symvers file. line format:
* 0x12345678<tab>symbol<tab>module[[<tab>export]<tab>something]
* 0x12345678<tab>symbol<tab>module<tab>export<tab>namespace
**/
static void read_dump(const char *fname, unsigned int kernel)
{
Expand All @@ -2440,24 +2441,24 @@ static void read_dump(const char *fname, unsigned int kernel)
return;

while ((line = get_next_line(&pos, file, size))) {
char *symname, *namespace, *modname, *d, *export, *end;
char *symname, *namespace, *modname, *d, *export;
unsigned int crc;
struct module *mod;
struct symbol *s;

if (!(symname = strchr(line, '\t')))
goto fail;
*symname++ = '\0';
if (!(namespace = strchr(symname, '\t')))
goto fail;
*namespace++ = '\0';
if (!(modname = strchr(namespace, '\t')))
if (!(modname = strchr(symname, '\t')))
goto fail;
*modname++ = '\0';
if ((export = strchr(modname, '\t')) != NULL)
*export++ = '\0';
if (export && ((end = strchr(export, '\t')) != NULL))
*end = '\0';
if (!(export = strchr(modname, '\t')))
goto fail;
*export++ = '\0';
if (!(namespace = strchr(export, '\t')))
goto fail;
*namespace++ = '\0';

crc = strtoul(line, &d, 16);
if (*symname == '\0' || *modname == '\0' || *d != '\0')
goto fail;
Expand Down Expand Up @@ -2508,9 +2509,9 @@ static void write_dump(const char *fname)
namespace = symbol->namespace;
buf_printf(&buf, "0x%08x\t%s\t%s\t%s\t%s\n",
symbol->crc, symbol->name,
namespace ? namespace : "",
symbol->module->name,
export_str(symbol->export));
export_str(symbol->export),
namespace ? namespace : "");
}
symbol = symbol->next;
}
Expand Down
22 changes: 11 additions & 11 deletions usr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,6 @@ choice

If in doubt, select 'None'

config INITRAMFS_COMPRESSION_NONE
bool "None"
help
Do not compress the built-in initramfs at all. This may sound wasteful
in space, but, you should be aware that the built-in initramfs will be
compressed at a later stage anyways along with the rest of the kernel,
on those architectures that support this. However, not compressing the
initramfs may lead to slightly higher memory consumption during a
short time at boot, while both the cpio image and the unpacked
filesystem image will be present in memory simultaneously

config INITRAMFS_COMPRESSION_GZIP
bool "Gzip"
depends on RD_GZIP
Expand Down Expand Up @@ -207,4 +196,15 @@ config INITRAMFS_COMPRESSION_LZ4
If you choose this, keep in mind that most distros don't provide lz4
by default which could cause a build failure.

config INITRAMFS_COMPRESSION_NONE
bool "None"
help
Do not compress the built-in initramfs at all. This may sound wasteful
in space, but, you should be aware that the built-in initramfs will be
compressed at a later stage anyways along with the rest of the kernel,
on those architectures that support this. However, not compressing the
initramfs may lead to slightly higher memory consumption during a
short time at boot, while both the cpio image and the unpacked
filesystem image will be present in memory simultaneously

endchoice

0 comments on commit 207f75c

Please sign in to comment.