19 Jan, 2016

1 commit


28 Jul, 2015

1 commit

  • Update some build scripts to match Linux 4.1. Commit-based syncing
    was done so as not to break U-Boot specific changes.
    The previous big sync was from Linux 3.18-rc1 by commit 176d09827725
    (kbuild: sync misc scripts with Linux 3.18-rc1).

    The commits imported from Linux (some with adjustments) are:

    [1] commit 9fb5e5372208973984a23ee6f5f025c05d364633
    Author: Robert Richter
    dts, kbuild: Factor out dtbs install rules to Makefile.dtbinst

    [2] commit 371fdc77af44f4cb32475fd499e1d912ccc30890
    Author: Masahiro Yamada
    kbuild: collect shorthands into scripts/Kbuild.include

    [3] commit a29b82326ed4eb5567b03c85b52c6891578d5a03
    Author: Michal Marek
    kbuild: Remove duplicate $(cmd) definition in Makefile.clean

    [4] commit 1846dfbde3e8a53f3673dcb1c1b79fd9b3f8d40d
    Author: Masahiro Yamada
    kbuild: remove redundant -rR flag of hdr-inst

    [5] commit 34948e0bbf98640fc1821751b01d2f0cd17d84d5
    Author: Michal Marek
    kbuild: Drop support for clean-rule

    [6] commit a16c5f99a28c9945165c46da27fff8e6f26f8736
    Author: Michal Marek
    kbuild: Fix removal of the debian/ directory

    [7] commit d0d38cd9e853db11e0242b3df4c9c3c4a663fbb4
    Author: Masahiro Yamada
    kbuild: use mixed-targets when two or more config targets are given

    [8] commit dd33c03b18b3f2db791eb6a17c37d2de66e4de18
    Author: Masahiro Yamada
    kbuild: fix cc-ifversion macro

    [9] commit 665d92e38f65d70796aad2b8e49e42e80815d4a4
    Author: Masahiro Yamada
    kbuild: do not add $(call ...) to invoke cc-version or cc-fullversion

    [10] commit 6dcb4e5edf39e3b65a75ca76f087b2fdbee8a808
    Author: Masahiro Yamada
    kbuild: allow cc-ifversion to have the argument for false condition

    [11] commit c0a80c0c27e5e65b180a25e6c4c2f7ef9e386cd3
    Author: Heiko Carstens
    ftrace: allow architectures to specify ftrace compile options

    [12] commit 0b24becc810dc3be6e3f94103a866f214c282394
    Author: Andrey Ryabinin
    kasan: add kernel address sanitizer infrastructure

    [13] commit 4218affdf57f938c04e3a916a9685ee27079f377
    Author: Masahiro Yamada
    kbuild: remove warning about "make depend"

    [14] commit 77479b38e2f58890eb221a0418357502a5b41cd6
    Author: Nathan Rossi
    kbuild: Create directory for target DTB

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Robert Richter
    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Andrey Ryabinin
    Signed-off-by: Nathan Rossi
    Signed-off-by: Michal Simek
    Signed-off-by: Olof Johansson
    Signed-off-by: Michal Marek
    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

25 Feb, 2015

