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: Sun, 23 Jul 2017 00:42:07 -0700
On 2017-Jul-23, at 12:34 AM, Mark Millard <markmi at dsl-only.net> wrote:

> The devel/powerpc64-binutils is failing to link lldb.full for
> the clang/llvm 5 based context. (I historically use WITH_LLD
> when targeting powerpc64 but do not use lldb since it did not
> work overall.) I will simply change to WITHOUT_LLD for now.
> 
> I show the build context before the full error text.
> 
> Build Context:
> 
> # /usr/local/powerpc64-freebsd/bin/ld --version
> GNU ld (GNU Binutils) 2.28
> Copyright (C) 2017 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or (at your option) a later version.
> This program has absolutely no warranty.
> 
> # svnlite info /usr/src/ | grep "Re[plv]"
> Relative URL: ^/head
> Repository Root: svn://svn.freebsd.org/base
> Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
> Revision: 321371
> Last Changed Rev: 321371

I should have noted a converted-to-V5 historical
patch that I have involved:

# svnlite diff /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp
Index: /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp
===================================================================
--- /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp	(revision 321371)
+++ /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp	(working copy)
_at__at_ -60,7 +60,8 _at__at_
static uint16_t applyPPCHighesta(uint64_t V) { return (V + 0x8000) >> 48; }

