Skip to content

Commit

Permalink
config: Always use GNU ld
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
Acked-by: Mike Frysinger <[email protected]>
  • Loading branch information
kraj authored and vdsao committed Aug 10, 2012
1 parent 578f35a commit 7cb714a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ cc-version = $(shell $(SHELL) $(SRCTREE)/tools/gcc-version.sh $(CC))
# Include the make variables (CC, etc...)
#
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld

# Always use GNU ld
LD = $(shell if $(CROSS_COMPILE)ld.bfd -v > /dev/null 2>&1; \
then echo "$(CROSS_COMPILE)ld.bfd"; else echo "$(CROSS_COMPILE)ld"; fi;)

CC = $(CROSS_COMPILE)gcc
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
Expand Down

0 comments on commit 7cb714a

Please sign in to comment.