04 Feb, 2020

1 commit

  • In old days, the "host-progs" syntax was used for specifying host
    programs. It was renamed to the current "hostprogs-y" in 2004.

    It is typically useful in scripts/Makefile because it allows Kbuild to
    selectively compile host programs based on the kernel configuration.

    This commit renames like follows:

    always -> always-y
    hostprogs-y -> hostprogs

    So, scripts/Makefile will look like this:

    always-$(CONFIG_BUILD_BIN2C) += ...
    always-$(CONFIG_KALLSYMS) += ...
    ...
    hostprogs := $(always-y) $(always-m)

    I think this makes more sense because a host program is always a host
    program, irrespective of the kernel configuration. We want to specify
    which ones to compile by CONFIG options, so always-y will be handier.

    The "always", "hostprogs-y", "hostprogs-m" will be kept for backward
    compatibility for a while.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

21 Aug, 2019

1 commit

  • 'make clean' descends into ./Kbuild, but does not clean anything
    since everything is added to no-clean-files.

    There is no need to descend to ./Kbuild in the first place.
    We can drop the no-clean-files assignment.

    With this, there is no more user of no-clean-files. I will keep it
    for a while to see whether a new user will appear.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

15 Aug, 2019

1 commit


11 Mar, 2019

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - do not generate unneeded top-level built-in.a

    - let git ignore O= directory entirely

    - optimize scripts/kallsyms slightly

    - exclude DWARF info from *.s regardless of config options

    - fix GCC toolchain search path for Clang to prepare ld.lld support

    - do not generate modules.order when CONFIG_MODULES is disabled

    - simplify single target rules and remove VPATH for external module
    build

    - allow to add optional flags to dpkg-buildpackage when building
    deb-pkg

    - move some compiler option tests from Makefile to Kconfig

    - various Makefile cleanups

    * tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (40 commits)
    kbuild: remove scripts/basic/% build target
    kbuild: use -Werror=implicit-... instead of -Werror-implicit-...
    kbuild: clean up scripts/gcc-version.sh
    kbuild: remove cc-version macro
    kbuild: update comment block of scripts/clang-version.sh
    kbuild: remove commented-out INITRD_COMPRESS
    kbuild: move -gsplit-dwarf, -gdwarf-4 option tests to Kconfig
    kbuild: [bin]deb-pkg: add DPKG_FLAGS variable
    kbuild: move ".config not found!" message from Kconfig to Makefile
    kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing
    kbuild: simplify single target rules
    kbuild: remove empty rules for makefiles
    kbuild: make -r/-R effective in top Makefile for old Make versions
    kbuild: move tools_silent to a more relevant place
    kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
    kbuild: refactor cc-cross-prefix implementation
    kbuild: hardcode genksyms path and remove GENKSYMS variable
    scripts/gdb: refactor rules for symlink creation
    kbuild: create symlink to vmlinux-gdb.py in scripts_gdb target
    scripts/gdb: do not descend into scripts/gdb from scripts
    ...

    Linus Torvalds
     

27 Feb, 2019

2 commits


11 Feb, 2019

1 commit


06 Jan, 2019

2 commits


24 Dec, 2018

1 commit


23 Dec, 2018

2 commits


09 Nov, 2018

1 commit

  • Building a kernel out of tree with:

    make O=/tmp/b oldconfig
    cd /tmp/b
    make

    gives this error:

    CALL /mnt/kernel/kernel/linux/scripts/atomic/check-atomics.sh
    /bin/bash: scripts/atomic/check-atomics.sh: No such file or directory
    make[3]: *** [/mnt/kernel/kernel/linux/./Kbuild:86: old-atomics] Error 127
    make[3]: *** Waiting for unfinished jobs....

    Make the command use the proper build prerequisite which is the absolute
    path to the script.

    Reported-by: Stephen Rothwell
    Signed-off-by: Borislav Petkov
    Cc: Boqun Feng
    Cc: Linus Torvalds
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: arnd@arndb.de
    Cc: aryabinin@virtuozzo.com
    Cc: catalin.marinas@arm.com
    Cc: dvyukov@google.com
    Cc: glider@google.com
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linuxdrivers@attotech.com
    Fixes: 8d32588077bd ("locking/atomics: Check generated headers are up-to-date")
    Link: http://lkml.kernel.org/r/20181108194128.13368-1-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Borislav Petkov
     

01 Nov, 2018

1 commit

  • Now that all the generated atomic headers are in place, it would be good
    to ensure that:

    a) the headers are up-to-date when scripting changes.

    b) developers don't directly modify the generated headers.

    To ensure both of these properties, let's add a Kbuild step to check
    that the generated headers are up-to-date.

    Signed-off-by: Mark Rutland
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: catalin.marinas@arm.com
    Cc: Will Deacon
    Cc: linuxdrivers@attotech.com
    Cc: dvyukov@google.com
    Cc: Boqun Feng
    Cc: arnd@arndb.de
    Cc: aryabinin@virtuozzo.com
    Cc: glider@google.com
    Link: http://lkml.kernel.org/r/20180904104830.2975-6-mark.rutland@arm.com
    Signed-off-by: Ingo Molnar

    Mark Rutland
     

