22 Oct, 2012

1 commit

  • This patch adds essential components for generation of the contents of
    the linker section that is used by the linker-generated array. All of
    the contents is held in a separate file, u-boot.lst, which is generated
    at runtime just before U-Boot is linked.

    The purpose of this code is to especially generate the appropriate
    boundary symbols around each subsection in the section carrying the
    linker-generated arrays. Obviously, the interim linker code for actual
    placement of the variables into the section is generated too. The
    generated file, u-boot.lst, is included into u-boot.lds via the linker
    INCLUDE directive in u-boot.lds .

    Adjustments are made in the Makefile and spl/Makefile so that the
    u-boot.lds and u-boot-spl.lds depend on their respective .lst files.

    Signed-off-by: Marek Vasut
    Cc: Joe Hershberger
    Cc: Mike Frysinger
    Acked-by: Joe Hershberger
    Tested-by: Joe Hershberger

    Marek Vasut
     

16 Oct, 2012

3 commits

  • Add support for running source code checkers on u-boot source, e.g.,
    using sparse to aid with typechecking. This comes in especially
    handy as SoC vendors mix and match cores and devices with different
    endianness, thus here we add CHECK_ENDIAN to the otherwise linux
    kernel default CHECKFLAGS.

    Signed-off-by: Kim Phillips

    Kim Phillips
     
  • Compile drivers/serial/serial.c by default both into SPL and into
    non-SPL builds, since CONFIG_SERIAL_MULTI is now the default state.
    Also having common/serial.c in by default now, it's pointless to keep
    -DCONFIG_SERIAL_MULTI in CPPFLAGS any longer, so remove it as well.

    Signed-off-by: Marek Vasut
    Cc: Marek Vasut
    Cc: Tom Rini
    Cc: Anatolij Gustschin
    Cc: Stefan Roese

    Marek Vasut
     
  • Enable CONFIG_SERIAL_MULTI for all builds of U-Boot. That includes
    both SPL builds and non-SPL builds, everything. To avoid poluting
    this patch with removal of ifdef-endif constructions containing
    CONFIG_SERIAL_MULTI, the CONFIG_SERIAL_MULTI is temporarily added
    into CPPFLAGS in config.mk . This will be again removed in following
    patch.

    Signed-off-by: Marek Vasut
    Cc: Marek Vasut
    Cc: Tom Rini

    Marek Vasut
     

04 Oct, 2012

1 commit


11 Aug, 2012

1 commit

  • This patch makes sure that we always use the GNU ld. U-Boot uses certain
    construct e.g. OVERLAY which are not implemented in gold therefore it
    always needs GNU ld for linking.

    It works well if default linker in toolchain is GNU ld but in some
    cases we can have gold to be the default linker and also ship GNU ld
    but not as default in such cases its called $(PREFIX)ld.bfd, with this
    patch we make sure that if $(PREFIX)ld.bfd exists than we use that for
    our ld.

    This way it does not matter what the default ld is.

    Signed-off-by: Otavio Salvador
    Signed-off-by: Khem Raj
    Acked-by: Mike Frysinger

    Khem Raj
     

07 Jul, 2012

1 commit

  • On x600 (SPEAr600) U-Boot is appended to U-Boot SPL. Both images are
    created using mkimage (crc etc), so that the ROM bootloader can check
    its integrity. Padding needs to be done to the SPL image (with
    mkimage header) and not the binary. Otherwise the resulting image
    which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
    The resulting image containing both U-Boot images is called u-boot.spr.

    Signed-off-by: Stefan Roese
    Cc: Amit Virdi
    Cc: Vipin Kumar

    Stefan Roese
     

15 May, 2012

1 commit


27 Mar, 2012

2 commits


08 Nov, 2011

1 commit


04 Nov, 2011

