Re: -r321371 amd64 -> powerpc64 cross build: lldb.full link fails with: c++: error: linker command failed with exit code 1, -B/usr/local/powerpc64-freebsd/bin/ in use

From: Mark Millard <markmi_at_dsl-only.net>
Date: Wed, 26 Jul 2017 01:11:08 -0700
On 2017-Jul-24, at 7:28 AM, Warner Losh <imp at bsdimp.com> wrote:

>> On Mon, Jul 24, 2017 at 1:33 AM, Mark Millard <markmi at dsl-only.net> wrote:
>> [I forgot that linking lldb historically failed on armv6
>> (cortex-a7) based on the historical system binutils.]
>> 
>> On 2017-Jul-23, at 8:51 PM, Mark Millard <markmi at dsl-only.net> wrote:
>> 
>> > [Using WITH_LLDB= had no problem for amd64 -> TARGET_ARCH=aarch64
>> > buildworld buildkernel .]
>> . . .
>> >
>> > My aarch64 buildworld buildkernel completed finally.
>> > Using WITH_LLDB= had no problem for amd64 ->
>> > TARGET_ARCH=aarch64 buildworld buildkernel doing
>> > the -r321109 to -r321371 upgrade. I did not see
>> > the problem for amd64 (self hosted).
>> >
>> > I'll try armv7 (cortex-a7) next, the last of
>> > the TARGET_ARCH=<?> that I normally build.
>> >
>> > So far I've seen the problem only for powerpc64.
>> > (I do not build lldb for 32-bit powerpc because
>> > the lack of 8-byte atomics for powerpc historically
>> > blocked the lldb build.)
>> 
>> As for trying armv6/7 (cortex-a7): I forgot that linking
>> lldb historically failed for targeting cortex-a7 based
>> on the historical system binutils. The build was with
>> WITHOUT_LLDB= (as is my standard procedure for cortex-a7)
>> so not a relevant test.
> 
> lldb doesn't support armv6 ISA, but does support armv7 ISA.
> 
> Just as a point of reference. It's one of the reasons for creating a new MACHINE_ARCH of armv7.

Just FYI: Attempting WITH_LLDB= in a amd64 -> armv6/7 cross
build of -r321493 failed as shown below despite using:

XCFLAGS+= -mcpu=cortex-a7
XCXXFLAGS+= -mcpu=cortex-a7

(Full build context shown later.)

--- lldb.full ---
/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/usr/lib/libgcc.a(clear_cache.o): In function `__clear_cache':
/usr/src/contrib/compiler-rt/lib/builtins/clear_cache.c:(.text+0x1c): relocation truncated to fit: R_ARM_CALL against symbol `sysarch_at__at_FBSD_1.0' defined in .plt section in /usr/obj/armv7_clang/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(regexec.o)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [lldb.full] Error code 1

