Compiling 11 on a Raspberry B+ 2 failes [not in my experience for -r301975]
Mark Millard
markmi at dsl-only.net
Mon Jun 20 06:50:13 UTC 2016
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 :
>
>> I am trying to compile HEAD on a Raspberry and get always the following
>> error.
>>
>> Of course, compiling revision 302017 on amd64 works.
>>
>> Erich
>>
>> Last Changed Rev: 301974
>>
>> /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
>>
>> Stop.
>> bmake[4]: stopped in /usr/src.head/usr.bin/clang/clang
>> *** Error code 1
>>
>> Stop.
>> bmake[3]: stopped in /usr/src.head/usr.bin/clang
>> *** Error code 1
>>
>> Stop.
>> bmake[2]: stopped in /usr/src.head
>> *** Error code 1
>>
>> Stop.
>> bmake[1]: stopped in /usr/src.head
>> *** Error code 1
>>
>> Stop.
>> make: stopped in /usr/src.head
>> [raspberry2]~/System (root) >
>
>
> I've done buildworld buildkernel for -r301975 on an rpi2 (not using WITH_META_MODE=yes) with no problem. The rpi2 was already running -r301975 via a amd64 -> rpi2 cross build.
>
> You do not mention what vintage of 11.0 your -r301974 build was started from. A
>
> uname -apKU
>
> 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:
>
> > # find /usr/src/ -name .svn -prune -o -name 'Makefile*' -exec grep mlong-calls {} \; -print
> > 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
>
>
> > # 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
>
>
> (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=yes buidlworld buildkernel is still in process.
The WITH_META_MODE=yes build also completed fine. [WITH_META_MODE=yes 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.
>
> 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).
>
> I've only used the system clang 3.8.0 to target armv6 in modern times.
>
> My src.conf for rpi2 self hosted builds looks like:
>
>> # more ~/src.configs/src.conf.rpi2-clang-bootstrap.rpi2-host
>> TO_TYPE=armv6
>> #
>> KERNCONF=RPI2-NODBG
>> TARGET=arm
>> .if ${.MAKE.LEVEL} == 0
>> TARGET_ARCH=${TO_TYPE}
>> .export TARGET_ARCH
>> .endif
>> #
>> #WITH_CROSS_COMPILER=
>> WITH_SYSTEM_COMPILER=
>> #
>> #CPUTYPE=soft
>> WITH_LIBSOFT=
>> WITH_LIBCPLUSPLUS=
>> WITH_BINUTILS_BOOTSTRAP=
>> #WITHOUT_CLANG_BOOTSTRAP=
>> WITH_CLANG=
>> WITH_CLANG_IS_CC=
>> WITH_CLANG_FULL=
>> WITH_CLANG_EXTRAS=
>> WITH_LLDB=
>> #
>> WITH_BOOT=
>> WITHOUT_LIB32=
>> #
>> WITHOUT_ELFTOOLCHAIN_BOOTSTRAP=
>> WITHOUT_GCC_BOOTSTRAP=
>> WITHOUT_GCC=
>> WITHOUT_GCC_IS_CC=
>> WITHOUT_GNUCXX=
>> #
>> NO_WERROR=
>> #WERROR=
>> MALLOC_PRODUCTION=
>> #
>> WITH_DEBUG_FILES=
>> #
>> XCFLAGS+= -march=armv7-a -mcpu=cortex-a7
>> XCXXFLAGS+= -march=armv7-a -mcpu=cortex-a7
>> # There is no XCPPFLAGS but XCPP ets XCFLAGS content.
>
> The ~/src.configs/make.conf is empty.
>
> The amd64 -> rpi2 cross builds are only different for src.conf by:
>
>> # diff ~/src.configs/src.conf.rpi2-clang-bootstrap.rpi2-host ~/src.configs/src.conf.rpi2-clang-bootstrap.amd64-host
>> 10,11c10,11
>> < #WITH_CROSS_COMPILER=
>> < WITH_SYSTEM_COMPILER=
>> ---
>>> WITH_CROSS_COMPILER=
>>> WITHOUT_SYSTEM_COMPILER=
>> 17c17
>> < #WITHOUT_CLANG_BOOTSTRAP=
>> ---
>>> WITH_CLANG_BOOTSTRAP=
>
>
> Showing the "on a rpi2" script that runs make for using WITH_META_MODE=yes :
>
>> # more ~/sys_build_scripts.rpi2-host/make_rpi2_nodebug_clang_bootstrap-rpi2-host.sh
>> kldload -n filemon && \
>> script ~/sys_typescripts/typescript_make_rpi2_nodebug_clang_bootstrap-rpi2-host-$(date +%Y-%m-%d:%H:%M:%S) \
>> env __MAKE_CONF="/root/src.configs/make.conf" SRC_ENV_CONF="/root/src.configs/src.conf.rpi2-clang-bootstrap.rpi2-host" \
>> WITH_META_MODE=yes \
>> MAKEOBJDIRPREFIX="/usr/obj/clang/arm.armv6" \
>> make $*
>
> My /usr/src tree has some changes/additions --but mostly for powerpc64 and powerpc issues:
>
>> # 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
>
> (The include/include ones are from something making links pointing back up to the parent include/ . I did not explicitly create these.)
>
> (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.)
>
>
> ===
> Mark Millard
> markmi at dsl-only.net
===
Mark Millard
markmi at dsl-only.net
More information about the freebsd-current
mailing list