On Sat, 2016-01-09 at 15:03 +0100, Dimitry Andric wrote: > On 09 Jan 2016, at 04:46, Mark Millard <mar...@dsl-only.net> wrote: > > > > On 2016-Jan-7, at 2:57 PM, Dimitry Andric <dim at FreeBSD.org> > > wrote: > ... > > > FYI, I have added a -mno-movt option for this purpose upstream, > > > and > > > imported a newer snapshot into the clang380-import branch. As of > > > r293384, it now uses the new option spelling for modules, if your > > > clang > > > is 3.8.0 or higher. > > > > > > -Dimitry > > > > I've not been able to get to the point of running clang++ 3.8 on > > the rpi2 yet: R_ARM_CALL and R_ARM_JUMP24 relocation truncations > > during the cross build's buildworld interfere. > > Yes, this is caused by too large call distances. In other words, the > clang executable is getting to big to link. Apparently we need to do > some tricks with -mlongcall to fix this. As I am no arm expert, I > welcome any patch submissions. :-) > > -Dimitry >
Here's the patch I got from Andy for the clang380 branch, modified with Warner's suggestion to use MACHINE_CPUARCH instead of MACHINE. With this I can get a working arm world that will build a runnable helloworld.c (and .cc) on a dreamplug. (I.e., it appears clang 3.8.0 fixes the problem we had with clang 3.7.x where it wouldn't run at all on armv4/5 systems). I have not tried compling anything complex yet. -- Ian
Index: lib/clang/clang.lib.mk =================================================================== --- lib/clang/clang.lib.mk (revision 293584) +++ lib/clang/clang.lib.mk (working copy) @@ -6,4 +6,8 @@ LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm INTERNALLIB= +.if ${MACHINE_CPUARCH} == "arm" +STATIC_CXXFLAGS+=-mlong-calls +.endif + .include <bsd.lib.mk> Index: lib/csu/arm/Makefile =================================================================== --- lib/csu/arm/Makefile (revision 293584) +++ lib/csu/arm/Makefile (working copy) @@ -23,7 +23,7 @@ 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} -mlong-calls -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s @@ -30,7 +30,7 @@ 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} -mlong-calls -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s Index: usr.bin/clang/clang/Makefile =================================================================== --- usr.bin/clang/clang/Makefile (revision 293584) +++ usr.bin/clang/clang/Makefile (working copy) @@ -11,7 +11,11 @@ SRCS= cc1_main.cpp \ .if ${MK_SHARED_TOOLCHAIN} == "no" NO_SHARED?= yes + +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+=-mlong-calls .endif +.endif LINKS= ${BINDIR}/clang ${BINDIR}/clang++ \ ${BINDIR}/clang ${BINDIR}/clang-cpp
_______________________________________________ freebsd-toolchain@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"