Commit 7cb714a57837f1352d737ae07b56a5ce47c40431
Committed by
Anatolij Gustschin
1 parent
578f35a338
Exists in
master
and in
57 other branches
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. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Khem Raj <raj.khem@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
config.mk
| ... | ... | @@ -133,7 +133,11 @@ |
| 133 | 133 | # Include the make variables (CC, etc...) |
| 134 | 134 | # |
| 135 | 135 | AS = $(CROSS_COMPILE)as |
| 136 | -LD = $(CROSS_COMPILE)ld | |
| 136 | + | |
| 137 | +# Always use GNU ld | |
| 138 | +LD = $(shell if $(CROSS_COMPILE)ld.bfd -v > /dev/null 2>&1; \ | |
| 139 | + then echo "$(CROSS_COMPILE)ld.bfd"; else echo "$(CROSS_COMPILE)ld"; fi;) | |
| 140 | + | |
| 137 | 141 | CC = $(CROSS_COMPILE)gcc |
| 138 | 142 | CPP = $(CC) -E |
| 139 | 143 | AR = $(CROSS_COMPILE)ar |