make modules_prepare results in an error on 4.15.0-60-generic

Asked by Suresh Sandur on 2019-09-06

Hi,

I have been trying to build vmlinux on Ubuntu 16.04 and also on Ubuntu 18.04 for kernel version 4.15.0-60-generic, with the relevant headers and latest sources.

However, I am getting this error:

root@suresh-ub1804-415:/usr/src/linux-source-4.15.0/linux-source-4.15.0# make modules_prepare
  HOSTCC scripts/basic/fixdep
  HOSTCC scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  HOSTCC scripts/kconfig/zconf.tab.o
  HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
  SYSTBL arch/x86/include/generated/asm/syscalls_32.h
  SYSHDR arch/x86/include/generated/asm/unistd_32_ia32.h
  SYSHDR arch/x86/include/generated/asm/unistd_64_x32.h
  SYSTBL arch/x86/include/generated/asm/syscalls_64.h
  HYPERCALLS arch/x86/include/generated/asm/xen-hypercalls.h
  SYSHDR arch/x86/include/generated/uapi/asm/unistd_32.h
  SYSHDR arch/x86/include/generated/uapi/asm/unistd_64.h
  SYSHDR arch/x86/include/generated/uapi/asm/unistd_x32.h
  HOSTCC scripts/basic/bin2c
  HOSTCC arch/x86/tools/relocs_32.o
  HOSTCC arch/x86/tools/relocs_64.o
  HOSTCC arch/x86/tools/relocs_common.o
  HOSTLD arch/x86/tools/relocs
  CHK include/config/kernel.release
  UPD include/config/kernel.release
  WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h
  WRAP arch/x86/include/generated/asm/clkdev.h
  WRAP arch/x86/include/generated/asm/dma-contiguous.h
  WRAP arch/x86/include/generated/asm/early_ioremap.h
  WRAP arch/x86/include/generated/asm/mcs_spinlock.h
  WRAP arch/x86/include/generated/asm/mm-arch-hooks.h
  CHK include/generated/uapi/linux/version.h
  UPD include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
  UPD include/generated/utsrelease.h
  CC arch/x86/purgatory/purgatory.o
  AS arch/x86/purgatory/stack.o
  AS arch/x86/purgatory/setup-x86_64.o
  CC arch/x86/purgatory/sha256.o
  AS arch/x86/purgatory/entry64.o
  CC arch/x86/purgatory/string.o
  LD arch/x86/purgatory/purgatory.ro
  BIN2C arch/x86/purgatory/kexec-purgatory.c
  CHK include/generated/timeconst.h
  UPD include/generated/timeconst.h
  CC kernel/bounds.s
  CHK include/generated/bounds.h
  UPD include/generated/bounds.h
  GEN scripts/gdb/linux/constants.py
  CC arch/x86/kernel/asm-offsets.s
  CHK include/generated/asm-offsets.h
  UPD include/generated/asm-offsets.h
  CALL scripts/checksyscalls.sh
  DESCEND objtool
  HOSTCC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/fixdep.o
  HOSTLD /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/fixdep-in.o
  LINK /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/fixdep
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/exec-cmd.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/help.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/pager.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/parse-options.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/run-command.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/sigchain.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/subcmd-config.o
  LD /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/libsubcmd-in.o
  AR /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/libsubcmd.a
  GEN /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/arch/x86/lib/inat-tables.c
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/arch/x86/decode.o
  LD /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/arch/x86/objtool-in.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/builtin-check.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/builtin-orc.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/check.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/orc_gen.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/orc_dump.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/elf.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/special.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/objtool.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/libstring.o
  CC /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/str_error_r.o
  LD /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/objtool-in.o
  LINK /usr/src/linux-source-4.15.0/linux-source-4.15.0/tools/objtool/objtool
  HOSTCC scripts/genksyms/genksyms.o
  SHIPPED scripts/genksyms/parse.tab.c
  HOSTCC scripts/genksyms/parse.tab.o
  SHIPPED scripts/genksyms/lex.lex.c
  SHIPPED scripts/genksyms/parse.tab.h
  HOSTCC scripts/genksyms/lex.lex.o
In file included from scripts/genksyms/lex.lex.c_shipped:1908:0:
scripts/genksyms/keywords.c:27:16: error: ‘BUILTIN_INT_KEYW’ undeclared here (not in a function); did you mean ‘INLINE_KEYW’?
  { "__int128", BUILTIN_INT_KEYW },
                ^~~~~~~~~~~~~~~~
                INLINE_KEYW
scripts/Makefile.host:107: recipe for target 'scripts/genksyms/lex.lex.o' failed
make[2]: *** [scripts/genksyms/lex.lex.o] Error 1
scripts/Makefile.build:604: recipe for target 'scripts/genksyms' failed
make[1]: *** [scripts/genksyms] Error 2
Makefile:599: recipe for target 'scripts' failed
make: *** [scripts] Error 2

I have not done any other changes. Just installed the kernel-image, installed the headers and installed the kernel sources from UBuntu repository.

Can you please look into this.

regards,
Suresh

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu linux-hwe Edit question
Assignee:
No assignee Edit question
Solved by:
Suresh Sandur
Solved:
2019-09-12
Last query:
2019-09-12
Last reply:
Suresh Sandur (ssandur) said : #1

Adding further info:

the new addition to scripts/genksyms/keyword.c,

        { "__int128", BUILTIN_INT_KEYW },
        { "__int128_t", BUILTIN_INT_KEYW },
        { "__uint128_t", BUILTIN_INT_KEYW },

also to scripts/genksyms/parse.y seems to be the issue.

When I comment out the additions to keyword.c the "make modules_prepare" completes successfully.

The other way to resolve this is to add the token BUILTIN_INT_KEYW to the enum yytokentype in scripts/genksyms/parse.tab.[ch]_shipped

Suresh Sandur (ssandur) said : #2

The following inclusion seems to be the issue.

linux-hwe (4.15.0-59.66~16.04.1) xenial;

    - genksyms: Teach parser about 128-bit built-in types

Suresh Sandur (ssandur) said : #3

This happens when CONFIG_MODVERSIONS is set to yes.

Suresh Sandur (ssandur) said : #4

make REGENERATE_PARSERS=1 before make modules_prepare resolves the issue