Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jan 2016 23:31:37 -0800
From:      Mark Millard <markmi@dsl-only.net>
To:        fehrist@codeghar.com, freebsd-arm <freebsd-arm@freebsd.org>
Subject:   make buildworld failed with error "relocation truncated to fit: R_ARM_JUMP24 against symbol `_fini'"
Message-ID:  <3E1CC674-D534-4C33-8C96-CA9E584931C0@dsl-only.net>

next in thread | raw e-mail | index | archive | help
The jump distances involved in those cases are larger than the offset =
encoding in the instructions can indicate. The compiler must be told to =
do more than just set up for such "small" constant offsets plugged in to =
instructions by the linker/loader.

For arm the option used for this for static linking contexts is: =
-mlong-calls
(But mips can also have -mlong-calls.)

However the -mlong-calls are all in place in base/head as of: -r294031


An explanation of why you hit a problem anyway might be that you have an =
odd mix of paths in your note. For example:

> /usr/local/raspbsd/src/common/lib/csu/arm/crt1.c

is apparently not inside the tree starting at

> /usr/src

But your "steps" show /usr/src use:

> # svnlite checkout svn://svn.freebsd.org/base/head /usr/src
> . . .
> # cd /usr/src
> # svnlite update
> . . .
> # svnlite info
> Path: .
> Working Copy Root Path: /usr/src
> . . .
> # make buildworld


May be something not shown from your /etc/src.conf or some place else =
redirected things? May be you are picking up some old files from a prior =
build?



Notes about where -mlong-calls are used. . .=20

The clang 3.8.0 investigation ran into this for building clang and lldb. =
A quick scan of materials checked out from that branch (my /usr/src is =
bound to that branch) shows the following as far as what 4 Makefile* or =
2 *.mk files list the option someplace:

> # find /usr/src/ -name .svn -prune -o -name 'Makefile*' -exec grep =
mlong-calls {} \; -print
> STATIC_CXXFLAGS+=3D -mlong-calls
> /usr/src/lib/libc++/Makefile
> STATIC_CFLAGS+=3D -mlong-calls
> /usr/src/lib/csu/arm/Makefile
> CFLAGS+=3D        -mlong-calls
> /usr/src/usr.bin/clang/lldb/Makefile
> CFLAGS+=3D -mlong-calls
> /usr/src/usr.bin/clang/clang/Makefile

> # find /usr/src/ -name .svn -prune -o -name '*.mk' -exec grep =
mlong-calls {} \; -print
> STATIC_CXXFLAGS+=3D -mlong-calls
> /usr/src/lib/clang/clang.lib.mk
> CFLAGS+=3D        -G0 -fno-pic -mno-abicalls -mlong-calls
> /usr/src/sys/conf/kmod.mk

(That last one is for mips instead of arm and has been around a long =
time.)

They all are in -r294031 on base/head . (One of the 5 arm specific ones =
has been there a little longer: -r293648 .)

In order to also show the usage of the flags with the STATIC_C prefixes:

> # find /usr/src/ -name .svn -prune -o -name 'Makefile*' -exec grep -E =
'STATIC_C[XL]|mlong-calls' {} \; -print
> STATIC_CXXFLAGS+=3D -mlong-calls
> /usr/src/lib/libc++/Makefile
> STATIC_CFLAGS+=3D -mlong-calls
> /usr/src/lib/csu/arm/Makefile
> CFLAGS+=3D        -mlong-calls
> /usr/src/usr.bin/clang/lldb/Makefile
> CFLAGS+=3D -mlong-calls
> /usr/src/usr.bin/clang/clang/Makefile

> # find /usr/src/ -name .svn -prune -o -name '*.mk' -exec grep -E =
'STATIC_C[XL]|mlong-calls' {} \; -print
> STATIC_CXXFLAGS+=3D -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
> CFLAGS+=3D        -G0 -fno-pic -mno-abicalls -mlong-calls
> /usr/src/sys/conf/kmod.mk

(That last one is again for mips instead of arm and has been around a =
long time.)

(I used the base/projects/clang380-import branch materials only because =
that is what my /usr/src is currently bound to.)


While clang 3.8.0 builds normally have this large-distance issue, as far =
as I know normal clang 3.7.1 builds do not normally have large enough =
distances to create the issue. But the paths in your notes suggest =
something is not normal about your context.

Separately: I agree with Andreas Schwarz's note that doing builds and =
installs while having a tiny /tmp is likely not going to work: /tmp will =
likely run out of space even though elsewhere has lots of space =
available.

=3D=3D=3D
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E1CC674-D534-4C33-8C96-CA9E584931C0>