From 84eacaf728a102612d83861d73c3aaa353ca3dc2 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Sun, 10 Jan 2016 23:41:31 +0000 Subject: [PATCH] Use -mlong-calls to build crt1.o and gcrt1.o. This tells the compiler to generate code to branch based on an address in a register. This allows us to have binaries larger than the 32MiB limit of a branch instruction. The main use of this is with clang. Clang 3.8.0 has been shown to be larger than the above limit. --- lib/csu/arm/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/csu/arm/Makefile b/lib/csu/arm/Makefile index 9747619c233..1b3a6f84213 100644 --- a/lib/csu/arm/Makefile +++ b/lib/csu/arm/Makefile @@ -7,6 +7,7 @@ OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o CFLAGS+= -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include +STATIC_CFLAGS+= -mlong-calls FILES= ${OBJS} FILESMODE= ${LIBMODE} @@ -23,14 +24,14 @@ CLEANFILES+= crt1.s gcrt1.s Scrt1.s # directly compiled to .o files. crt1.s: crt1.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c + ${CC} ${CFLAGS} ${STATIC_CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c + ${CC} ${CFLAGS} ${STATIC_CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s