1 commit

  • When Kconfig for U-boot was examined, one of the biggest issues was
    how to support multiple images (Normal, SPL, TPL). There were
    actually two options, "single .config" and "multiple .config".
    After some discussions and thought experiments, I chose the latter,
    i.e. to create ".config", "spl/.config", "tpl/.config" for Normal,
    SPL, TPL, respectively.

    It is true that the "multiple .config" strategy provided us the
    maximum flexibility and helped to avoid duplicating CONFIGs among
    Normal, SPL, TPL, but I have noticed some fatal problems:

    [1] It is impossible to share CONFIG options across the images.
    If you change the configuration of Main image, you often have to
    adjust some SPL configurations correspondingly. Currently, we
    cannot handle the dependencies between them. It means one of the
    biggest advantages of Kconfig is lost.

    [2] It is too painful to change both ".config" and "spl/.config".
    Sunxi guys started to work around this problem by creating a new
    configuration target. Commit cbdd9a9737cc (sunxi: kconfig: Add
    %_felconfig rule to enable FEL build of sunxi platforms.) added
    "make *_felconfig" to enable CONFIG_SPL_FEL on both images.
    Changing the configuration of multiple images in one command is a
    generic demand. The current implementation cannot propose any
    good solution about this.

    [3] Kconfig files are getting ugly and difficult to understand.
    Commit b724bd7d6349 (dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to
    Kconfig) has sprinkled "if !SPL_BUILD" over the Kconfig files.

    [4] The build system got more complicated than it should be.
    To adjust Linux-originated Kconfig to U-Boot, the helper script
    "scripts/multiconfig.sh" was introduced. Writing a complicated
    text processor is a shell script sometimes caused problems.

    Now I believe the "single .config" will serve us better. With it,
    all the problems above would go away. Instead, we will have to add
    some CONFIG_SPL_* (and CONFIG_TPL_*) options such as CONFIG_SPL_DM,
    but we will not have much. Anyway, this is what we do now in
    scripts/Makefile.spl.

    I admit my mistake with my apology and this commit switches to the
    single .config configuration.

    It is not so difficult to do that:

    - Remove unnecessary processings from scripts/multiconfig.sh
    This file will remain for a while to support the current defconfig
    format. It will be removed after more cleanups are done.

    - Adjust some makefiles and Kconfigs

    - Add some entries to include/config_uncmd_spl.h and the new file
    scripts/Makefile.uncmd_spl. Some CONFIG options that are not
    supported on SPL must be disabled because one .config is shared
    between SPL and U-Boot proper going forward. I know this is not
    a beautiful solution and I think we can do better, but let's see
    how much we will have to describe them.

    - update doc/README.kconfig

    More cleaning up patches will follow this.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass

    Masahiro Yamada
     

08 Nov, 2014

2 commits

  • This commit imports some updates in misc scripts from Linux 3.18-rc1.

    [1] commit cbb4d3e6510b99522719c5ef0 by Horia Geanta
    scripts/kernel-doc: handle object-like macros

    [2] commit 164f0d2efaaef83 by Michal Marek
    kbuild: Fix handling of backslashes in *.cmd files

    [3] commit 270a00963cd367214e by Randy Dunlap
    scripts/kernel-doc: recognize __meminit

    [4] commit a4954fd7724c0f55361eb5 by Masahiro Yamada
    kbuild: remove obj-n and lib-n handling

    [5] commit 5b2389b45d1a9c12b9f by Masahiro Yamada
    kbuild: simplify build, clean, modbuiltin shorthands

    Signed-off-by: Horia Geanta
    Signed-off-by: Michal Marek
    Signed-off-by: Randy Dunlap
    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Since Linux 3.18-rc1, Kbuild is able to handle multi-objs
    dependency correctly, which also allows us futher cleanups
    of some makefiles.

    This commit imports those commits:

    [1] commit c8589d1e9e01 by Masahiro Yamada
    kbuild: handle multi-objs dependency appropriately

    [2] commit 97e3226e6e98 by Masahiro Yamada
    kbuild: handle the dependency of multi-objs hostprogs appropriately

    [3] commit 022af62d0190 by Masahiro Yamada
    kbuild: refactor script/kconfig/Makefile

    [4] commit 221ecca6cafe by Masahiro Yamada
    kbuild: remove redundant clean-files from scripts/kconfig/Makefile

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

22 Aug, 2014

1 commit

  • This commit was imported from Linux Kernel:
    commit a86fe353 written by me.

    W=... provides extra gcc checks.

    Having such code in scripts/Makefile.build results in the same flags
    being added to KBUILD_CFLAGS multiple times becuase
    scripts/Makefile.build is invoked every time Kbuild descends into
    the subdirectories.

    Since the top Makefile is already too cluttered, this commit moves
    all of extra gcc check stuff to a new file scripts/Makefile.extrawarn,
    which is included from the top Makefile.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

