Skip to content
Snippets Groups Projects
  1. Mar 02, 2021
  2. Feb 28, 2021
  3. Feb 27, 2021
    • Arnd Bergmann's avatar
      kbuild: lto: add _mcount to list of used symbols · da83616b
      Arnd Bergmann authored
      
      Some randconfig builds fail with undefined references to _mcount
      when CONFIG_TRIM_UNUSED_KSYMS is set:
      
      ERROR: modpost: "_mcount" [drivers/tee/optee/optee.ko] undefined!
      ERROR: modpost: "_mcount" [drivers/fsi/fsi-occ.ko] undefined!
      ERROR: modpost: "_mcount" [drivers/fpga/dfl-pci.ko] undefined!
      
      Since there is already a list of symbols that get generated at link
      time, add this one as well.
      
      Fixes: fbe078d3 ("kbuild: lto: add a default list of used symbols")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      da83616b
  4. Feb 26, 2021
  5. Feb 24, 2021
  6. Feb 23, 2021
  7. Feb 22, 2021
  8. Feb 21, 2021
    • Masahiro Yamada's avatar
      kbuild: check the minimum linker version in Kconfig · 02aff859
      Masahiro Yamada authored
      
      Unify the two scripts/ld-version.sh and scripts/lld-version.sh, and
      check the minimum linker version like scripts/cc-version.sh did.
      
      I tested this script for some corner cases reported in the past:
      
       - GNU ld version 2.25-15.fc23
         as reported by commit 8083013f ("ld-version: Fix it on Fedora")
      
       - GNU ld (GNU Binutils) 2.20.1.20100303
         as reported by commit 0d61ed17 ("ld-version: Drop the 4th and
         5th version components")
      
      This script show an error message if the linker is too old:
      
        $ make LD=ld.lld-9
          SYNC    include/config/auto.conf
        ***
        *** Linker is too old.
        ***   Your LLD version:    9.0.1
        ***   Minimum LLD version: 10.0.1
        ***
        scripts/Kconfig.include:50: Sorry, this linker is not supported.
        make[2]: *** [scripts/kconfig/Makefile:71: syncconfig] Error 1
        make[1]: *** [Makefile:600: syncconfig] Error 2
        make: *** [Makefile:708: include/config/auto.conf] Error 2
      
      I also moved the check for gold to this script, so gold is still rejected:
      
        $ make LD=gold
          SYNC    include/config/auto.conf
        gold linker is not supported as it is not capable of linking the kernel proper.
        scripts/Kconfig.include:50: Sorry, this linker is not supported.
        make[2]: *** [scripts/kconfig/Makefile:71: syncconfig] Error 1
        make[1]: *** [Makefile:600: syncconfig] Error 2
        make: *** [Makefile:708: include/config/auto.conf] Error 2
      
      Thanks to David Laight for suggesting shell script improvements.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
      02aff859
    • Masahiro Yamada's avatar
      kbuild: remove ld-version macro · 05f6bbf2
      Masahiro Yamada authored
      
      There is no direct user of ld-version; you can use CONFIG_LD_VERSION
      if needed.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      05f6bbf2
    • Masahiro Yamada's avatar
      scripts: add generic syscallhdr.sh · b9da928a
      Masahiro Yamada authored
      
      Most of architectures generate syscall headers at the compile time
      in a similar way.
      
      As of v5.11-rc1, 12 architectures duplicate similar shell scripts:
      
        $ find arch -name syscallhdr.sh | sort
        arch/alpha/kernel/syscalls/syscallhdr.sh
        arch/arm/tools/syscallhdr.sh
        arch/ia64/kernel/syscalls/syscallhdr.sh
        arch/m68k/kernel/syscalls/syscallhdr.sh
        arch/microblaze/kernel/syscalls/syscallhdr.sh
        arch/mips/kernel/syscalls/syscallhdr.sh
        arch/parisc/kernel/syscalls/syscallhdr.sh
        arch/powerpc/kernel/syscalls/syscallhdr.sh
        arch/sh/kernel/syscalls/syscallhdr.sh
        arch/sparc/kernel/syscalls/syscallhdr.sh
        arch/x86/entry/syscalls/syscallhdr.sh
        arch/xtensa/kernel/syscalls/syscallhdr.sh
      
      My goal is to unify them into scripts/syscallhdr.sh.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      b9da928a
    • Masahiro Yamada's avatar
      scripts: add generic syscalltbl.sh · 9df526b0
      Masahiro Yamada authored
      
      Most of architectures generate syscall headers at the compile time
      in a similar way.
      
      The syscall table has the same format for all architectures. Each line
      has up to 5 fields; syscall number, ABI, syscall name, native entry
      point, and compat entry point. The syscall table is processed by
      syscalltbl.sh script into header files.
      
      Despite the same pattern, scripts are maintained per architecture,
      which results in code duplication and bad maintainability.
      
      As of v5.11-rc1, 12 architectures duplicate similar shell scripts:
      
        $ find arch -name syscalltbl.sh | sort
        arch/alpha/kernel/syscalls/syscalltbl.sh
        arch/arm/tools/syscalltbl.sh
        arch/ia64/kernel/syscalls/syscalltbl.sh
        arch/m68k/kernel/syscalls/syscalltbl.sh
        arch/microblaze/kernel/syscalls/syscalltbl.sh
        arch/mips/kernel/syscalls/syscalltbl.sh
        arch/parisc/kernel/syscalls/syscalltbl.sh
        arch/powerpc/kernel/syscalls/syscalltbl.sh
        arch/sh/kernel/syscalls/syscalltbl.sh
        arch/sparc/kernel/syscalls/syscalltbl.sh
        arch/x86/entry/syscalls/syscalltbl.sh
        arch/xtensa/kernel/syscalls/syscalltbl.sh
      
      My goal is to unify them into scripts/syscalltbl.sh.
      
      __SYSCALL_WITH_COMPAT should be defined as follows:
      
      32-bit kernel:
        #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
      
      64-bit kernel:
      
        #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, compat)
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      9df526b0
  9. Feb 16, 2021
    • Masahiro Yamada's avatar
      gen_compile_commands: prune some directories · 585d32f9
      Masahiro Yamada authored
      
      If directories are passed to gen_compile_commands.py, os.walk() traverses
      all the subdirectories to search for .cmd files, but we know some of them
      are not worth traversing.
      
      Use the 'topdown' parameter of os.walk to prune them.
      
      Documentation about the 'topdown' option of os.walk:
        When topdown is True, the caller can modify the dirnames list
        in-place (perhaps using del or slice assignment), and walk() will
        only recurse into the subdirectories whose names remain in dirnames;
        this can be used to prune the search, impose a specific order of
        visiting, or even to inform walk() about directories the caller
        creates or renames before it resumes walk() again. Modifying
        dirnames when topdown is False has no effect on the behavior of
        the walk, because in bottom-up mode the directories in dirnames
        are generated before dirpath itself is generated.
      
      This commit prunes four directories, .git, Documentation, include, and
      tools.
      
      The first three do not contain any C files, so skipping them makes this
      script work slightly faster. My main motivation is the last one, tools/
      directory.
      
      Commit 6ca4c6d2 ("gen_compile_commands: do not support .cmd files
      under tools/ directory") stopped supporting the tools/ directory.
      The current code no longer picks up .cmd files from the tools/
      directory.
      
      If you run:
      
        ./scripts/clang-tools/gen_compile_commands.py --log_level=INFO
      
      then, you will see several "File ... not found" log messages.
      
      This is expected, and I do not want to support the tools/ directory.
      However, without an explicit comment "do not support tools/", somebody
      might try to get it back. Clarify this.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: default avatarNathan Chancellor <nathan@kernel.org>
      585d32f9
Loading