make[5]: stopped in /usr/src/usr.bin/clang/lldb
.ERROR_TARGET='lldb.full'
.ERROR_META_FILE='/usr/obj/armv7_clang/arm.armv6/usr/src/usr.bin/clang/lldb/lldb.full.meta'
.MAKE.LEVEL='5'
MAKEFILE=''
.MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose'
_ERROR_CMD='c++ -mcpu=cortex-a7 -mcpu=cortex-a7 -target armv6-gnueabihf-freebsd12.0 --sysroot=/usr/obj/armv7_clang/arm.armv6/usr/src/tmp -B/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/usr/bin -O -pipe -I/usr/src/contrib/llvm/tools/lldb/include -I/usr/src/contrib/llvm/tools/clang/include -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_STATIC_ANALYZER -I/usr/src/lib/clang/include -I/usr/src/contrib/llvm/include -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_DEFAULT_TARGET_TRIPLE=\"armv6-unknown-freebsd12.0-gnueabihf\" -DLLVM_HOST_TRIPLE=\"armv6-unknown-freebsd12.0\" -DDEFAULT_SYSROOT=\"\" -ffunction-sections -fdata-sections -g -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments -std=c++11 -fno-exceptions -fno-rtti -stdlib=libc++ -Wno-c++11-extensions  -Wl,--gc-sections -o lldb.full  Driver.o /usr/obj/armv7_clang/arm.armv6/usr/src/lib/clang/liblldb/liblldb.a /usr/obj/armv7_clang/arm.armv6/usr/src/lib/clang/libclang/libclang.a /usr/obj/armv7_clang/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a  -ledit  -lpanel  -lncursesw   -lz -lpthread;'
.CURDIR='/usr/src/usr.bin/clang/lldb'
.MAKE='make'
.OBJDIR='/usr/obj/armv7_clang/arm.armv6/usr/src/usr.bin/clang/lldb'
.TARGETS='all'
DESTDIR='/usr/obj/armv7_clang/arm.armv6/usr/src/tmp'
LD_LIBRARY_PATH=''
MACHINE='arm'
MACHINE_ARCH='armv6'
MAKEOBJDIRPREFIX='/usr/obj/armv7_clang/arm.armv6'
MAKESYSPATH='/usr/src/share/mk'
MAKE_VERSION='20170720'
PATH='/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/legacy/usr/sbin:/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/legacy/usr/bin:/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/legacy/bin:/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/usr/sbin:/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin'
SRCTOP='/usr/src'
OBJTOP='/usr/obj/armv7_clang/arm.armv6/usr/src'
.MAKE.MAKEFILES='/usr/src/share/mk/sys.mk /usr/src/share/mk/local.sys.env.mk /usr/src/share/mk/src.sys.env.mk /root/src.configs/src.conf.armv7-clang-bootstrap.amd64-host /usr/src/share/mk/bsd.mkopt.mk /usr/src/share/mk/bsd.suffixes.mk /root/src.configs/make.conf /usr/src/share/mk/local.sys.mk /usr/src/share/mk/src.sys.mk /dev/null /usr/src/usr.bin/clang/lldb/Makefile /usr/src/lib/clang/lldb.pre.mk /usr/src/lib/clang/clang.pre.mk /usr/src/lib/clang/llvm.pre.mk /usr/src/lib/clang/clang.build.mk /usr/src/share/mk/src.opts.mk /usr/src/share/mk/bsd.own.mk /usr/src/share/mk/bsd.opts.mk /usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/bsd.compiler.mk /usr/src/share/mk/bsd.linker.mk /usr/src/lib/clang/llvm.build.mk /usr/src/share/mk/bsd.prog.mk /usr/src/share/mk/bsd.init.mk /usr/src/share/mk/local.init.mk /usr/src/share/mk/src.init.mk /usr/src/usr.bin/clang/lldb/../Makefile.inc /usr/src/usr.bin/clang/lldb/../../Makefile.inc /usr/src/share/mk/bsd.libnames.mk /usr/src/share/mk/src.libnames.mk /usr/src/share/mk/bsd.nls.mk /usr/src/share/mk/bsd.confs.mk /usr/src/share/mk/bsd.files.mk /usr/src/share/mk/bsd.incs.mk /usr/src/share/mk/bsd.links.mk /usr/src/share/mk/bsd.man.mk /usr/src/share/mk/bsd.dep.mk /usr/src/share/mk/bsd.clang-analyze.mk /usr/src/share/mk/bsd.obj.mk /usr/src/share/mk/bsd.subdir.mk /usr/src/share/mk/bsd.sys.mk'
.PATH='. /usr/src/usr.bin/clang/lldb /usr/src/contrib/llvm/tools/lldb/docs /usr/src/contrib/llvm/tools/lldb/tools/driver'
1 error

make[5]: stopped in /usr/src/usr.bin/clang/lldb
.ERROR_TARGET='lldb.full'
.ERROR_META_FILE='/usr/obj/armv7_clang/arm.armv6/usr/src/usr.bin/clang/lldb/lldb.full.meta'
.MAKE.LEVEL='5'
MAKEFILE=''
.MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose'
_ERROR_CMD='c++ -mcpu=cortex-a7 -mcpu=cortex-a7 -target armv6-gnueabihf-freebsd12.0 --sysroot=/usr/obj/armv7_clang/arm.armv6/usr/src/tmp -B/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/usr/bin -O -pipe -I/usr/src/contrib/llvm/tools/lldb/include -I/usr/src/contrib/llvm/tools/clang/include -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_STATIC_ANALYZER -I/usr/src/lib/clang/include -I/usr/src/contrib/llvm/include -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_DEFAULT_TARGET_TRIPLE=\"armv6-unknown-freebsd12.0-gnueabihf\" -DLLVM_HOST_TRIPLE=\"armv6-unknown-freebsd12.0\" -DDEFAULT_SYSROOT=\"\" -ffunction-sections -fdata-sections -g -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments -std=c++11 -fno-exceptions -fno-rtti -stdlib=libc++ -Wno-c++11-extensions  -Wl,--gc-sections -o lldb.full  Driver.o /usr/obj/armv7_clang/arm.armv6/usr/src/lib/clang/liblldb/liblldb.a /usr/obj/armv7_clang/arm.armv6/usr/src/lib/clang/libclang/libclang.a /usr/obj/armv7_clang/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a  -ledit  -lpanel  -lncursesw   -lz -lpthread;'
.CURDIR='/usr/src/usr.bin/clang/lldb'
.MAKE='make'
.OBJDIR='/usr/obj/armv7_clang/arm.armv6/usr/src/usr.bin/clang/lldb'
.TARGETS='all'
DESTDIR='/usr/obj/armv7_clang/arm.armv6/usr/src/tmp'
LD_LIBRARY_PATH=''
MACHINE='arm'
MACHINE_ARCH='armv6'
MAKEOBJDIRPREFIX='/usr/obj/armv7_clang/arm.armv6'
MAKESYSPATH='/usr/src/share/mk'
MAKE_VERSION='20170720'
PATH='/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/legacy/usr/sbin:/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/legacy/usr/bin:/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/legacy/bin:/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/usr/sbin:/usr/obj/armv7_clang/arm.armv6/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin'
SRCTOP='/usr/src'
OBJTOP='/usr/obj/armv7_clang/arm.armv6/usr/src'
.MAKE.MAKEFILES='/usr/src/share/mk/sys.mk /usr/src/share/mk/local.sys.env.mk /usr/src/share/mk/src.sys.env.mk /root/src.configs/src.conf.armv7-clang-bootstrap.amd64-host /usr/src/share/mk/bsd.mkopt.mk /usr/src/share/mk/bsd.suffixes.mk /root/src.configs/make.conf /usr/src/share/mk/local.sys.mk /usr/src/share/mk/src.sys.mk /dev/null /usr/src/usr.bin/clang/lldb/Makefile /usr/src/lib/clang/lldb.pre.mk /usr/src/lib/clang/clang.pre.mk /usr/src/lib/clang/llvm.pre.mk /usr/src/lib/clang/clang.build.mk /usr/src/share/mk/src.opts.mk /usr/src/share/mk/bsd.own.mk /usr/src/share/mk/bsd.opts.mk /usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/bsd.compiler.mk /usr/src/share/mk/bsd.linker.mk /usr/src/lib/clang/llvm.build.mk /usr/src/share/mk/bsd.prog.mk /usr/src/share/mk/bsd.init.mk /usr/src/share/mk/local.init.mk /usr/src/share/mk/src.init.mk /usr/src/usr.bin/clang/lldb/../Makefile.inc /usr/src/usr.bin/clang/lldb/../../Makefile.inc /usr/src/share/mk/bsd.libnames.mk /usr/src/share/mk/src.libnames.mk /usr/src/share/mk/bsd.nls.mk /usr/src/share/mk/bsd.confs.mk /usr/src/share/mk/bsd.files.mk /usr/src/share/mk/bsd.incs.mk /usr/src/share/mk/bsd.links.mk /usr/src/share/mk/bsd.man.mk /usr/src/share/mk/bsd.dep.mk /usr/src/share/mk/bsd.clang-analyze.mk /usr/src/share/mk/bsd.obj.mk /usr/src/share/mk/bsd.subdir.mk /usr/src/share/mk/bsd.sys.mk'
.PATH='. /usr/src/usr.bin/clang/lldb /usr/src/contrib/llvm/tools/lldb/docs /usr/src/contrib/llvm/tools/lldb/tools/driver'
*** [all_subdir_usr.bin/clang/lldb] Error code 2


