Skip to content
Snippets Groups Projects
  1. Nov 13, 2023
  2. Oct 30, 2023
  3. Oct 28, 2023
    • Simon Glass's avatar
      kbuild: Correct missing architecture-specific hyphens · 766b7007
      Simon Glass authored
      
      These should add a hyphen to indicate that it makes a adjective. Fix
      them.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      766b7007
    • Masahiro Yamada's avatar
      kbuild: avoid too many execution of scripts/pahole-flags.sh · 72d09184
      Masahiro Yamada authored
      scripts/pahole-flags.sh is executed so many times.
      
      You can confirm it, as follows:
      
        $ cat <<EOF >> scripts/pahole-flags.sh
        > echo "scripts/pahole-flags.sh was executed" >&2
        > EOF
      
        $ make -s
        scripts/pahole-flags.sh was executed
        scripts/pahole-flags.sh was executed
        scripts/pahole-flags.sh was executed
        scripts/pahole-flags.sh was executed
        scripts/pahole-flags.sh was executed
          [ lots of repeated lines... ]
      
      This scripts is executed more than 20 times during the kernel build
      because PAHOLE_FLAGS is a recursively expanded variable and exported
      to sub-processes.
      
      With GNU Make >= 4.4, it is executed more than 60 times because
      exported variables are also passed to other $(shell ) invocations.
      Without careful coding, it is known to cause an exponential fork
      explosion. [1]
      
      The use of $(shell ) in an exported recursive variable is likely wrong
      because $(shell ) is always evaluated due to the 'export' keyword, and
      the evaluation can occur multiple times by the nature of recursive
      variables.
      
      Convert the shell script to a Makefile, which is included only when
      CONFIG_DEBUG_INFO_BTF=y.
      
      [1]: https://savannah.gnu.org/bugs/index.php?64746
      
      
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: default avatarAlan Maguire <alan.maguire@oracle.com>
      Tested-by: default avatarAlan Maguire <alan.maguire@oracle.com>
      Reviewed-by: default avatarNicolas Schier <n.schier@avm.de>
      Tested-by: default avatarMiguel Ojeda <ojeda@kernel.org>
      Acked-by: default avatarMiguel Ojeda <ojeda@kernel.org>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Reviewed-by: Martin Rodriguez Reboredo's avatarMartin Rodriguez Reboredo <yakoyoku@gmail.com>
      72d09184
    • Masahiro Yamada's avatar
      kbuild: unify no-compiler-targets and no-sync-config-targets · 9d361173
      Masahiro Yamada authored
      
      Now that vdso_install does not depend on any in-tree build artifact,
      it no longer needs a compiler, making no-compiler-targets the same
      as no-sync-config-targets.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: default avatarNicolas Schier <nicolas@fjasle.eu>
      9d361173
    • Masahiro Yamada's avatar
      kbuild: unify vdso_install rules · 56769ba4
      Masahiro Yamada authored
      
      Currently, there is no standard implementation for vdso_install,
      leading to various issues:
      
       1. Code duplication
      
          Many architectures duplicate similar code just for copying files
          to the install destination.
      
          Some architectures (arm, sparc, x86) create build-id symlinks,
          introducing more code duplication.
      
       2. Unintended updates of in-tree build artifacts
      
          The vdso_install rule depends on the vdso files to install.
          It may update in-tree build artifacts. This can be problematic,
          as explained in commit 19514fc6 ("arm, kbuild: make
          "make install" not depend on vmlinux").
      
       3. Broken code in some architectures
      
          Makefile code is often copied from one architecture to another
          without proper adaptation.
      
          'make vdso_install' for parisc does not work.
      
          'make vdso_install' for s390 installs vdso64, but not vdso32.
      
      To address these problems, this commit introduces a generic vdso_install
      rule.
      
      Architectures that support vdso_install need to define vdso-install-y
      in arch/*/Makefile. vdso-install-y lists the files to install.
      
      For example, arch/x86/Makefile looks like this:
      
        vdso-install-$(CONFIG_X86_64)           += arch/x86/entry/vdso/vdso64.so.dbg
        vdso-install-$(CONFIG_X86_X32_ABI)      += arch/x86/entry/vdso/vdsox32.so.dbg
        vdso-install-$(CONFIG_X86_32)           += arch/x86/entry/vdso/vdso32.so.dbg
        vdso-install-$(CONFIG_IA32_EMULATION)   += arch/x86/entry/vdso/vdso32.so.dbg
      
      These files will be installed to $(MODLIB)/vdso/ with the .dbg suffix,
      if exists, stripped away.
      
      vdso-install-y can optionally take the second field after the colon
      separator. This is needed because some architectures install a vdso
      file as a different base name.
      
      The following is a snippet from arch/arm64/Makefile.
      
        vdso-install-$(CONFIG_COMPAT_VDSO)      += arch/arm64/kernel/vdso32/vdso.so.dbg:vdso32.so
      
      This will rename vdso.so.dbg to vdso32.so during installation. If such
      architectures change their implementation so that the base names match,
      this workaround will go away.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: Sven Schnelle <svens@linux.ibm.com> # s390
      Reviewed-by: default avatarNicolas Schier <nicolas@fjasle.eu>
      Reviewed-by: default avatarGuo Ren <guoren@kernel.org>
      Acked-by: Helge Deller <deller@gmx.de>  # parisc
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      56769ba4
  4. Oct 22, 2023
  5. Oct 19, 2023
  6. Oct 15, 2023
  7. Oct 08, 2023
  8. Oct 05, 2023
  9. Oct 03, 2023
  10. Oct 01, 2023
  11. Sep 24, 2023
  12. Sep 17, 2023
  13. Sep 11, 2023
  14. Sep 10, 2023
  15. Sep 03, 2023
  16. Sep 01, 2023
  17. Aug 29, 2023
  18. Aug 27, 2023
  19. Aug 22, 2023
  20. Aug 20, 2023
  21. Aug 14, 2023
  22. Aug 13, 2023
  23. Aug 09, 2023
  24. Aug 07, 2023
  25. Aug 06, 2023
  26. Jul 30, 2023
  27. Jul 24, 2023
    • Masahiro Yamada's avatar
      kbuild: rpm-pkg: rename binkernel.spec to kernel.spec · 975667d0
      Masahiro Yamada authored
      
      Now kernel.spec and binkernel.spec have the exactly same contents.
      
      Use kernel.spec for binrpm-pkg as well.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      975667d0
    • Masahiro Yamada's avatar
      kbuild: add a phony target to run a command with Kbuild env vars · 76a48b8f
      Masahiro Yamada authored
      
      There are some cases where we want to run a command with the same
      environment variables as Kbuild uses. For example, 'make coccicheck'
      invokes scripts/coccicheck from the top Makefile so that the script can
      reference to ${LINUXINCLUDE}, ${KBUILD_EXTMOD}, etc. The top Makefile
      defines several phony targets that run a script.
      
      We do it also for an internally used script, which results in a somewhat
      complex call graph.
      
      One example:
      
       debian/rules binary-arch
         -> make intdeb-pkg
            -> scripts/package/builddeb
      
      It is also tedious to add a dedicated target like 'intdeb-pkg' for each
      use case.
      
      Add a generic target 'run-command' to run an arbitrary command in an
      environment with all Kbuild variables set.
      
      The usage is:
      
        $ make run-command KBUILD_RUN_COMMAND=<command>
      
      The concept is similar to:
      
        $ dpkg-architecture -c <command>
      
      This executes <command> in an environment which has all DEB_* variables
      defined.
      
      Convert the existing 'make intdeb-pkg'.
      
      Another possible usage is to interrogate a Make variable.
      
        $ make run-command KBUILD_RUN_COMMAND='echo $(KBUILD_CFLAGS)'
      
      might be useful to see KBUILD_CFLAGS set by the top Makefile.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      76a48b8f
    • Borislav Petkov (AMD)'s avatar
      kbuild: Enable -Wenum-conversion by default · c40e60f0
      Borislav Petkov (AMD) authored
      This diagnostic checks whether there is a type mismatch when
      converting enums (assign an enum of type A to an enum of type B, for
      example) and it caught a legit issue recently. The reason it didn't show
      is because that warning is enabled only with -Wextra with GCC. Clang,
      however, enables it by default.
      
      GCC folks were considering enabling it by default but it was too noisy
      back then:
      
        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78736
      
      
      
      Now that due to clang all those warnings have been fixed, enable it with
      GCC too.
      
      allmodconfig tests done with: x86, arm{,64}, powerpc{,64}, riscv
      crossbuilds.
      
      Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      c40e60f0
  28. Jul 23, 2023
Loading