1 commit

  • U-Boot Makefiles contain a number of tests for compiler features etc.
    which so far are executed again and again. On some architectures
    (especially ARM) this results in a large number of calls to gcc.

    This patch makes sure to run such tests only once, thus largely
    reducing the number of "execve" system calls.

    Example: number of "execve" system calls for building the "P2020DS"
    (Power Architecture) and "qong" (ARM) boards, measured as:
    -> strace -f -e trace=execve -o /tmp/foo ./MAKEALL
    -> grep execve /tmp/foo | wc -l

    Before: After: Reduction:
    ==================================
    P2020DS 20555 15205 -26%
    qong 31692 14490 -54%

    As a result, built times are significantly reduced, typically by
    30...50%.

    Signed-off-by: Wolfgang Denk
    Cc: Andy Fleming
    Cc: Kumar Gala
    Cc: Albert Aribaud
    cc: Graeme Russ
    cc: Mike Frysinger
    Tested-by: Graeme Russ
    Tested-by: Matthias Weisser
    Tested-by: Sanjeev Premi
    Tested-by: Simon Glass
    Tested-by: Macpaul Lin
    Acked-by: Mike Frysinger

    Wolfgang Denk
     

27 Oct, 2011

1 commit

  • This new option allows U-Boot to embed a binary device tree into its image
    to allow run-time control of peripherals. This device tree is for U-Boot's
    own use and is not necessarily the same one as is passed to the kernel.

    The device tree compiler output should be placed in the $(obj)
    rooted tree. Since $(OBJCOPY) insists on adding the path to the
    generated symbol names, to ensure consistency it should be
    invoked from the directory where the .dtb file is located and
    given the input file name without the path.

    This commit contains my entry for the ugliest Makefile / shell interaction
    competition.

    Signed-off-by: Simon Glass

    Simon Glass
     

22 Oct, 2011

1 commit


18 Oct, 2011

1 commit

  • The dependency rules are currently done in a shell 'for' loop. This does not
    permit Makefile variables to adjust preprocessor flags as is done with normal
    compile flags, using the CFLAGS_path/file.o syntax.

    This change moves the dependency generation into the Makefile itself, and
    permits a CPPFLAGS_path/file.o to adjust preprocessor flags on a file or
    directory basis.

    The CPPFLAGS_... variable is also folded into CFLAGS during the build.

    Signed-off-by: Simon Glass

    Simon Glass
     

26 Jul, 2011

2 commits


23 Jun, 2011

1 commit

  • LDSCRIPT is used only from the top-level Makefile and only when the
    system is configured so we can move LDSCRIPT and CONFIG_SYS_LDSCRIPT
    related logic into the top level Makefile and under configured condition
    to avoid errors when building tools from unconfigured tree.

    Signed-off-by: Ilya Yanok
    Acked-by: Mike Frysinger

    Ilya Yanok
     

30 Apr, 2011

1 commit

  • Currently, some linker scripts are found by common code in config.mk.
    Some are found using CONFIG_SYS_LDSCRIPT, but the code for that is
    sometimes in arch config.mk and sometimes in board config.mk. Some
    are found using an arch-specific rule for looking in CPUDIR, etc.

    Further, the powerpc config.mk rule relied on CONFIG_NAND_SPL
    when it really wanted CONFIG_NAND_U_BOOT -- which covered up the fact
    that not all NAND_U_BOOT builds actually wanted CPUDIR/u-boot-nand.lds.

    Replace all of this -- except for a handful of boards that are actually
    selecting a linker script in a unique way -- with centralized ldscript
    finding.

    If board code specifies LDSCRIPT, that will be used.
    Otherwise, if CONFIG_SYS_LDSCRIPT is specified, that will be used.

    If neither of these are specified, then the central config.mk will
    check for the existence of the following, in order:

    $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds (only if CONFIG_NAND_U_BOOT)
    $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds (only if CONFIG_NAND_U_BOOT)
    $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
    $(TOPDIR)/$(CPUDIR)/u-boot.lds

    Some boards (sc3, cm5200, munices) provided their own u-boot.lds that
    were dead code, because they were overridden by a CPUDIR u-boot.lds under
    the old powerpc rules. These boards' own u-boot.lds have bitrotted and
    no longer work -- these lds files have been removed.

    Signed-off-by: Scott Wood
    Tested-by: Graeme Russ

    Scott Wood
     