Build context:

~/sys_build_scripts.amd64-host/make_armv7_nodebug_clang_bootstrap-amd64-host.sh -j8 buildworld buildkernel

# more ~/sys_build_scripts.amd64-host/make_armv7_nodebug_clang_bootstrap-amd64-host.sh 
kldload -n filemon && \
script ~/sys_typescripts/typescript_make_armv7_nodebug_clang_bootstrap-amd64-host-$(date +%Y-%m-%d:%H:%M:%S) \
env __MAKE_CONF="/root/src.configs/make.conf" SRCCONF="/dev/null" SRC_ENV_CONF="/root/src.configs/src.conf.armv7-clang-bootstrap.amd64-host" \
WITH_META_MODE=yes \
MAKEOBJDIRPREFIX="/usr/obj/armv7_clang" \
make $*

# more /root/src.configs/make.conf
CFLAGS.gcc+= -v

# more /root/src.configs/src.conf.armv7-clang-bootstrap.amd64-host
TO_TYPE=armv6
#
KERNCONF=GENERIC-NODBG
TARGET=arm
.if ${.MAKE.LEVEL} == 0
TARGET_ARCH=${TO_TYPE}
.export TARGET_ARCH
.endif
#
WITH_CROSS_COMPILER=
WITHOUT_SYSTEM_COMPILER=
#
#CPUTYPE=soft
WITH_LIBCPLUSPLUS=
WITH_BINUTILS_BOOTSTRAP=
WITH_ELFTOOLCHAIN_BOOTSTRAP=
WITH_CLANG_BOOTSTRAP=
WITH_CLANG=
WITH_CLANG_IS_CC=
WITH_CLANG_FULL=
WITH_CLANG_EXTRAS=
WITH_LLD=
#
# Linking lldb fails for armv6(/v7)
WITH_LLDB=
#
WITH_BOOT=
WITHOUT_LIB32=
WITHOUT_LIBSOFT=
#
WITHOUT_GCC_BOOTSTRAP=
WITHOUT_GCC=
WITHOUT_GCC_IS_CC=
WITHOUT_GNUCXX=
#
NO_WERROR=
#WERROR=
MALLOC_PRODUCTION=
#
WITH_REPRODUCIBLE_BUILD=
WITH_DEBUG_FILES=
#
XCFLAGS+= -mcpu=cortex-a7
XCXXFLAGS+= -mcpu=cortex-a7
# There is no XCPPFLAGS but XCPP gets XCFLAGS content.


===
Mark Millard
markmi at dsl-only.net
Received on Wed Jul 26 2017 - 06:11:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:12 UTC