30 Jul, 2014

1 commit

  • This commit enables Kconfig.
    Going forward, we use Kconfig for the board configuration.
    mkconfig will never be used. Nor will include/config.mk be generated.

    Kconfig must be adjusted for U-Boot because our situation is
    a little more complicated than Linux Kernel.
    We have to generate multiple boot images (Normal, SPL, TPL)
    from one source tree.
    Each image needs its own configuration input.

    Usage:

    Run "make _defconfig" to do the board configuration.

    It will create the .config file and additionally spl/.config, tpl/.config
    if SPL, TPL is enabled, respectively.

    You can use "make config", "make menuconfig" etc. to create
    a new .config or modify the existing one.

    Use "make spl/config", "make spl/menuconfig" etc. for spl/.config
    and do likewise for tpl/.config file.

    The generic syntax of configuration targets for SPL, TPL is:

    /

    Here, is either 'spl' or 'tpl'
    is 'config', 'menuconfig', 'xconfig', etc.

    When the configuration is done, run "make".
    (Or "make _defconfig all" will do the configuration and build
    in one time.)

    For futher information of how Kconfig works in U-Boot,
    please read the comment block of scripts/multiconfig.py.

    By the way, there is another item worth remarking here:
    coexistence of Kconfig and board herder files.

    Prior to Kconfig, we used C headers to define a set of configs.

    We expect a very long term to migrate from C headers to Kconfig.
    Two different infractructure must coexist in the interim.

    In our former configuration scheme, include/autoconf.mk was generated
    for use in makefiles.
    It is still generated under include/, spl/include/, tpl/include/ directory
    for the Normal, SPL, TPL image, respectively.

    Signed-off-by: Masahiro Yamada
    Acked-by: Simon Glass

    Masahiro Yamada
     

20 Jun, 2014

1 commit


18 Apr, 2014

1 commit

  • This commit imports Kbuild-related updates
    from v3.14 to v3.15-rc1.

    - commit 3d3d6b8474204b6819688c9800774d52d370a538
    kbuild: LLVMLinux: Adapt warnings for compilation with clang
    - commit 61163efae02040f66a95c8ed17f4407951ba58fa
    kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang
    - commit 79192ca8ebd9a25c583aa46024a250fef1e7766f
    scripts: objdiff: detect object code changes between two commits
    - commit 1c9e70a55b088d97a59241744fe459409d0c3582
    kbuild: create a build directory automatically for out-of-tree build
    - commit a03fcb50e816a69acffb13b5e56db75063aeba8a
    kbuild: remove redundant '.*.cmd' pattern from make distclean
    - commit 13338935f1574a2dcd1c891461b0dcc42f8cff42
    kbuild: move "quote" to Kbuild.include to be consistent
    - commit bfdfaeae500a3b194b73b01e92a8034791a58b7f
    kbuild: specify build_docproc as a phony target
    - commit f4d4ffc03efc864645b990e1d579bbe1b8e358a4
    kbuild: dtbs_install: new make target
    - commit 1e64ff42ea3d8d2fc8aa71f9717b3c1cb6c2f893
    Kbuild, lto: Disable LTO for asm-offsets.c
    - commit ccbef1674a1579842c7dbdf554efca85d2cd245a
    Kbuild, lto: add ld-version and ld-ifversion macros
    - commit ae63b2d7bdd9bd66b88843be0daf8e37d8f0b574
    scripts/tags.sh: Ignore *.mod.c
    - commit e36aaea28972c57a32a3ba5365e61633739719b9
    kbuild: Fix silent builds with make-4

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

07 Mar, 2014

