make buildworld failed with error "relocation truncated to fit: R_ARM_JUMP24 against symbol `_fini'"
Mark Millard
markmi at dsl-only.net
Mon Jan 18 19:37:23 UTC 2016
On 2016-Jan-18, at 10:22 AM, Hamza Sheikh <fehrist at codeghar.com> wrote:
>
>> Hmm. Clearly I can not count: I listed 6 files for arm and one for mips use. Please check all 6 that are for arm.
>
>> I listed 5 files and their -mlong-calls related content for arm (plus one file that has -mlong-calls for mips use). Please check all 5 files for arm for as they were when you built/build and report on what you find. The files are:
>>
>>> STATIC_CXXFLAGS+= -mlong-calls
>>> /usr/src/lib/libc++/Makefile
>>
>>> STATIC_CFLAGS+= -mlong-calls
>>> /usr/src/lib/csu/arm/Makefile
>>
>>> CFLAGS+= -mlong-calls
>>> /usr/src/usr.bin/clang/lldb/Makefile
>>
>>> CFLAGS+= -mlong-calls
>>> /usr/src/usr.bin/clang/clang/Makefile
>>
>>
>>> STATIC_CXXFLAGS+= -mlong-calls
>>> /usr/src/lib/clang/clang.lib.mk
>>
>>> ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
>>> ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
>>> ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
>>> ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
>>> /usr/src/share/mk/bsd.lib.mk
>>
>
> $ find /usr/src/ -name .svn -prune -o -name 'Makefile*' -exec grep mlong-calls {} \; -print
> STATIC_CFLAGS+= -mlong-calls
> /usr/src/lib/csu/arm/Makefile
> STATIC_CXXFLAGS+= -mlong-calls
> /usr/src/lib/libc++/Makefile
> CFLAGS+= -mlong-calls
> /usr/src/usr.bin/clang/clang/Makefile
> CFLAGS+= -mlong-calls
> /usr/src/usr.bin/clang/lldb/Makefile
>
> $ find /usr/src/ -name .svn -prune -o -name '*.mk' -exec grep mlong-calls {} \; -print
> STATIC_CXXFLAGS+= -mlong-calls
> /usr/src/lib/clang/clang.lib.mk
> CFLAGS+= -G0 -fno-pic -mno-abicalls -mlong-calls
> /usr/src/sys/conf/kmod.mk
>
> $ find /usr/src/ -name .svn -prune -o -name '*.mk' -exec grep -E 'STATIC_C[XL]|mlong-calls' {} \; -print
> STATIC_CXXFLAGS+= -mlong-calls
> /usr/src/lib/clang/clang.lib.mk
> ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
> ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
> /usr/src/share/mk/bsd.lib.mk
> CFLAGS+= -G0 -fno-pic -mno-abicalls -mlong-calls
> /usr/src/sys/conf/kmod.mk
There is a difference between your list and mine, mine has:
>> ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
>> ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
in:
>> /usr/src/share/mk/bsd.lib.mk
but yours does not. Those CC lines with the STATIC_C prefixed symbols go back years: -r227797 from 2011-Nov-21 so my guess is a copy/paste error for your note above.
I do not know why clang would separate crt1 code from crti code by a larger distance but not use a code sequence for a long call/jump when -mlong-calls is present. If it really did that then it sounds like a defect in clang/llvm 3.7.1 .
If you can tolerate tracking the 3.8.0 project ( base/projects/clang380-import ) until 3.8.0 is moved into 11.0-CURRENT you could find out that way if clang 3.8.0 behaves the same in your context. So far I've not come up with anything else to try.
--
Hamza Sheikh
Twitter: @aikchar
More information about the freebsd-arm
mailing list