23 Mar, 2011

1 commit

  • commit 8aba9dceebb14144e07d19593111ee3a999c37fc
    Divides variable of linker flags to LDFLAGS-u-boot and LDFLAGS

    breaks the usage of --gc-section to build nand_spl. We still need linker option
    --gc-section for every uboot image, not only the main one. LDFLAGS_FINAL passes
    the --gc-sections to each uboot image.

    To get the proper linker flags, we use LDFLAGS and LDFLAGS_FINAL to replace
    PLATFORM_LDFLAGS in the Makefile of each nand_spl board.

    Signed-off-by: Scott Wood
    Signed-off-by: Haiying Wang

    Haiying Wang
     

22 Mar, 2011

1 commit


26 Jan, 2011

1 commit


18 Dec, 2010

1 commit

  • Multiple rules are using the expanded AFLAGS/CFLAGS settings and some are
    getting so long that the rules need to be line wrapped. So unify them in
    one variable, use that variable in the rule, and then unwrap things. This
    makes the actual `make` output nicer as it doesn't have line continuations
    in it anymore.

    Signed-off-by: Mike Frysinger

    Mike Frysinger
     

28 Nov, 2010

1 commit


18 Nov, 2010

1 commit

  • Before this commit, weak symbols were not overridden by non-weak symbols
    found in archive libraries when linking with recent versions of
    binutils. As stated in the System V ABI, "the link editor does not
    extract archive members to resolve undefined weak symbols".

    This commit changes all Makefiles to use partial linking (ld -r) instead
    of creating library archives, which forces all symbols to participate in
    linking, allowing non-weak symbols to override weak symbols as intended.
    This approach is also used by Linux, from which the gmake function
    cmd_link_o_target (defined in config.mk and used in all Makefiles) is
    inspired.

    The name of each former library archive is preserved except for
    extensions which change from ".a" to ".o". This commit updates
    references accordingly where needed, in particular in some linker
    scripts.

    This commit reveals board configurations that exclude some features but
    include source files that depend these disabled features in the build,
    resulting in undefined symbols. Known such cases include:
    - disabling CMD_NET but not CMD_NFS;
    - enabling CONFIG_OF_LIBFDT but not CONFIG_QE.

    Signed-off-by: Sebastien Carlier

    Sebastien Carlier
     

19 Oct, 2010

1 commit

  • The change is currently needed to be able to remove the board
    configuration scripting from the top level Makefile and replace it by
    a simple, table driven script.

    Moving this configuration setting into the "CONFIG_*" name space is
    also desirable because it is needed if we ever should move forward to
    a Kconfig driven configuration system.

    Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     

09 Aug, 2010

1 commit

  • Simply trying to include a basic header file like stdlib.h on OS X 10.5
    and then building with -traditional-cpp fails with lots of errors like:
    In file included from /usr/include/stdlib.h:63,
    from test.c:3:
    /usr/include/available.h:85: error: stray '#' in program
    /usr/include/available.h:85: error: syntax error before numeric constant
    /usr/include/available.h:86: error: stray '#' in program

    In the past, I hadn't noticed because the old logic for these flags were
    restricted to Darwin running on PowerPC systems while I'm running on an
    Intel system. But after some recent clean ups and changes, the flag was
    being applied to all Darwin systems and my host tools broke.

    Signed-off-by: Mike Frysinger

    Mike Frysinger
     

28 May, 2010

1 commit


27 May, 2010