1 commit

  • Kbuild brought about many advantages for us but a significant
    performance regression was reported by Simon Glass.

    After some discussions and analysis, it turned out
    its main cause is in $(call cc-option,...).

    Historically, U-Boot parses all config.mk
    (arch/*/config.mk and board/*/config.mk)
    every time descending into subdirectories.
    That means cc-options are evaluated over and over again.

    $(call cc-option,...) is useful but costly.
    So we want to evaluate them only in ./Makefile
    and spl/Makefile and export compiler flags.

    This commit changes the build system as follows:

    - Modify scripts/Makefile.build to not include config.mk
    Instead, add $(PLATFORM_CPPFLAGS) to asflags-y, ccflags-y,
    cppflags-y.

    - Export many variables
    Going forward, Kbuild will not parse config.mk files
    when it descends into subdirectories.
    If we want to set variables in config.mk and use them
    in subdirectories, they must be exported.

    This is the list of variables to get exported:
    PLATFORM_CPPFLAGS
    CPUDIR
    BOARDDIR
    OBJCOPYFLAGS
    LDFLAGS
    LDFLAGS_FINAL
    (used in nand_spl/board/*/*/Makefile)
    CONFIG_STANDALONE_LOAD_ADDR
    (used in examples/standalone/Makefile)
    SYM_PREFIX
    (used in examples/standalone/Makefile)
    RELFLAGS
    (used in examples/standalone/Makefile)

    - Delete CPPFLAGS
    This variable has been replaced with PLATFORM_CPPFLAGS

    - Copy gcclibdir from example/standalone/Makefile
    to arch/sparc/config.mk
    The reference in CONFIG_STANDALONE_LOAD_ADDR must be
    resolved before it is exported.

    Signed-off-by: Masahiro Yamada
    Reported-by: Simon Glass
    Acked-by: Simon Glass
    Tested-by: Simon Glass [on Sandbox]
    Tested-by: Stephen Warren [on Tegra]

    Masahiro Yamada
     

20 Feb, 2014