18 Nov, 2017

1 commit

  • Pull Kbuild updates from Masahiro Yamada:
    "One of the most remarkable improvements in this cycle is, Kbuild is
    now able to cache the result of shell commands. Some variables are
    expensive to compute, for example, $(call cc-option,...) invokes the
    compiler. It is not efficient to redo this computation every time,
    even when we are not actually building anything. Kbuild creates a
    hidden file ".cache.mk" that contains invoked shell commands and their
    results. The speed-up should be noticeable.

    Summary:

    - Fix arch build issues (hexagon, sh)

    - Clean up various Makefiles and scripts

    - Fix wrong usage of {CFLAGS,LDFLAGS}_MODULE in arch Makefiles

    - Cache variables that are expensive to compute

    - Improve cc-ldopton and ld-option for Clang

    - Optimize output directory creation"

    * tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits)
    kbuild: move coccicheck help from scripts/Makefile.help to top Makefile
    sh: decompressor: add shipped files to .gitignore
    frv: .gitignore: ignore vmlinux.lds
    selinux: remove unnecessary assignment to subdir-
    kbuild: specify FORCE in Makefile.headersinst as .PHONY target
    kbuild: remove redundant mkdir from ./Kbuild
    kbuild: optimize object directory creation for incremental build
    kbuild: create object directories simpler and faster
    kbuild: filter-out PHONY targets from "targets"
    kbuild: remove redundant $(wildcard ...) for cmd_files calculation
    kbuild: create directory for make cache only when necessary
    sh: select KBUILD_DEFCONFIG depending on ARCH
    kbuild: fix linker feature test macros when cross compiling with Clang
    kbuild: shrink .cache.mk when it exceeds 1000 lines
    kbuild: do not call cc-option before KBUILD_CFLAGS initialization
    kbuild: Cache a few more calls to the compiler
    kbuild: Add a cache for generated variables
    kbuild: add forward declaration of default target to Makefile.asm-generic
    kbuild: remove KBUILD_SUBDIR_ASFLAGS and KBUILD_SUBDIR_CCFLAGS
    hexagon/kbuild: replace CFLAGS_MODULE with KBUILD_CFLAGS_MODULE
    ...

    Linus Torvalds
     

16 Nov, 2017

1 commit


02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

13 Apr, 2017

1 commit


24 May, 2016

1 commit

  • Some macro's and defines are needed when parsing memory, and without
    compiling the kernel as -g3 they are not available in the debug-symbols.

    We use the pre-processor here to extract constants to a dedicated module
    for the linux debugger extensions

    Top level Kbuild is used to call in and generate the constants file,
    while maintaining dependencies on autogenerated files in
    include/generated

    Link: http://lkml.kernel.org/r/bc3df9c25f57ea72177c066a51a446fc19e2c27f.1462865983.git.jan.kiszka@siemens.com
    Signed-off-by: Kieran Bingham
    Signed-off-by: Jan Kiszka
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kieran Bingham
     

01 Jul, 2015

1 commit

  • time.o gets rebuilt unconditionally due to a leftover Makefile rule
    which was placed there for development purposes.

    Remove it along with the commented out always rule in the toplevel
    Kbuild file.

    Fixes: 0a227985d4a9 'time: Move timeconst.h into include/generated'
    Reported-by; Stephen Boyd
    Signed-off-by: Thomas Gleixner
    Cc: Nicholas Mc Guire

    Thomas Gleixner
     

19 May, 2015

1 commit

  • kernel/time/timeconst.h is moved to include/generated/ and generated
    by the top level Kbuild. This allows using timeconst.h in an earlier
    build stage.

    Signed-off-by: Nicholas Mc Guire
    Cc: Masahiro Yamada
    Cc: Sam Ravnborg
    Cc: Joe Perches
    Cc: John Stultz
    Cc: Andrew Hunter
    Cc: Paul Turner
    Cc: Michal Marek
    Link: http://lkml.kernel.org/r/1431951554-5563-1-git-send-email-hofrat@osadl.org
    Signed-off-by: Thomas Gleixner

    Nicholas Mc Guire
     

02 Apr, 2015

1 commit


25 Mar, 2015

1 commit


05 Jan, 2015

2 commits


09 Nov, 2011

1 commit


02 Nov, 2011

1 commit


29 Oct, 2010

