Skip to content
Snippets Groups Projects
  1. Oct 21, 2011
  2. Oct 17, 2011
    • Simon Glass's avatar
      Adjust dependency rules to permit per-file flags · 47508843
      Simon Glass authored
      
      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: default avatarSimon Glass <sjg@chromium.org>
      47508843
  3. Jul 26, 2011
  4. Jun 22, 2011
  5. Apr 29, 2011
    • Scott Wood's avatar
      Handle most LDSCRIPT setting centrally · 83b7e2a7
      Scott Wood authored
      
      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: default avatarScott Wood <scottwood@freescale.com>
      Tested-by: default avatarGraeme Russ <graeme.russ@gmail.com>
      83b7e2a7
  6. Mar 22, 2011
  7. Mar 21, 2011
  8. Jan 25, 2011
  9. Dec 17, 2010
    • Mike Frysinger's avatar
      config.mk: unify duplicated flag setting · 326a6945
      Mike Frysinger authored
      
      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: default avatarMike Frysinger <vapier@gentoo.org>
      326a6945
  10. Nov 27, 2010
  11. Nov 17, 2010
    • Sebastien Carlier's avatar
      Switch from archive libraries to partial linking · 6d8962e8
      Sebastien Carlier authored
      
      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: default avatarSebastien Carlier <sebastien.carlier@gmail.com>
      6d8962e8
  12. Oct 18, 2010
    • Wolfgang Denk's avatar
      Rename TEXT_BASE into CONFIG_SYS_TEXT_BASE · 14d0a02a
      Wolfgang Denk authored
      
      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: default avatarWolfgang Denk <wd@denx.de>
      14d0a02a
  13. Aug 08, 2010
    • Mike Frysinger's avatar
      config.mk: avoid -traditional-cpp on OS X 10.5 · f534c7cd
      Mike Frysinger authored
      
      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: default avatarMike Frysinger <vapier@gentoo.org>
      f534c7cd
  14. May 28, 2010
  15. May 26, 2010
  16. Apr 13, 2010
    • Peter Tyser's avatar
      ppc: Move cpu/$CPU to arch/ppc/cpu/$CPU · 8d1f2682
      Peter Tyser authored
      
      Signed-off-by: default avatarPeter Tyser <ptyser@xes-inc.com>
      8d1f2682
    • Peter Tyser's avatar
      Move lib_$ARCH directories to arch/$ARCH/lib · ea0364f1
      Peter Tyser authored
      
      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: default avatarPeter Tyser <ptyser@xes-inc.com>
      ea0364f1
    • Peter Tyser's avatar
      Change directory-specific CFLAGS to use full path · 89f39e17
      Peter Tyser authored
      
      Previously, a specific file or directory could be compiled with custom
      CFLAGS by adding a Makefile variable such as:
        CFLAGS_dlmalloc.o = <custom flags for common/dlmalloc.c>
      or
        CFLAGS_lib = <custom flags for lib directory>
      
      This method breaks down once multiple files or directories share the
      same path.  Eg FLAGS_fileA = <custom flags> would incorrectly result in
      both dir1/fileA.c and dir2/fileA.c being compiled with <custom flags>.
      
      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: default avatarPeter Tyser <ptyser@xes-inc.com>
      89f39e17
    • Peter Tyser's avatar
      Create CPUDIR variable · 03b7004d
      Peter Tyser authored
      
      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: default avatarPeter Tyser <ptyser@xes-inc.com>
      03b7004d
  17. Dec 02, 2009
    • Scott Wood's avatar
      makefiles: fixes for building build tools · d984fed0
      Scott Wood authored
      
      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
      38d299c2 (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: default avatarScott Wood <scottwood@freescale.com>
      d984fed0
  18. Oct 03, 2009
  19. Sep 10, 2009
  20. Aug 23, 2009
    • Mike Frysinger's avatar
      start a linker script helper file · 6ac9f479
      Mike Frysinger authored
      
      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: default avatarMike Frysinger <vapier@gentoo.org>
      6ac9f479
  21. Aug 21, 2009
    • Wolfgang Denk's avatar
      Fix all linker scripts for older binutils versions (pre-2.16) · 1aada9cd
      Wolfgang Denk authored
      
      Commit f62fb999 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: default avatarWolfgang Denk <wd@denx.de>
      Cc: Mike Frysinger <vapier@gentoo.org>
      1aada9cd
    • Wolfgang Denk's avatar
      ARM: compiler options cleanup - improve tool chain support · f772acf8
      Wolfgang Denk authored
      
      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: default avatarWolfgang Denk <wd@denx.de>
      Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
      Cc: Dirk Behme <dirk.behme@googlemail.com>
      Cc: Magnus Lilja <lilja.magnus@gmail.com>
      Cc: Tom Rix <Tom.Rix@windriver.com>
      Cc: Prafulla Wadaskar <prafulla@marvell.com>
      Acked-by: default avatarSergey Kubushyn <ksi@koi8.net>
      Tested-by: default avatarMagnus Lilja <lilja.magnus@gmail.com>
      Tested-by: default avatarAndrzej Wolski <awolski@poczta.fm>
      Tested-by: default avatarGaye Abdoulaye Walsimou <walsimou@walsimou.com>
      Tested-by: default avatarTom Rix <Tom.Rix@windriver.com>
      Tested-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
      f772acf8
  22. Jul 20, 2009
  23. Jul 19, 2009
  24. Jul 17, 2009
    • Shinya Kuribayashi's avatar
      config.mk: Remove $(PCI_CLOCK) reference · 12e9043c
      Shinya Kuribayashi authored
      
      The following commit introduced $(PCI_CLOCK) reference so that
      we could tweak `PCI_66M' definition via an environment variable.
      
      > commit f046ccd1
      > Author: Eran Liberty <liberty@freescale.com>
      > Date:   Thu Jul 28 10:08:46 2005 -0500
      >
      >     * Patch by Eran Liberty
      >       Add support for the Freescale MPC8349ADS board.
      
      But I suggest a removal of it for the following reasons:
      
      * In 2006, MPC8349ADS was merged into MPC8349EMDS port,
        and it seems that MPC8349EMDS port is PCI_66M free.
      
      * OTOH, PCI_66M is used by MPC832XEMDS an MPC8360EMDS ports,
        but they don't need $(PCI_CLOCK) environment variable at all.
        PCI_66M is automatically configured via $(BOARD)_config names
        with the help of $(findstring _66_,$@).
      
      * Unfortunately $(PCI_CLOCK) has been undocumented anywhere,
        so only a few people know the existence of it these days.
      
      * Keep config.mk independent from $(BOARD) as much as possible.
      
      Signed-off-by: default avatarShinya Kuribayashi <skuribay@pobox.com>
      Acked-by: default avatarKim Phillips <kim.phillips@freescale.com>
      12e9043c
  25. Jun 14, 2009
  26. Jun 12, 2009
  27. Jan 18, 2009
  28. Dec 08, 2008
  29. Sep 12, 2008
  30. Sep 06, 2008
  31. Jun 26, 2008
    • Haavard Skinnemoen's avatar
      Conditionally add -fno-stack-protector to CFLAGS · 28eab0d7
      Haavard Skinnemoen authored
      
      When compile-testing on powerpc, I get errors like this:
      
      net/nfs.c:422: undefined reference to `__stack_chk_fail_local'
      
      This seems to be because -fstack-protector is on by default, so
      let's explicitly disable it on all architectures that support the
      option.
      
      The Ubuntu toolchain is affected by this problem, and according to
      Mike Frysinger, Gentoo has been running with SSP enabled for years.
      More and more distros are turning SSP on by default, so this problem
      is likely to get worse in the future.
      
      Also, powerpc just happens to be one of the arches I do
      compile-testing on. There may be other arches affected by this too.
      
      Signed-off-by: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
      28eab0d7
  32. May 20, 2008
    • Wolfgang Denk's avatar
      Big white-space cleanup. · 53677ef1
      Wolfgang Denk authored
      
      This commit gets rid of a huge amount of silly white-space issues.
      Especially, all sequences of SPACEs followed by TAB characters get
      removed (unless they appear in print statements).
      
      Also remove all embedded "vim:" and "vi:" statements which hide
      indentation problems.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      53677ef1
  33. May 03, 2008
  34. Feb 22, 2008
Loading