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.
This commit is contained in:
Andrew Turner 2016-01-10 23:41:31 +00:00
parent 5ffa1d26c0
commit 84eacaf728
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293648

View File

@ -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