1 commit

  • Compiling tools subdirectory on Mac OS X 10.6 (Snow Leopard) complains about
    wrong syntax in system includes.

    In file included from /usr/include/stdio.h:444,
    from ../source/u-boot/include/compiler.h:26,
    from ../source/u-boot/lib/crc32.c:15:
    /usr/include/secure/_stdio.h:46: error: syntax error in macro parameter list

    This can be fixed by reverting the workaround for prior OS X releases in
    config.mk conditionally for OS X 10.6+.

    Signed-off-by: Andreas Bießmann
    Acked-by: Mike Frysinger

    Andreas Biessmann
     

13 Apr, 2010

4 commits

  • Signed-off-by: Peter Tyser

    Peter Tyser
     
  • Also move lib_$ARCH/config.mk to arch/$ARCH/config.mk

    This change is intended to clean up the top-level directory structure
    and more closely mimic Linux's directory organization.

    Signed-off-by: Peter Tyser

    Peter Tyser
     
  • Previously, a specific file or directory could be compiled with custom
    CFLAGS by adding a Makefile variable such as:
    CFLAGS_dlmalloc.o =
    or
    CFLAGS_lib =

    This method breaks down once multiple files or directories share the
    same path. Eg FLAGS_fileA = would incorrectly result in
    both dir1/fileA.c and dir2/fileA.c being compiled with .

    This change allows finer grained control which we need once we move
    lib_$ARCH to arch/$ARCH/lib/ and lib_generic/ to lib/. Without this
    change all lib/ directories would share the same custom CFLAGS.

    Signed-off-by: Peter Tyser

    Peter Tyser
     
  • The CPUDIR variable points to the location of a target's CPU directory.
    Currently, it is set to cpu/$CPU. However, using $CPUDIR will allow for
    more flexibility in the future. It lays the groundwork for reorganizing
    U-Boot's directory structure to support a layout such as:

    arch/$ARCH/cpu/$CPU/* (architecture with multiple CPU types)
    arch/$ARCH/cpu/* (architecture with one CPU type)

    Signed-off-by: Peter Tyser

    Peter Tyser
     

03 Dec, 2009

1 commit

  • Currently, some of the tools instead set CC to be HOSTCC in order to re-use
    some pattern rules -- but this fails when the user overrides CC on the make
    command line. Also, the HOSTCFLAGS in tools/Makefile are currently not
    being used because config.mk overwrites them.

    This patch adds static pattern rules for files that have been requested to
    be built with the native compiler using $(HOSTSRCS) and $(HOSTOBJS), and
    converts the tools to use them.

    It restores easylogo to using the host compiler, which was broken by commit
    38d299c2db81bd889c601b5dfc12c4e83ef83333 (if this was an intentional change,
    please let me know -- but it seems to be a build tool).

    It restores -pedantic and the special flags for darwin and cygwin that were
    requested in tools/makefile (but keeps the flags added by config.mk) --
    hopefully someone can test this on those platforms. It no longer
    conditionalizes -pedantic on not being darwin; it wasn't clear that that was
    intentional, and unless there's a real problem it's just inviting people to
    contribute non-pedantic patches to those files (I'm not a fan of -pedantic
    personally, but if it's on for one platform it should be on for all).

    HOST_LDFLAGS is renamed HOSTLDFLAGS for consistency with the previous
    HOST_CFLAGS to HOSTCFLAGS rename. A new HOSTCFLAGS_NOPED is made available
    for those files which currently cannot be built with -pedantic, and replaces
    the old FIT_CFLAGS.

    imls now uses the cross compiler properly, rather than by trying to
    reconstruct CC using the typoed $(CROSS_COMPILER).

    envcrc.c is now dependency-processed unconditionally -- previously it would
    be built without being on (HOST)SRCS if CONFIG_ENV_IS_EMBEDDED was not
    selected.

    Signed-off-by: Scott Wood

    Scott Wood
     

10 Sep, 2009

1 commit


24 Aug, 2009

1 commit

  • Start a common header file for common linker script code (such as
    workarounds for older linkers) rather than doing this in the build system.

    As fallout, we no longer execute the linker every time config.mk is
    included by a build file (which can easily be 70+ times), but rather only
    execute it once.

    This also fixes a bug in the major version checking by creating a macro to
    easily compare versions and keep people from making the same common
    mistake (forgetting to check major and minor together).

    Signed-off-by: Mike Frysinger

    Mike Frysinger
     

22 Aug, 2009

2 commits

  • Commit f62fb99941c6 fixed handling of all rodata sections by using a
    wildcard combined with calls to ld's builtin functions SORT_BY_ALIGNMENT()
    and SORT_BY_NAME(). Unfortunately these functions were only
    introduced with biunutils version 2.16, so the modification broke
    building with all tool chains using older binutils.

    This patch makes it work again. This is done by omitting the use of
    these functions for such old tool chains. This will result in
    slightly larger target binaries, as the rodata sections are no longer
    in optimal order alignment-wise which reauls in unused gaps, but the
    effect was found to be insignificant - especially compared to the fact
    that you cannot build U-Boot at all in the current state.

    As ld seems to have no support for conditionals we run the linker
    script through the C preprocessor which can be easily used to remove
    the unwanted function calls.

    Note that the C preprocessor must be run with the "-ansi" (or a
    "-std=") option to make sure all the system-specific predefined
    macros outside the reserved namespace are suppressed. Otherise, cpp
    might for example substitute "powerpc" to "1", thus corrupting for
    example "OUTPUT_ARCH(powerpc)" etc.

    Signed-off-by: Wolfgang Denk
    Cc: Mike Frysinger

    Wolfgang Denk
     
  • For some time there have been repeated reports about build problems
    with some ARM (cross) tool chains. Especially issues about
    (in)compatibility with the tool chain provided runtime support
    library libgcc.a caused to add and support a private implementation
    of such runtime support code in U-Boot. A closer look at the code
    indicated that some of these issues are actually home-made. This
    patch attempts to clean up some of the most obvious problems and make
    building of U-Boot with different tool chains easier:

    - Even though all ARM systems basicy used the same compiler options
    to select a specific ABI from the tool chain, the code for this was
    distributed over all cpu/*/config.mk files. We move this one level
    up into lib_arm/config.mk instead.

    - So far, we only checked if "-mapcs-32" was supported by the tool
    chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
    selected, no matter if the tool chain actually understood this
    option. There was no support for EABI conformant tool chains.
    This patch implements the following logic:

    1) If the tool chain supports
    "-mabi=aapcs-linux -mno-thumb-interwork"
    we use these options (EABI conformant tool chain).
    2) Otherwise, we check first if
    "-mapcs-32"
    is supported, and then check for
    "-mabi=apcs-gnu"
    If one test succeeds, we use the first found option.
    3) In case 2), we also test if "-mno-thumb-interwork", and use
    this if the test succeeds. [For "-mabi=aapcs-linux" we set
    "-mno-thumb-interwork" mandatorily.]

    This way we use a similar logic for the compile options as the
    Linux kernel does.

    - Some EABI conformant tool chains cause external references to
    utility functions like raise(); such functions are provided in the
    new file lib_arm/eabi_compat.c

    Note that lib_arm/config.mk gets parsed several times, so we must
    make sure to add eabi_compat.o only once to the linker list.

    Signed-off-by: Wolfgang Denk
    Cc: Jean-Christophe PLAGNIOL-VILLARD
    Cc: Dirk Behme
    Cc: Magnus Lilja
    Cc: Tom Rix
    Cc: Prafulla Wadaskar
    Acked-by: Sergey Kubushyn
    Tested-by: Magnus Lilja
    Tested-by: Andrzej Wolski
    Tested-by: Gaye Abdoulaye Walsimou
    Tested-by: Tom Rix
    Tested-by: Jean-Christophe PLAGNIOL-VILLARD

    Wolfgang Denk
     

21 Jul, 2009

1 commit


20 Jul, 2009

1 commit