Cross compiling error while linking llvm-clang-tblgen/nbclang-tblgen

193 views
Skip to first unread message

adin

unread,
Feb 22, 2018, 1:03:30 AM2/22/18
to minix3
I'm following the wiki http://wiki.minix3.org/doku.php?id=developersguide:crosscompiling

I executed the command

bash ./releasetools/x86_hdimage.sh

and obtained the error

# link llvm-clang-tblgen/nbclang-tblgen
c++ -O2 -fno-rtti -fno-exceptions -I/code/minix/../obj.i386/tooldir.Linux-4.13.0-32-generic-x86_64/include/compat -I/code/minix/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -I. -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/clang/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/lld/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/llvm/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/mclinker/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/lldb/include -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCLANG_ENABLE_STATIC_ANALYZER -I/code/minix/../obj.i386/tools/llvm-include -I/code/minix/../obj.i386/tools/llvm/config/include -I/code/minix/../obj.i386/tools/llvm/config/tools/clang/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../config/mclinker -I. -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/clang/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/lld/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/llvm/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/mclinker/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../dist/lldb/include -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCLANG_ENABLE_STATIC_ANALYZER -I/code/minix/../obj.i386/tools/llvm-include -I/code/minix/../obj.i386/tools/llvm/config/include -I/code/minix/../obj.i386/tools/llvm/config/tools/clang/include -I/code/minix/tools/llvm-clang-tblgen/../../external/bsd/llvm/bin/clang-tblgen/../../config/mclinker -o nbclang-tblgen ClangASTNodesEmitter.lo ClangAttrEmitter.lo ClangCommentCommandInfoEmitter.lo ClangCommentHTMLNamedCharacterReferenceEmitter.lo ClangCommentHTMLTagsEmitter.lo ClangDiagnosticsEmitter.lo ClangSACheckersEmitter.lo NeonEmitter.lo TableGen.lo -L/code/minix/../obj.i386/tooldir.Linux-4.13.0-32-generic-x86_64/lib -lnbcompat -lrt -lz -L/code/minix/../obj.i386/tools/llvm-lib/libLLVMTableGen -lLLVMTableGen -L/code/minix/../obj.i386/tools/llvm-lib/libLLVMSupport -lLLVMSupport -ldl -lpthread
/code/minix/../obj.i386/tools/llvm-lib/libLLVMSupport/libLLVMSupport.a(Process.lo): In function `llvm::sys::Process::FileDescriptorHasColors(int)':
Process.cpp:(.text+0x869): undefined reference to `setupterm'
Process.cpp:(.text+0x890): undefined reference to `tigetnum'
Process.cpp:(.text+0x899): undefined reference to `set_curterm'
Process.cpp:(.text+0x8a1): undefined reference to `del_curterm'
collect2: error: ld returned 1 exit status
*** [nbclang-tblgen] Error code 1

After searching it seems to be an error related to lack of libraries. Several sites relate the error to lack of linking to -ltinfo or -ltermcap.

However the wiki doesn't explain how to pass other variables into the building script. Can anyone guide me on how to correctly do the cross compilation?

I tried with the master branch, and with the R3.3.0 branches, and both give the same error. The current ones are using R3.3.0.

I installed the per-requisites as indicated in the wiki. My system info:

$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 17.10
Release:    17.10
Codename:    artful

$ make -v
GNU Make 4.1
Built for x86_64-pc-linux-gnu

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.2.0-8ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3)

$ c++ -v
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.2.0-8ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3)

build.log

adin

unread,
Mar 2, 2018, 11:58:47 AM3/2/18
to minix3
(Shameless bump.)

Still trying to figure out the problem. Do the compile chain expect some version of the libraries? Maybe that is producing some error on the cross-compilation?

Ideas?

Reply all
Reply to author
Forward
0 new messages