Commit Graph

11 Commits

Author SHA1 Message Date
Sebastien Carlier 6d8962e814 Switch from archive libraries to partial linking
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@gmail.com>
2010-11-17 21:02:18 +01:00
Ladislav Michl 5c97a1de19 VoiceBlue: fix linker errors
linking eeprom with libgeneric.a is not really needed and causes following
error:
../../lib_generic/libgeneric.a(string.o): In function `strcmp':
/home/ladis/src/u-boot-ti/lib_generic/string.c:152: multiple definition of `strcmp'
../../examples/standalone/libstubs.a(stubs.o):include/_exports.h:24: first defined here
make[1]: *** [eeprom.srec] Error 1

Fix undefined reference to memset generated by some versions of gcc
to zero out initialized structure on the stack:
eeprom.o: In function `eeprom':
board/voiceblue/eeprom.c:152: undefined reference to `memset'
make[1]: *** [eeprom] Error 1

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-03-07 12:36:35 -06:00
Wolfgang Denk 1aada9cd64 Fix all linker scripts for older binutils versions (pre-2.16)
Commit f62fb99941 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 <wd@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
2009-08-21 23:13:34 +02:00
Wolfgang Denk 48677a1ef5 Fix "ld: cannot find -lstubs" build error
Commit 1bc15386 moved the examples/ to examples/standalone but failed
to adapt the Makefiles that need to link against libstubs.a

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-07-22 23:53:23 +02:00
Wolfgang Denk c8a3b109f0 Cleanup out-or-tree building for some boards (.depend)
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-02 23:49:18 +02:00
Ladislav Michl 4fedfddf97 ARM: Board voiceblue update
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2008-02-04 00:17:20 +01:00
Wolfgang Denk 2b208f5308 Move "ar" flags to config.mk to allow for silent "make -s"
Based on patch by Mike Frysinger, 20 Jun 2006
2006-10-09 01:02:05 +02:00
Marian Balakowicz f93286397e Add support for a saving build objects in a separate directory.
Modifications are based on the linux kernel approach and
support two use cases:

  1) Add O= to the make command line
  'make O=/tmp/build all'

  2) Set environement variable BUILD_DIR to point to the desired location
  'export BUILD_DIR=/tmp/build'
  'make'

The second approach can also be used with a MAKEALL script
'export BUILD_DIR=/tmp/build'
'./MAKEALL'

Command line 'O=' setting overrides BUILD_DIR environent variable.

When none of the above methods is used the local build is performed and
the object files are placed in the source directory.
2006-09-01 19:49:50 +02:00
Wolfgang Denk b2f508075c Minor code cleanup 2005-08-12 23:43:12 +02:00
Wolfgang Denk e544528831 VoiceBlue update: eeprom tool can also store firmware version now.
eeprom.bin is runable by jumping at load address.
Patch by Ladislav Michl, 23 May 2005
2005-08-12 22:56:51 +02:00
wdenk 3c2b3d454d * Patch by Ladislav Michl, 05 Apr 2005:
Add support for VoiceBlue board.

* Patch by Ladislav Michl, 05 Apr 2005:
  Fix netboot_common() prototypes.

* Cleanup.
2005-04-05 23:32:21 +00:00