[source] ar71xx: fix lzma-loader build with glibc

LEDE Commits lede-commits at lists.infradead.org
Wed Dec 13 04:38:59 PST 2017


jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/eeeee885fb497bb07041575b78fca4063145edb9

commit eeeee885fb497bb07041575b78fca4063145edb9
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Wed Dec 13 11:12:11 2017 +0100

    ar71xx: fix lzma-loader build with glibc
    
    For an unknown reason gcc tries to link in crti.o when building with a
    glibc toolchain (this does not happen with other targets). Prevent this
    by telling gcc explicitly to not do that.
    
    Fixes the following build error:
    
    /home/jonas/git/lede/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/lib/gcc/mips-openwrt-linux-gnu/5.5.0/../../../../mips-openwrt-linux-gnu/lib/crti.o: In function `_init':
    (.init+0x18): relocation truncated to fit: R_MIPS_GOT16 against `__gmon_start__'
    /home/jonas/git/lede/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/lib/gcc/mips-openwrt-linux-gnu/5.5.0/../../../../mips-openwrt-linux-gnu/lib/crti.o: In function `_init':
    (.init+0x28): relocation truncated to fit: R_MIPS_CALL16 against `__gmon_start__'
    collect2: error: ld returned 1 exit status
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 target/linux/ar71xx/image/lzma-loader/src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile
index 682b31f..c54f64a 100644
--- a/target/linux/ar71xx/image/lzma-loader/src/Makefile
+++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile
@@ -33,7 +33,7 @@ BIN_FLAGS	:= -O binary -R .reginfo -R .note -R .comment -R .mdebug \
 CFLAGS		= -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
 		  -fno-strict-aliasing -fno-common -fomit-frame-pointer -G 0 \
 		  -mno-abicalls -fno-pic -ffunction-sections -pipe -mlong-calls \
-		  -fno-common -ffreestanding -fhonour-copts \
+		  -fno-common -ffreestanding -fhonour-copts -nostartfiles \
 		  -mabi=32 -march=mips32r2 \
 		  -Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap
 CFLAGS		+= -D_LZMA_PROB32



More information about the lede-commits mailing list