Skip to content
Snippets Groups Projects
  1. Mar 04, 2019
    • Masahiro Yamada's avatar
      kbuild: clean up scripts/gcc-version.sh · fa7295ab
      Masahiro Yamada authored
      
      Now that the Kconfig is the only user of this script, we can drop
      unneeded code.
      
      Remove the -p option, and stop prepending the output with zero,
      so that Kconfig can directly use the output from this script.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      fa7295ab
    • Masahiro Yamada's avatar
      kbuild: remove cc-version macro · d3a918c6
      Masahiro Yamada authored
      
      There is no more direct user of this macro; it is only used by
      cc-ifversion.
      
      Calling this macro is not efficient since it invokes the compiler to
      get the compiler version. CONFIG_GCC_VERSION is already calculated in
      the Kconfig stage, so Makefile can reuse it.
      
      Here is a note about the slight difference between cc-version and
      CONFIG_GCC_VERSION:
      
      When using Clang, cc-version is evaluated to '0402' because Clang
      defines __GNUC__ and __GNUC__MINOR__, and looks like GCC 4.2 in the
      version point of view. On the other hand, CONFIG_GCC_VERSION=0
      when $(CC) is clang.
      
      There are currently two users of cc-ifversion:
        arch/mips/loongson64/Platform
        arch/powerpc/Makefile
      
      They are not affected by this change.
      
      The format of cc-version is <major><minor>, while CONFIG_GCC_VERSION
      <major><minor><patch>. I adjusted cc-ifversion for the difference of
      the number of digits.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      d3a918c6
    • Masahiro Yamada's avatar
      kbuild: update comment block of scripts/clang-version.sh · 00250b52
      Masahiro Yamada authored
      
      Commit 469cb737 ("kconfig: add CC_IS_CLANG and CLANG_VERSION")
      changed the code, but missed to update the comment block.
      
      The -p option was gone, and the output is 5-digit (or 6-digit when
      Clang 10 is released).
      
      Update the comment now.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      00250b52
  2. Feb 28, 2019
  3. Feb 27, 2019
    • Masahiro Yamada's avatar
      kbuild: move ".config not found!" message from Kconfig to Makefile · 05850719
      Masahiro Yamada authored
      
      If you run "make" in a pristine source tree, currently Kbuild will
      start to build Kconfig to let it show the error message.
      
      It would be more straightforward to check it in Makefile and let
      it fail immediately.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      05850719
    • Masahiro Yamada's avatar
      kbuild: refactor cc-cross-prefix implementation · bd55f96f
      Masahiro Yamada authored
      
      - $(word 1, <text>) is equivalent to $(firstword <text>)
      
       - hardcode "gcc" instead of $(CC)
      
       - minimize the shell script part
      
      A little more notes in case $(filter-out -%, ...) is not clear.
      
      arch/mips/Makefile passes prefixes depending on the configuration.
      
      CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- \
          $(tool-archpref)-linux-gnu- $(tool-archpref)-unknown-linux-gnu-)
      
      In the Kconfig stage (e.g. when you run 'make defconfig'), neither
      CONFIG_32BIT nor CONFIG_64BIT is defined. So, $(tool-archpref) is
      empty. As a result, "-linux -linux-gnu- -unknown-linux-gnu" is passed
      into cc-cross-prefix. The command 'which' assumes arguments starting
      with a hyphen as command options, then emits the following messages:
      
        Illegal option -l
        Illegal option -l
        Illegal option -u
      
      I think it is strange to define CROSS_COMPILE depending on the CONFIG
      options since you need to feed $(CC) to Kconfig, but it is how MIPS
      Makefile currently works. Anyway, it would not hurt to filter-out
      invalid strings beforehand.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      bd55f96f
    • Masahiro Yamada's avatar
      kbuild: hardcode genksyms path and remove GENKSYMS variable · 88110713
      Masahiro Yamada authored
      
      The genksyms source was integrated into the kernel tree in 2003.
      
      I do not expect anybody still using the external /sbin/genksyms.
      Kbuild does not need to provide the ability to override GENKSYMS.
      
      Let's remove the GENKSYMS variable, and use the hardcoded path.
      
      Since it occurred in the pre-git era, I attached the commit message
      in case somebody is interested in the historical background.
      
        | Author: Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
        | Date:   Wed Feb 19 04:17:28 2003 -0600
        |
        | kbuild: [PATCH] put genksyms in scripts dir
        |
        | This puts genksyms into scripts/genksyms/.
        |
        | genksyms used to be maintained externally, though the only possible user
        | was the kernel build. Moving it into the kernel sources makes it easier to
        | keep it uptodate, like for example updating it to generate linker scripts
        | directly instead of postprocessing the generated header file fragments
        | with sed, as we do currently.
        |
        | Also, genksyms does not handle __typeof__, which needs to be fixed since
        | some of the exported symbol in the kernel are defined using __typeof__.
        |
        | (Rusty Russell/me)
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      88110713
    • Masahiro Yamada's avatar
      scripts/gdb: refactor rules for symlink creation · b513adf4
      Masahiro Yamada authored
      
      gdb-scripts is not a real object, but (ab)used like a phony target.
      
      Rewrite the code in a more Kbuild-ish way. Add symlinks to extra-y
      and use if_changed.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarKieran Bingham <kieran.bingham@ideasonboard.com>
      b513adf4
    • Masahiro Yamada's avatar
      scripts/gdb: do not descend into scripts/gdb from scripts · 1e5ff84f
      Masahiro Yamada authored
      
      Currently, Kbuild descends from scripts/Makefile to scripts/gdb/Makefile
      just for creating symbolic links, but it does not need to do it so early.
      
      Merge the two descending paths to simplify the code.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarKieran Bingham <kieran.bingham@ideasonboard.com>
      1e5ff84f
  4. Feb 20, 2019
    • Masahiro Yamada's avatar
      kbuild: generate modules.order only when CONFIG_MODULES=y · 1d8001ef
      Masahiro Yamada authored
      
      Do not generate pointless modules.order when the module support is
      disabled.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      1d8001ef
    • Masahiro Yamada's avatar
      kbuild: pkg: use -f $(srctree)/Makefile to recurse to top Makefile · 175209cc
      Masahiro Yamada authored
      
      '$(MAKE) KBUILD_SRC=' changes the working directory back and forth
      between objtree and srctree.
      
      It is better to recurse to the top-level Makefile directly.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      175209cc
    • Masahiro Yamada's avatar
      kbuild: Disable extra debugging info in .s output · 1e88e415
      Masahiro Yamada authored
      
      Modern gcc adds view assignments, reset assertion checking in .loc
      directives and a couple more additional debug markers, which clutters
      the asm output unnecessarily:
      
      For example:
      
        bsp_resume:
        .LFB3466:
                .loc 1 1868 1 is_stmt 1 view -0
                .cfi_startproc
                .loc 1 1869 2 view .LVU73
        # arch/x86/kernel/cpu/common.c:1869:    if (this_cpu->c_bsp_resume)
                .loc 1 1869 14 is_stmt 0 view .LVU74
                movq    this_cpu(%rip), %rax    # this_cpu, this_cpu
                movq    64(%rax), %rax  # this_cpu.94_1->c_bsp_resume, _2
        # arch/x86/kernel/cpu/common.c:1869:    if (this_cpu->c_bsp_resume)
                .loc 1 1869 5 view .LVU75
                testq   %rax, %rax      # _2
                je      .L8     #,
                .loc 1 1870 3 is_stmt 1 view .LVU76
                movq    $boot_cpu_data, %rdi    #,
                jmp     __x86_indirect_thunk_rax
      
      or
              .loc 2 57 9 view .LVU478
              .loc 2 57 9 view .LVU479
              .loc 2 57 9 view .LVU480
              .loc 2 57 9 view .LVU481
        .LBB1385:
        .LBB1383:
        .LBB1379:
        .LBB1377:
        .LBB1375:
              .loc 2 57 9 view .LVU482
              .loc 2 57 9 view .LVU483
              movl	%edi, %edx	# cpu, cpu
        .LVL87:
              .loc 2 57 9 is_stmt 0 view .LVU484
      
      That MOV in there is drowned in debugging information and latter makes
      it hard to follow the asm. And that DWARF info is not really needed for
      asm output staring.
      
      Disable the debug information generation which clutters the asm output
      unnecessarily:
      
        bsp_resume:
        # arch/x86/kernel/cpu/common.c:1869:    if (this_cpu->c_bsp_resume)
                movq    this_cpu(%rip), %rax    # this_cpu, this_cpu
                movq    64(%rax), %rax  # this_cpu.94_1->c_bsp_resume, _2
        # arch/x86/kernel/cpu/common.c:1869:    if (this_cpu->c_bsp_resume)
                testq   %rax, %rax      # _2
                je      .L8     #,
        # arch/x86/kernel/cpu/common.c:1870:            this_cpu->c_bsp_resume(&boot_cpu_data);
                movq    $boot_cpu_data, %rdi    #,
                jmp     __x86_indirect_thunk_rax
        .L8:
        # arch/x86/kernel/cpu/common.c:1871: }
                rep ret
                .size   bsp_resume, .-bsp_resume
      
        [ bp: write commit message. ]
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      1e88e415
  5. Feb 19, 2019
  6. Jan 28, 2019
  7. Jan 20, 2019
  8. Jan 14, 2019
  9. Jan 09, 2019
    • WANG Chao's avatar
      x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE · e4f35891
      WANG Chao authored
      
      Commit
      
        4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
      
      replaced the RETPOLINE define with CONFIG_RETPOLINE checks. Remove the
      remaining pieces.
      
       [ bp: Massage commit message. ]
      
      Fixes: 4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
      Signed-off-by: default avatarWANG Chao <chao.wang@ucloud.cn>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarZhenzhong Duan <zhenzhong.duan@oracle.com>
      Reviewed-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Woodhouse <dwmw@amazon.co.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: linux-kbuild@vger.kernel.org
      Cc: srinivas.eeda@oracle.com
      Cc: stable <stable@vger.kernel.org>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn
      e4f35891
  10. Jan 08, 2019
  11. Jan 06, 2019
  12. Jan 04, 2019
Loading