PPC64::PPC64() {
-  PltRel = GotRel = R_PPC64_GLOB_DAT;
+  GotRel = R_PPC64_GLOB_DAT;
+  PltRel = R_PPC64_JMP_SLOT;
  RelativeRel = R_PPC64_RELATIVE;
  GotEntrySize = 8;
  GotPltEntrySize = 8;

> # svnlite info /usr/ports/ | grep "Re[plv]"
> Relative URL: ^/head
> Repository Root: svn://svn.freebsd.org/ports
> Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
> Revision: 444872
> Last Changed Rev: 444872
> 
> # more ~/sys_build_scripts.amd64-host/make_powerpc64vtsc_nodebug_clang_altbinutils-amd64-host.sh 
> kldload -n filemon && \
> script ~/sys_typescripts/typescript_make_powerpc64vtsc_nodebug_clang_altbinutils-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.powerpc64-clang_altbinutils-bootstrap.amd64-host" \
> WITH_META_MODE=yes \
> MAKEOBJDIRPREFIX="/usr/obj/powerpc64vtsc_clang_altbinutils" \
> make $*
> 
> # more /root/src.configs/make.conf
> CFLAGS.gcc+= -v
> 
> # more /root/src.configs/src.conf.powerpc64-clang_altbinutils-bootstrap.amd64-host
> TO_TYPE=powerpc64
> TOOLS_TO_TYPE=${TO_TYPE}
> VERSION_CONTEXT=12.0
> #
> KERNCONF=GENERIC64vtsc-NODBG
> TARGET=powerpc
> .if ${.MAKE.LEVEL} == 0
> TARGET_ARCH=${TO_TYPE}
> .export TARGET_ARCH
> .endif
> #
> WITH_CROSS_COMPILER=
> WITHOUT_SYSTEM_COMPILER=
> #
> WITH_LIBCPLUSPLUS=
> WITHOUT_BINUTILS_BOOTSTRAP=
> WITH_ELFTOOLCHAIN_BOOTSTRAP=
> WITH_CLANG_BOOTSTRAP=
> WITH_CLANG=
> WITH_CLANG_IS_CC=
> WITH_CLANG_FULL=
> WITH_CLANG_EXTRAS=
> WITHOUT_LLD_BOOTSTRAP=
> WITH_LLD=
> WITHOUT_LLD_IS_LD=
> WITH_LLDB=
> #
> WITH_BOOT=
> WITH_LIB32=
> #
> WITHOUT_GCC_BOOTSTRAP=
> WITHOUT_GCC=
> WITHOUT_GCC_IS_CC=
> WITHOUT_GNUCXX=
> #
> NO_WERROR=
> MALLOC_PRODUCTION=
> #
> # Avoid converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
> # and such from blocking the build.
> WERROR=
> #
> WITH_REPRODUCIBLE_BUILD=
> WITH_DEBUG_FILES=
> #
> #
> # For TO (so-called "cross") stages . . .
> # So-called-cross via ${TO_TYPE}-xtoolchain-gcc/${TO_TYPE}-gcc. . .
> # TOOLS_TO_TYPE based on ${TO_TYPE}-xtoolchain-gcc related binutils. . .
> #
> CROSS_BINUTILS_PREFIX=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/
> .if ${.MAKE.LEVEL} == 0
> #
> # Note: The WITH_CROSS_COMPILER picks up the CROSS_BINUTILS_PREFIX
> #       binding automatically.
> #
> XAS=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/as
> XAR=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ar
> XNM=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/nm
> XOBJCOPY=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/objcopy
> XOBJDUMP=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/objdump
> XRANLIB=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ranlib
> XSIZE=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/size
> #NO-SUCH: XSTRINGS=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/strings
> XSTRINGS=/usr/local/bin/${TOOLS_TO_TYPE}-freebsd-strings
> .export XAS
> .export XAR
> .export XNM
> .export XOBJCOPY
> .export XOBJDUMP
> .export XRANLIB
> .export XSIZE
> .export XSTRINGS
> XLD=/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ld
> .export XLD
> .endif
> 
> 
> The error text:
> 
> --- all_subdir_lib ---
> --- test_01 ---
> (cd /usr/src/lib/libxo/tests &&  DEPENDFILE=.depend.test_01  NO_SUBDIR=1 make -f /usr/src/lib/libxo/tests/Makefile _RECURSING_PROGS=t  PROG=test_01 )
> Building /usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib/libxo/tests/test_01.o
> --- all_subdir_usr.bin ---
> --- all_subdir_usr.bin/clang/lldb ---
> c++: error: linker command failed with exit code 1 (use -v to see invocation)
> --- all_subdir_lib ---
> Building /usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib/libxo/tests/test_01.full
> --- all_subdir_usr.bin ---
> *** [lldb.full] Error code 1
> 
> make[5]: stopped in /usr/src/usr.bin/clang/lldb
> .ERROR_TARGET='lldb.full'
> .ERROR_META_FILE='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/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++ -target powerpc64-unknown-freebsd12.0 --sysroot=/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp -B/usr/local/powerpc64-freebsd/bin/ -O2 -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=\"powerpc64-unknown-freebsd12.0\" -DLLVM_HOST_TRIPLE=\"powerpc64-unknown-freebsd12.0\" -DDEFAULT_SYSROOT=\"\" -ffunction-sections -fdata-sections -g -fstack-protector-strong -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-e
> xceptions -fno-rtti -stdlib=libc++ -Wno-c++11-extensions  -Wl,--gc-sections -o lldb.full  Driver.o /usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib/clang/liblldb/liblldb.a /usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib/clang/libclang/libclang.a /usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib/clang/libllvm/libllvm.a  -ledit  -lpanel  -lncursesw   -lz -lpthread;'
> .CURDIR='/usr/src/usr.bin/clang/lldb'
> .MAKE='make'
> .OBJDIR='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/usr.bin/clang/lldb'
> .TARGETS='all'
> DESTDIR='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp'
> LD_LIBRARY_PATH=''
> MACHINE='powerpc'
> MACHINE_ARCH='powerpc64'
> MAKEOBJDIRPREFIX='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64'
> MAKESYSPATH='/usr/src/share/mk'
> MAKE_VERSION='20170711'
> PATH='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/legacy/usr/sbin:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/legacy/usr/bin:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/legacy/bin:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/usr/sbin:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin'
> SRCTOP='/usr/src'
> OBJTOP='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/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.powerpc64-clang_altbinutils-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/sr
> c.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/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/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++ -target powerpc64-unknown-freebsd12.0 --sysroot=/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp -B/usr/local/powerpc64-freebsd/bin/ -O2 -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=\"powerpc64-unknown-freebsd12.0\" -DLLVM_HOST_TRIPLE=\"powerpc64-unknown-freebsd12.0\" -DDEFAULT_SYSROOT=\"\" -ffunction-sections -fdata-sections -g -fstack-protector-strong -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-e
> xceptions -fno-rtti -stdlib=libc++ -Wno-c++11-extensions  -Wl,--gc-sections -o lldb.full  Driver.o /usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib/clang/liblldb/liblldb.a /usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib/clang/libclang/libclang.a /usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib/clang/libllvm/libllvm.a  -ledit  -lpanel  -lncursesw   -lz -lpthread;'
> .CURDIR='/usr/src/usr.bin/clang/lldb'
> .MAKE='make'
> .OBJDIR='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/usr.bin/clang/lldb'
> .TARGETS='all'
> DESTDIR='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp'
> LD_LIBRARY_PATH=''
> MACHINE='powerpc'
> MACHINE_ARCH='powerpc64'
> MAKEOBJDIRPREFIX='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64'
> MAKESYSPATH='/usr/src/share/mk'
> MAKE_VERSION='20170711'
> PATH='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/legacy/usr/sbin:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/legacy/usr/bin:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/legacy/bin:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/usr/sbin:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin'
> SRCTOP='/usr/src'
> OBJTOP='/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/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.powerpc64-clang_altbinutils-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/sr
> c.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

===
Mark Millard
markmi at dsl-only.net
Received on Sun Jul 23 2017 - 05:42:11 UTC

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