9 commits

  • This commit changes the location of include directives
    of board configuration files.

    The purpose of this change is:
    - Slim down $(TOPDIR)/config.mk
    - Prevent $(TOPDIR)/Makefile from including the same
    configuration file twice
    - Do not include include/config.mk multiple times
    because ARCH, CPU, BOARD, VENDOR, SOC are exported

    Before this commit:

    - include/autoconf.mk was included from $(TOPDIR)/Makefile
    and $(TOPDIR)/config.mk
    (This means $(TOPDIR)/Makefile included include/autoconf.mk twice)

    - include/{spl,tpl}-autoconf.mk was included from $(TOPDIR)/config.mk

    - include/config.mk was included from $(TOPDIR)/Makefile
    and $(TOPDIR)/config.mk
    (This means $(TOPDIR)/Makefile included include/config.mk twice)

    After this commit:

    - include/autoconf.mk is included from $(TOPDIR)/Makefile
    and $(TOPDIR)/scripts/Makefile.build

    - include/{spl,tpl}-autoconf.mk is included from $(TOPDIR)/spl/Makefile
    and $(TOPDIR)/scripts/Makefile.build

    - include/config.mk is included from $(TOPDIR)/config.mk and
    $(TOPDIR)/spl/Makefile

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Now we are ready to switch over to real Kbuild.

    This commit disables temporary scripts:
    scripts/{Makefile.build.tmp, Makefile.host.tmp}
    and enables real Kbuild scripts:
    scripts/{Makefile.build,Makefile.host,Makefile.lib}.

    This switch is triggered by the line in scripts/Kbuild.include
    -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
    +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj

    We need to adjust some build scripts for U-Boot.
    But smaller amount of modification is preferable.

    Additionally, we need to fix compiler flags which are
    locally added or removed.

    In Kbuild, it is not allowed to change CFLAGS locally.
    Instead, ccflags-y, asflags-y, cppflags-y,
    CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
    are prepared for that purpose.

    Signed-off-by: Masahiro Yamada
    Tested-by: Gerhard Sittig

    Masahiro Yamada
     
  • This commit imports build scripts from Linux Kernel v3.13
    as they are.

    I know they include some trailing spaces
    but I am intentionally keeping them untouched.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Some build scripts including scripts/Makefile.build
    will be imported from Linux Kernel in the next commit.
    We need to adjust them for U-Boot in the following commits.

    To make it easier for reviewers to track the modification,
    this commit renames scripts/Makefile.build to
    scripts/Makefile.build.tmp beforehand.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • This commit changes the working directory
    where the build process occurs.

    Before this commit, build process occurred under the source
    tree for both in-tree and out-of-tree build.

    That's why we needed to add $(obj) prefix to all generated
    files in makefiles like follows:
    $(obj)u-boot.bin: $(obj)u-boot

    Here, $(obj) is empty for in-tree build, whereas it points
    to the output directory for out-of-tree build.

    And our old build system changes the current working directory
    with "make -C " syntax when descending into the
    sub-directories.

    On the other hand, Kbuild uses a different idea
    to handle out-of-tree build and directory descending.

    The build process of Kbuild always occurs under the output tree.
    When "O=dir/to/store/output/files" is given, the build system
    changes the current working directory to that directory and
    restarts the make.

    Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj="
    syntax for descending into sub-directories.
    (We can write it like "make $(obj)=" with a shorthand.)
    This means the current working directory is always the top
    of the output directory.

    Signed-off-by: Masahiro Yamada
    Tested-by: Gerhard Sittig

    Masahiro Yamada
     
  • This commit adjusts some files to use Kbuild.include.

    - Use cc-option defined in Kbuild.include
    (Delete cc-option in config.mk)
    - Use cc-version defined in
    (Delete cc-version in config.mk)
    - Move binutils-version and dtc-version to Kbuild.include
    by analogy to cc-version

    This commit also adds srctree (same as SRCTREE)
    to use Kbuild scripts.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • This commit moves suffix rules from config.mk
    to scripts/Makefile.build, which will allow us
    to switch smoothly to real Kbuild.

    Note1:
    post/lib_powerpc/fpu/Makefile has
    its own rule to compile C sources.
    We need to tweak it to keep the same behavior.

    Note2:
    There are two file2 with the same name:
    arch/arm/lib/crt0.S and eamples/api/crt0.S.
    To keep the same build behavior,
    examples/api/Makefile also has to be treaked.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • This commit adds scripts/Makefile.host.tmp which will
    be used in the next commit to convert makefiles
    under tools/ directory to Kbuild style.

    Notice this script, scripts/Makefile.host.tmp
    is temporary.

    When switching over to real Kbuild,
    it will be replaced with scripts/Makefile.host of Linux Kernel.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

18 Nov, 2013

2 commits


01 Nov, 2013

2 commits

  • This patch tweaks scripts/Makefile.build to allow
    the build system to descend into subdirectories like Kbuild.

    To use this feature, use "obj-y += foo/" syntax.

    Example:
    obj-$(CONFIG_FOO) += foo/

    Signed-off-by: Masahiro Yamada
    Cc: Simon Glass

    Masahiro Yamada
     
  • Every makefile in sub directories has common lines
    at the top and the bottom.
    This commit pushes the common parts into script/Makefile.build.

    Going forward sub-makefiles only need to describe this part:

    COBJS := ...
    COBJS += ...
    SOBJS := ...

    But using obj-y is preferable to prepare for switching to Kbuild.

    The conventional (non-Kbuild) Makefile style is still supported.
    This is achieved by greping the Makefile before entering into it.
    U-Boot conventional sub makefiles always include some other makefiles.
    So the build system searches a line beginning with "include" keyword
    in the makefile in order to distinguish which style it is.
    If the Makefile include a "include" line, we assume it is a conventional
    U-Boot style. Otherwise, it is treated as a Kbuild-style makefile.

    With this tweak, we can switch sub-makefiles
    from U-Boot style to Kbuild style little by little.

    obj-y := foo/
    syntax (descending into the sub directory) is not supportd yet.
    It will be implemented in the upcomming commit.

    Signed-off-by: Masahiro Yamada
    Cc: Simon Glass
    Cc: Tom Rini

    Masahiro Yamada