Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jun 2016 23:50:08 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        erichsfreebsdlist@alogt.com, freebsd-arm <freebsd-arm@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Compiling 11 on a Raspberry B+ 2 failes [not in my experience for -r301975]
Message-ID:  <71F9C259-E75C-49F0-B7DC-4719E630BD88@dsl-only.net>
In-Reply-To: <A56FE75D-AC52-48DB-9631-AD9BC31DA5FB@dsl-only.net>
References:  <A56FE75D-AC52-48DB-9631-AD9BC31DA5FB@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2016-Jun-19, at 7:41 PM, Mark Millard <markmi at dsl-only.net> wrote:

> Quoting Erich Dollansky erichsfreebsdlist at alogt.com Sun Jun 19 =
23:38:56 UTC 2016 :
>=20
>> I am trying to compile HEAD on a Raspberry and get always the =
following
>> error.
>>=20
>> Of course, compiling revision 302017 on amd64 works.
>>=20
>> Erich
>>=20
>> Last Changed Rev: 301974
>>=20
>> /usr/src/lib/csu/arm/crt1.c:(.text+0xb4): relocation truncated to
>> fit: R_ARM_CALL against symbol `atexit' defined in .text section
>> in /usr/lib/libc.a(atexit.o) =
/usr/src/lib/csu/arm/crt1.c:(.text+0xbc):
>> relocation truncated to fit: R_ARM_CALL against symbol `_init_tls'
>> defined in .text section
>> in /usr/lib/libc.a(tls.o) /usr/src/lib/csu/arm/crt1.c:(.text+0xcc):
>> relocation truncated to fit: R_ARM_CALL against symbol `atexit' =
defined
>> in .text section
>> in /usr/lib/libc.a(atexit.o) =
/usr/src/lib/csu/arm/crt1.c:(.text+0x174):
>> relocation truncated to fit: R_ARM_CALL against symbol `exit' defined
>> in .text section in /usr/lib/libc.a(exit.o) /usr/lib/crt1.o: In
>> function `finalizer': /usr/src/lib/csu/arm/crt1.c:(.text+0x1ec):
>> relocation truncated to fit: R_ARM_JUMP24 against symbol `_fini'
>> defined in .fini section in /usr/lib/crti.o c++: error: linker =
command
>> failed with exit code 1 (use -v to see invocation) *** Error code 1
>>=20
>> Stop.
>> bmake[4]: stopped in /usr/src.head/usr.bin/clang/clang
>> *** Error code 1
>>=20
>> Stop.
>> bmake[3]: stopped in /usr/src.head/usr.bin/clang
>> *** Error code 1
>>=20
>> Stop.
>> bmake[2]: stopped in /usr/src.head
>> *** Error code 1
>>=20
>> Stop.
>> bmake[1]: stopped in /usr/src.head
>> *** Error code 1
>>=20
>> Stop.
>> make: stopped in /usr/src.head
>> [raspberry2]~/System (root) >=20
>=20
>=20
> I've done buildworld buildkernel for -r301975 on an rpi2 (not using  =
WITH_META_MODE=3Dyes) with no problem. The rpi2 was already running =
-r301975 via a amd64 -> rpi2 cross build.
>=20
> You do not mention what vintage of 11.0 your -r301974 build was =
started from. A
>=20
> uname -apKU
>=20
> output would be appropriate to post as one way of indicating that.

I went back and looked up my old notes from 2016-Jan-18 ( =
https://lists.freebsd.org/pipermail/freebsd-arm/2016-January/013053.html =
) and it indicates that one must use 11.0 -r294031 or later to build =
clang 3.8.0.

The issue is clang 3.8.0 being bigger and needing -mlong-calls compiler =
options in more places than the older clang 3.7.1 did.

Quoting from the 2016-Jan-18 message. . .

> 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:
>=20
> > # 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
>=20
>=20
> > # 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
>=20
>=20
> (That last one is for mips instead of arm and has been around a long =
time.)

[Back to quoting the recent message. . .]

> My WITH_META_MODE=3Dyes buidlworld buildkernel is still in process.

The WITH_META_MODE=3Dyes build also completed fine. [WITH_META_MODE=3Dyes =
is a recent addition to the build environment.]

