Skip to contentSkip to conversation

u-boot_2011.09: Always use gnu ld for LD

PATCH Superseded Khem Raj 2 participants 3 messages Dec 20, 2011 – Dec 21, 2011 1 message not in the archive

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 u-boot_2011.09: Always use gnu ld for LD

u-boot wants GNU ld and cant link with gold
so when default linker is gold we make sure
that it still uses good old GNU ld

---
 recipes-bsp/u-boot/u-boot/always-use-bfd-ld.patch |   29 +++++++++++++++++++++
 recipes-bsp/u-boot/u-boot_2011.09.bb              |    3 +-
 2 files changed, 31 insertions(+), 1 deletions(-)
 create mode 100644 recipes-bsp/u-boot/u-boot/always-use-bfd-ld.patch
recipes-bsp/u-boot/u-boot/always-use-bfd-ld.patch new file +29 -0
new file mode 100644
index 0000000..a527317
@@ -0,0 +1,29 @@
+This patch makes sure that we always use the GNU ld. u-boot uses certain contruct
+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.
+
+Upstream-status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+
+--- a/config.mk
++++ b/config.mk
+@@ -126,11 +126,13 @@ cc-option = $(strip $(if $(findstring $1
+ 		$(if $(call cc-option-sys,$1),$1,$2)))
+ endif
+ 
++exists_bfd_ld = $(shell if $(CROSS_COMPILE)ld.bfd -v >& /dev/null; \
++		then echo "$(1)"; else echo "$(2)"; fi; )
+ #
+ # Include the make variables (CC, etc...)
+ #
+ AS	= $(CROSS_COMPILE)as
+-LD	= $(CROSS_COMPILE)ld
++LD	= $(call exists_bfd_ld, "$(CROSS_COMPILE)ld.bfd", "$(CROSS_COMPILE)ld")
+ CC	= $(CROSS_COMPILE)gcc
+ CPP	= $(CC) -E
+ AR	= $(CROSS_COMPILE)ar
recipes-bsp/u-boot/u-boot_2011.09.bb +2 -1
index 74c8518..7924fe3 100644
@@ -1,6 +1,6 @@
 require u-boot.inc
 
-PR = "r5"
+PR = "r6"
 
 # SPL build
 UBOOT_BINARY = "u-boot.img"
@@ -32,6 +32,7 @@ SRC_URI = "git://www.denx.de/git/u-boot.git;protocol=git \
            file://2011.09/0019-BeagleBoard-config-Really-switch-to-ttyO2.patch \
            file://2011.09/0020-beagleboard-add-support-for-TCT-Beacon-board.patch \
            file://2011.09/0021-beagleboard-add-support-for-scanning-loop-through-ex.patch \
+           file://always-use-bfd-ld.patch \
            file://fw_env.config \
           "
 
Signature · 1 line
1.7.5.4
#1 lore raw

Op 21 dec. 2011, om 00:54 heeft Khem Raj het volgende geschreven:

Quoted 10 lines

u-boot wants GNU ld and cant link with gold
so when default linker is gold we make sure
that it still uses good old GNU ld

---
recipes-bsp/u-boot/u-boot/always-use-bfd-ld.patch | 29 +++++++++++++++++++++
recipes-bsp/u-boot/u-boot_2011.09.bb | 3 +-

2 files changed, 31 insertions(+), 1 deletions(-)

create mode 100644 recipes-bsp/u-boot/u-boot/always-use-bfd-ld.patch

Could you make the patch itself git am-able please? This like From: and Subject are missing.

Quoted 10 lines
recipes-bsp/u-boot/u-boot/always-use-bfd-ld.patch new file +4 -0
new file mode 100644
index 0000000..a527317
@@ -0,0 +1,29 @@
+This patch makes sure that we always use the GNU ld. u-boot uses certain contruct
+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

recipes-bsp/u-boot/u-boot/always-use-bfd-ld.patch line 14

Quoted 10 lines
recipes-bsp/u-boot/u-boot/always-use-bfd-ld.patch new file +10 -0
+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.
+
+Upstream-status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+
+--- a/config.mk
++++ b/config.mk

regards,

Koen

A message that is not in the archive (sent off-list or not yet received): CAP9ODKrk1kcVHT0X24Fx+mYpZvJzvnGE7cO7F2Cc3H+PjLTP_A@mail.gmail.com

#3 lore raw

Op 21 dec. 2011, om 12:42 heeft Otavio Salvador het volgende geschreven:

Quoted 4 lines · Koen Kooi

Could you make the patch itself git am-able please? This like From: and Subject are missing.

Why?

So it can be used to contruct a git tree later on and so that things like http://patches.openembedded.org/patch/15863/ work.

For meta-ti I'd like to have every patch git-am-able with SOBs and Upstream status included as well. We're not there yet, but new patches should aim for that.

regards,

Koen