1 commit

  • * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
    initramfs: Fix build break on symbol-prefixed archs
    initramfs: fix initramfs size calculation
    initramfs: generalize initramfs_data.xxx.S variants
    scripts/kallsyms: Enable error messages while hush up unnecessary warnings
    scripts/setlocalversion: update comment
    kbuild: Use a single clean rule for kernel and external modules
    kbuild: Do not run make clean in $(srctree)
    scripts/mod/modpost.c: fix commentary accordingly to last changes
    kbuild: Really don't clean bounds.h and asm-offsets.h

    Linus Torvalds
     

28 Oct, 2010

1 commit

  • Partially revert patch:

    commit 3234282f33b29d349bcada40204fc7c8fda7fe72
    Author: Jan Beulich
    Date: Tue Oct 19 14:52:26 2010 +0100
    x86, asm: Fix CFI macro invocations to deal with shortcomings in gas

    This breaks MN10300 arch as this changes many instances of instructions
    similar to the following:

    MOV number,D0

    which represents an immediate value load into:

    MOV (number),D0

    which the assembler then interprets as a load from absolute address.

    arch/mn10300/kernel/entry.S:64: Error: Invalid opcode/operands
    arch/mn10300/kernel/entry.S:65: Error: junk at end of line, first unrecognized character is `0'
    arch/mn10300/kernel/entry.S:74: Error: Invalid opcode/operands
    arch/mn10300/kernel/entry.S:74: Error: junk at end of line, first unrecognized character is `1'
    arch/mn10300/kernel/entry.S:75: Error: Invalid opcode/operands
    arch/mn10300/kernel/entry.S:76: Error: junk at end of line, first unrecognized character is `0'

    cc: Jan Beulich
    cc: Alexander van Heukelum
    cc: H. Peter Anvin
    cc: Ingo Molnar
    Signed-off-by: David Howells

    David Howells
     

22 Oct, 2010

1 commit

  • It turns out to generate something like this:

    printk ( ("") "something");

    The extra parentheses here break the UML compile.

    Change the sed-program to add the parentheses only for numbers.

    Reported-by: Ingo Molnar
    Signed-off-by: Alexander van Heukelum
    Acked-by: Jan Beulich
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Alexander van Heukelum
     

20 Oct, 2010

1 commit

  • gas prior to (perhaps) 2.16.90 has problems with passing non-
    parenthesized expressions containing spaces to macros. Spaces, however,
    get inserted by cpp between any macro expanding to a number and a
    subsequent + or -. For the +, current x86 gas then removes the space
    again (future gas may not do so), but for the - the space gets retained
    and is then considered a separator between macro arguments.

    Fix the respective definitions for both the - and + cases, so that they
    neither contain spaces nor make cpp insert any (the latter by adding
    seemingly redundant parentheses).

    Signed-off-by: Jan Beulich
    LKML-Reference:
    Cc: Alexander van Heukelum
    Signed-off-by: H. Peter Anvin

    Jan Beulich
     

11 Mar, 2010

1 commit

  • Commit 7d3cc8b tried to keep bounds.h and asm-offsets.h during make
    clean by filtering these out of $(clean-files), but they are listed in
    $(targets) and $(always) and thus removed automatically. Introduce a new
    $(no-clean-files) variable to really skip such files in Makefile.clean.

    Signed-off-by: Michal Marek

    Michal Marek
     

12 Dec, 2009

2 commits


26 Jul, 2008

1 commit

  • Adjust the asm symlink support so we do not create the
    symlink unless really needed.
    We check the precense of include/asm-$ARCH by checking
    for the system.h file. We may end up with a stale directory
    so it is not enough to check if the directory is present.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

20 May, 2008

1 commit

  • Since 97965478a66fbdf0f4ad5e4ecc4828f0cb548a45 ("mm: Get rid of __ZONE_COUNT")
    mmzone.h includes bounds.h.
    Calling make clean after make prepare removes bounds.h
    again so when building external modules this fails.

    Signed-off-by: Jan Blunck
    Signed-off-by: Sam Ravnborg
    --

    Jan Blunck
     

28 Apr, 2008

2 commits

  • Add the ability to pass comments into asm-offsets.h by generating asm
    output like

    -># comment line

    Mips needs this feature to preserve the comments that are in
    asm-mips/asm-offsets.h right now.

    Then remove the special handling for mips from Kbuild and convert mips to use
    the new string to include the comments.

    Cc: Ralf Baechle
    Signed-off-by: Christoph Lameter
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • The use of enums create constants that are not available to the preprocessor
    when building the kernel (f.e. MAX_NR_ZONES).

    Arch code already has a way to export constants calculated to the preprocessor
    through the asm-offsets.c file. Generate something similar for the core
    kernel through kbuild.

    Signed-off-by: Sam Ravnborg
    Signed-off-by: Christoph Lameter
    Cc: Andy Whitcroft
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Cc: Rik van Riel
    Cc: Mel Gorman
    Cc: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

11 Oct, 2007

2 commits