u-boot_2011.09, u-boot_2011.12: Always use gnu ld for LD
PATCH v3 1/1 u-boot_2011.09, u-boot_2011.12: 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
--- .../u-boot/0001-config-Always-use-GNU-ld.patch | 43 ++++++++++++++++++++ recipes-bsp/u-boot/u-boot_2011.09.bb | 3 +- recipes-bsp/u-boot/u-boot_2011.12.bb | 3 +- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 recipes-bsp/u-boot/u-boot/0001-config-Always-use-GNU-ld.patch
recipes-bsp/u-boot/u-boot/0001-config-Always-use-GNU-ld.patch new file +43 -0
@@ -0,0 +1,43 @@ +From dff01fc9346e6f4e3386536df309d2e78f03f3ee Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 21 Dec 2011 08:53:02 -0800 +Subject: [PATCH] config: Always use GNU ld + +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. + +Upstream-status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + config.mk | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/config.mk b/config.mk +index ddaa477..59b3e71 100644 +--- a/config.mk ++++ b/config.mk +@@ -126,11 +126,13 @@ cc-option = $(strip $(if $(findstring $1,$(CC_OPTIONS)),$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 +-- +1.7.5.4 +
recipes-bsp/u-boot/u-boot_2011.09.bb +2 -1
@@ -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://0001-config-Always-use-GNU-ld.patch \ file://fw_env.config \ "
recipes-bsp/u-boot/u-boot_2011.12.bb +2 -1
@@ -6,7 +6,7 @@ UBOOT_IMAGE = "u-boot-${MACHINE}-${PV}-${PR}.img" UBOOT_SYMLINK = "u-boot-${MACHINE}.img" PV = "2011.12" -PR = "r1" +PR = "r2" # No patches for other machines yet COMPATIBLE_MACHINE = "(beagleboard|pandaboard|hawkboard|am3517-evm|am37x-evm|omap3evm)"
@@ -18,6 +18,7 @@ SRC_URI = "git://www.denx.de/git/u-boot.git;protocol=git \ file://2011.12/0004-omap4-common-mount-root-RO.patch \ file://2011.12/0005-omap4-common-use-ext4-by-default.patch \ file://2011.12/U-Boot-OMAP-MMC-Add-delay-before-waiting-for-status.patch \ + file://0001-config-Always-use-GNU-ld.patch \ " # v2011.12 tag
Signature · 1 line
1.7.5.4
Quoted 3 lines · Khem Raj
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
I guess as long as GNU ld is always present alongside gold and binutils installs it under ld.bfd, the patch should work.
Quoted 1 line
Signed-off-by Khem Raj <[email protected]>
Quoted 105 lines
--- .../u-boot/0001-config-Always-use-GNU-ld.patch | 43 ++++++++++++++++++++ recipes-bsp/u-boot/u-boot_2011.09.bb | 3 +- recipes-bsp/u-boot/u-boot_2011.12.bb | 3 +- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 recipes-bsp/u-boot/u-boot/0001-config-Always-use-GNU-ld.patchrecipes-bsp/u-boot/u-boot/0001-config-Always-use-GNU-ld.patch new file +43
-0@@ -0,0 +1,43 @@ +From dff01fc9346e6f4e3386536df309d2e78f03f3ee Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 21 Dec 2011 08:53:02 -0800 +Subject: [PATCH] config: Always use GNU ld + +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. + +Upstream-status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + config.mk | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/config.mk b/config.mk +index ddaa477..59b3e71 100644 +--- a/config.mk ++++ b/config.mk +@@ -126,11 +126,13 @@ cc-option = $(strip $(if $(findstring $1,$(CC_OPTIONS)),$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 +-- +1.7.5.4 +recipes-bsp/u-boot/u-boot_2011.09.bb +2
-1@@ -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://0001-config-Always-use-GNU-ld.patch \ file://fw_env.config \ "recipes-bsp/u-boot/u-boot_2011.12.bb +2
-1@@ -6,7 +6,7 @@ UBOOT_IMAGE = "u-boot-${MACHINE}-${PV}-${PR}.img" UBOOT_SYMLINK = "u-boot-${MACHINE}.img" PV = "2011.12" -PR = "r1" +PR = "r2" # No patches for other machines yet COMPATIBLE_MACHINE = "(beagleboard|pandaboard|hawkboard|am3517-evm|am37x-evm|omap3evm)"@@ -18,6 +18,7 @@ SRC_URI = "git://www.denx.de/git/u-boot.git;protocol=git \ file://2011.12/0004-omap4-common-mount-root-RO.patch \ file://2011.12/0005-omap4-common-use-ext4-by-default.patch \ file://2011.12/U-Boot-OMAP-MMC-Add-delay-before-waiting-for-status.patch \ + file://0001-config-Always-use-GNU-ld.patch \ " # v2011.12 tagSignature · 6 lines
1.7.5.4 _______________________________________________ meta-ti mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-ti
Quoted 5 lines · Khem Raj
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 ldSigned-off-by Khem Raj <[email protected]>
But..
Quoted 1 line
+Upstream-status: Pending
I suspect Wolfgang would NAK this as he's said before that you should use the correct toolchain to build things. So perhaps Inappropriate [integration] ?
Signature · 1 line
Tom
Quoted 3 lines · Tom Rini
I suspect Wolfgang would NAK this as he's said before that you should use the correct toolchain to build things. So perhaps Inappropriate [integration] ?
Although I feel that having a fall back with in u-boot is better option since you can avoid lot of support so probably no harm in proposing it. If its not accepted we can always keep it local.