> Later below list my src.conf showing my slightly odd choices targeting =
armv7-a/cortex-a7 explicitly. I'd be surprised if that makes a =
difference for this issue. You have not provided your src.conf or =
make.conf or other such context.
>=20
> My -r301975 cross builds on amd64 targeting an rpi2 =
[armv7-a/cortex-a7] have all worked fine (no matter if =
WITH_META_MODE_yes was in use or not).
>=20
> I've only used the system clang 3.8.0 to target armv6 in modern times.
>=20
> My src.conf for rpi2 self hosted builds looks like:
>=20
>> # more ~/src.configs/src.conf.rpi2-clang-bootstrap.rpi2-host=20
>> TO_TYPE=3Darmv6
>> #
>> KERNCONF=3DRPI2-NODBG
>> TARGET=3Darm
>> .if ${.MAKE.LEVEL} =3D=3D 0
>> TARGET_ARCH=3D${TO_TYPE}
>> .export TARGET_ARCH
>> .endif
>> #
>> #WITH_CROSS_COMPILER=3D
>> WITH_SYSTEM_COMPILER=3D
>> #
>> #CPUTYPE=3Dsoft
>> WITH_LIBSOFT=3D
>> WITH_LIBCPLUSPLUS=3D
>> WITH_BINUTILS_BOOTSTRAP=3D
>> #WITHOUT_CLANG_BOOTSTRAP=3D
>> WITH_CLANG=3D
>> WITH_CLANG_IS_CC=3D
>> WITH_CLANG_FULL=3D
>> WITH_CLANG_EXTRAS=3D
>> WITH_LLDB=3D
>> #
>> WITH_BOOT=3D
>> WITHOUT_LIB32=3D
>> #
>> WITHOUT_ELFTOOLCHAIN_BOOTSTRAP=3D
>> WITHOUT_GCC_BOOTSTRAP=3D
>> WITHOUT_GCC=3D
>> WITHOUT_GCC_IS_CC=3D
>> WITHOUT_GNUCXX=3D
>> #
>> NO_WERROR=3D
>> #WERROR=3D
>> MALLOC_PRODUCTION=3D
>> #
>> WITH_DEBUG_FILES=3D
>> #
>> XCFLAGS+=3D -march=3Darmv7-a -mcpu=3Dcortex-a7
>> XCXXFLAGS+=3D -march=3Darmv7-a -mcpu=3Dcortex-a7
>> # There is no XCPPFLAGS but XCPP ets XCFLAGS content.
>=20
> The ~/src.configs/make.conf is empty.
>=20
> The amd64 -> rpi2 cross builds are only different for src.conf by:
>=20
>> # diff ~/src.configs/src.conf.rpi2-clang-bootstrap.rpi2-host =
~/src.configs/src.conf.rpi2-clang-bootstrap.amd64-host=20
>> 10,11c10,11
>> < #WITH_CROSS_COMPILER=3D
>> < WITH_SYSTEM_COMPILER=3D
>> ---
>>> WITH_CROSS_COMPILER=3D
>>> WITHOUT_SYSTEM_COMPILER=3D
>> 17c17
>> < #WITHOUT_CLANG_BOOTSTRAP=3D
>> ---
>>> WITH_CLANG_BOOTSTRAP=3D
>=20
>=20
> Showing the "on a rpi2" script that runs make for using =
WITH_META_MODE=3Dyes :
>=20
>> # more =
~/sys_build_scripts.rpi2-host/make_rpi2_nodebug_clang_bootstrap-rpi2-host.=
sh=20
>> kldload -n filemon && \
>> script =
~/sys_typescripts/typescript_make_rpi2_nodebug_clang_bootstrap-rpi2-host-$=
(date +%Y-%m-%d:%H:%M:%S) \
>> env __MAKE_CONF=3D"/root/src.configs/make.conf" =
SRC_ENV_CONF=3D"/root/src.configs/src.conf.rpi2-clang-bootstrap.rpi2-host"=
 \
>> WITH_META_MODE=3Dyes \
>> MAKEOBJDIRPREFIX=3D"/usr/obj/clang/arm.armv6" \
>> make $*
>=20
> My /usr/src tree has some changes/additions --but mostly for powerpc64 =
and powerpc issues:
>=20
>> # svnlite status /usr/src/
>> M       =
/usr/src/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
>> M       /usr/src/lib/csu/powerpc64/Makefile
>> ?       /usr/src/sys/amd64/include/include
>> ?       /usr/src/sys/arm/conf/RPI2-NODBG
>> ?       /usr/src/sys/arm/include/include
>> M       /usr/src/sys/boot/ofw/Makefile.inc
>> M       /usr/src/sys/boot/powerpc/Makefile
>> M       /usr/src/sys/boot/powerpc/Makefile.inc
>> M       /usr/src/sys/boot/uboot/Makefile.inc
>> M       /usr/src/sys/conf/Makefile.powerpc
>> M       /usr/src/sys/conf/kern.mk
>> M       /usr/src/sys/conf/kmod.mk
>> M       /usr/src/sys/dev/cxgb/ulp/tom/cxgb_listen.c
>> M       /usr/src/sys/dev/cxgbe/tom/t4_listen.c
>> ?       /usr/src/sys/powerpc/conf/GENERIC64-NODBG
>> ?       /usr/src/sys/powerpc/conf/GENERIC64vtsc
>> ?       /usr/src/sys/powerpc/conf/GENERIC64vtsc-NODEBUG
>> ?       /usr/src/sys/powerpc/conf/GENERICvtsc
>> ?       /usr/src/sys/powerpc/conf/GENERICvtsc-NODEBUG
>> ?       /usr/src/sys/powerpc/include/include
>> M       /usr/src/sys/powerpc/ofw/ofw_machdep.c
>> M       /usr/src/sys/powerpc/powerpc/exec_machdep.c
>> ?       /usr/src/sys/x86/include/include
>=20
> (The include/include ones are from something making links pointing =
back up to the parent include/ . I did not explicitly create these.)
>=20
> (The cxbg and cxbge ones were from trying to have amd64 target amd64 =
via xtoolchain (devel/amd64-gcc). But other places also stopped it and I =
quit trying that for now.)
>=20
>=20
> =3D=3D=3D
> Mark Millard
> markmi at dsl-only.net


=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?71F9C259-E75C-49F0-B7DC-4719E630BD88>