Cross compile for aarch64 cannot find 'ld'

Hi guys,

When I run make, I got following problem.

cmake ../tvm -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_C_COMPILER=/usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DCMAKE_CXX_COMPILER=/usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-g++ -DCMAKE_FIND_ROOT_PATH=/usr/local/toolchain/aarch64//aarch64-none-linux-gnu -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DMACHINE_NAME=aarch64-none-linux-gnu

-- The C compiler identification is GNU 11.2.1
-- The CXX compiler identification is GNU 11.2.1
-- Check for working C compiler: /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc
-- Check for working C compiler: /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-g++
-- Check for working CXX compiler: /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Forbidding undefined symbols in shared library, using -Wl,--no-undefined on platform Linux
-- Build with RPC support...
-- Build with Graph Executor support...
-- Build with profiler...
-- Build with AOT Executor support...
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY) 
-- VTA build with VTA_HW_PATH=/home/chongt/tvm/3rdparty/vta-hw
-- Build VTA runtime with target: sim
-- Build with contrib.random
-- Build with contrib.sort
-- Build with contrib.hybriddump
-- Git found: /usr/bin/git
-- Found TVM_GIT_COMMIT_HASH=9963b59ffa489db61358dedd35a2453a5ca666b9
-- Found TVM_GIT_COMMIT_TIME=2022-07-26 09:05:34 +0800
-- Performing Test SUPPORT_CXX14
-- Performing Test SUPPORT_CXX14 - Success
-- Autoset: USE_LIBBACKTRACE=ON in Linux
-- Building with libbacktrace...
-- Building with TVM Map...
-- Build with thread support...
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Added "-fuse-ld=lld" to linker flags 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chongt/TVM_runtime_aarch64

make -j$(nproc) runtime

Scanning dependencies of target project_libbacktrace
Scanning dependencies of target tvm_libinfo_objs
[  0%] Creating directories for 'project_libbacktrace'
[  0%] Building CXX object CMakeFiles/tvm_libinfo_objs.dir/src/support/libinfo.cc.o
[  0%] No download step for 'project_libbacktrace'
[ 11%] No update step for 'project_libbacktrace'
[ 11%] No patch step for 'project_libbacktrace'
[ 11%] No checkout step for 'project_libbacktrace'
[ 11%] Performing configure step for 'project_libbacktrace'
checking build system type... x86_64-pc-linux-gnu
checking host system type... aarch64-none-linux-gnu
checking target system type... aarch64-none-linux-gnu
checking for aarch64-none-linux-gnu-gcc... /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc accepts -g... yes
checking for /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc option to accept ISO C89... none needed
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc understands -c and -o together... yes
checking how to run the C preprocessor... /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/chongt/tvm/3rdparty/libbacktrace/missing: Unknown `--is-lightweight' option
Try `/home/chongt/tvm/3rdparty/libbacktrace/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for aarch64-none-linux-gnu-strip... /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for aarch64-none-linux-gnu-gcc... (cached) /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc accepts -g... (cached) yes
checking for /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc option to accept ISO C89... (cached) none needed
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc understands -c and -o together... (cached) yes
checking for aarch64-none-linux-gnu-ranlib... aarch64-none-linux-gnu-ranlib
checking for gawk... (cached) mawk
checking for dwz... no
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc... /usr/local/toolchain/aarch64/aarch64-none-linux-gnu/bin/ld
checking if the linker (/usr/local/toolchain/aarch64/aarch64-none-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-nm
checking the name lister (/usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/local/toolchain/aarch64/aarch64-none-linux-gnu/bin/ld option to reload object files... -r
checking for aarch64-none-linux-gnu-objdump... aarch64-none-linux-gnu-objdump
checking how to recognize dependent libraries... pass_all
checking for aarch64-none-linux-gnu-ar... aarch64-none-linux-gnu-ar
checking for aarch64-none-linux-gnu-strip... (cached) /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-strip
checking for aarch64-none-linux-gnu-ranlib... (cached) aarch64-none-linux-gnu-ranlib
checking command to parse /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-nm output from /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
checking for /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
checking if /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
checking if /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc static flag -static works... yes
checking if /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -c -o file.o... yes
checking if /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -c -o file.o... (cached) yes
checking whether the /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc linker (/usr/local/toolchain/aarch64/aarch64-none-linux-gnu/bin/ld) supports shared libraries... [ 11%] Built target tvm_libinfo_objs
yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking unwind.h usability... yes
checking unwind.h presence... yes
checking for unwind.h... yes
checking for _Unwind_Backtrace... yes
checking for -funwind-tables option... yes
checking for -frandom-seed=string option... yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -W... yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -Wall... yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -Wwrite-strings... yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -Wstrict-prototypes... yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -Wmissing-prototypes... yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -Wold-style-definition... yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -Wmissing-format-attribute... yes
checking whether /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc supports -Wcast-qual... yes
checking for _Unwind_GetIPInfo... yes
checking __sync extensions... yes
checking __atomic extensions... yes
checking output filetype... elf64
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking link.h usability... yes
checking link.h presence... yes
checking for link.h... yes
checking for dl_iterate_phdr... yes
checking mach-o/dyld.h usability... no
checking mach-o/dyld.h presence... no
checking for mach-o/dyld.h... no
checking sys/ldr.h usability... no
checking sys/ldr.h presence... no
checking for sys/ldr.h... no
checking for fcntl... yes
checking whether strnlen is declared... yes
checking whether getpagesize is declared... yes
checking for lstat... yes
checking for readlink... yes
checking for getexecname... no
checking for KERN_PROC... no
checking for KERN_PROG_ARGS... no
checking for clock_gettime... yes
checking whether -pthread is supported... yes
checking whether -gdwarf-5 is supported... yes
checking for compress in -lz... no
checking whether --compress-debug-sections is supported... yes
checking for objcopy... objcopy
checking for readelf... readelf
checking whether objcopy supports debuglink... yes
checking for dsymutil... dsymutil
checking for nm... /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-nm
checking for xz... xz
checking for comm... comm
checking for lzma_auto_decoder in -llzma... no
checking whether tests can run... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating backtrace-supported.h
config.status: creating install-debuginfo-for-buildid.sh
config.status: creating config.h
config.status: executing libtool commands
config.status: executing default commands
[ 11%] Performing build step for 'project_libbacktrace'
make[4]: 警告: jobserver 不可用: 正使用 -j1。添加 “+” 到父 make 的规则。
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=atomic.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/atomic.c  -fPIC -DPIC -o atomic.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=dwarf.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/dwarf.c  -fPIC -DPIC -o dwarf.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=fileline.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/fileline.c  -fPIC -DPIC -o fileline.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=posix.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/posix.c  -fPIC -DPIC -o posix.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=print.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/print.c  -fPIC -DPIC -o print.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=sort.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/sort.c  -fPIC -DPIC -o sort.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=state.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/state.c  -fPIC -DPIC -o state.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=backtrace.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/backtrace.c  -fPIC -DPIC -o backtrace.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=simple.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/simple.c  -fPIC -DPIC -o simple.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=elf.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/elf.c  -fPIC -DPIC -o elf.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=mmapio.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/mmapio.c  -fPIC -DPIC -o mmapio.o
libtool: compile:  /usr/local/toolchain/aarch64/bin/aarch64-none-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=mmap.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -O2 -Wall -fPIC -c /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/mmap.c  -fPIC -DPIC -o mmap.o
libtool: link: aarch64-none-linux-gnu-ar cru .libs/libbacktrace.a  atomic.o dwarf.o fileline.o posix.o print.o sort.o state.o backtrace.o simple.o elf.o mmapio.o mmap.o
libtool: link: aarch64-none-linux-gnu-ranlib .libs/libbacktrace.a
libtool: link: ( cd ".libs" && rm -f "libbacktrace.la" && ln -s "../libbacktrace.la" "libbacktrace.la" )
[ 11%] Performing install step for 'project_libbacktrace'
make[4]: 警告: jobserver 不可用: 正使用 -j1。添加 “+” 到父 make 的规则。
 /bin/mkdir -p '/home/chongt/TVM_runtime_aarch64/libbacktrace/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libbacktrace.la '/home/chongt/TVM_runtime_aarch64/libbacktrace/lib'
libtool: install: /usr/bin/install -c .libs/libbacktrace.lai /home/chongt/TVM_runtime_aarch64/libbacktrace/lib/libbacktrace.la
libtool: install: /usr/bin/install -c .libs/libbacktrace.a /home/chongt/TVM_runtime_aarch64/libbacktrace/lib/libbacktrace.a
libtool: install: chmod 644 /home/chongt/TVM_runtime_aarch64/libbacktrace/lib/libbacktrace.a
libtool: install: aarch64-none-linux-gnu-ranlib /home/chongt/TVM_runtime_aarch64/libbacktrace/lib/libbacktrace.a
libtool: finish: PATH="/usr/local/cuda-11.1/bin:/usr/local/cuda-11.1/bin:/home/chongt/anaconda3/bin:/home/chongt/anaconda3/condabin:/usr/local/cuda-11.1/bin:/home/chongt/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/chongt/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin:/home/chongt/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin:/usr/local/toolchain/aarch64/bin:/home/chongt/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin:/usr/local/toolchain/aarch64/bin:/usr/local/toolchain/aarch64/aarch64-none-linux-gnu/bin:/sbin" ldconfig -n /home/chongt/TVM_runtime_aarch64/libbacktrace/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /home/chongt/TVM_runtime_aarch64/libbacktrace/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/home/chongt/TVM_runtime_aarch64/libbacktrace/include'
 /usr/bin/install -c -m 644 /home/chongt/tvm/cmake/libs/../../3rdparty/libbacktrace/backtrace.h backtrace-supported.h '/home/chongt/TVM_runtime_aarch64/libbacktrace/include'
[ 11%] Completed 'project_libbacktrace'
[ 11%] Built target project_libbacktrace
Scanning dependencies of target tvm_runtime_objs
[ 22%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/builtin_fp16.cc.o
[ 22%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/cpu_device_api.cc.o
[ 22%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/logging.cc.o
[ 22%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/c_runtime_api.cc.o
[ 22%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/dso_library.cc.o
[ 22%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/library_module.cc.o
[ 22%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/debug.cc.o
[ 22%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/const_loader_module.cc.o
[ 22%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/file_utils.cc.o
[ 33%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/ndarray.cc.o
[ 33%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/metadata.cc.o
[ 33%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/container.cc.o
[ 33%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/profiling.cc.o
[ 33%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/packed_func.cc.o
[ 33%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/module.cc.o
[ 33%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/object.cc.o
[ 44%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/registry.cc.o
[ 44%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/source_utils.cc.o
[ 44%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/static_library.cc.o
[ 44%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/system_library.cc.o
[ 44%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/threading_backend.cc.o
[ 44%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/thread_pool.cc.o
[ 55%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/workspace_pool.cc.o
[ 55%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/bytecode.cc.o
[ 55%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/executable.cc.o
[ 55%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/memory_manager.cc.o
[ 55%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/vm.cc.o
[ 55%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/minrpc/minrpc_logger.cc.o
[ 66%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_channel.cc.o
[ 66%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_device_api.cc.o
[ 66%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_endpoint.cc.o
[ 66%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_event_impl.cc.o
[ 66%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_local_session.cc.o
[ 66%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_module.cc.o
[ 77%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_pipe_impl.cc.o
[ 77%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_server_env.cc.o
[ 77%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_session.cc.o
[ 77%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_socket_impl.cc.o
[ 77%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/graph_executor/graph_executor.cc.o
[ 77%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/graph_executor/graph_executor_factory.cc.o
[ 88%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/graph_executor/debug/graph_executor_debug.cc.o
[ 88%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/profiler/vm.cc.o
[ 88%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/aot_executor/aot_executor.cc.o
[ 88%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/aot_executor/aot_executor_factory.cc.o
[ 88%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/contrib/random/random.cc.o
[100%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/contrib/sort/sort.cc.o
[100%] Built target tvm_runtime_objs
Scanning dependencies of target tvm_runtime
[100%] Linking CXX shared library libtvm_runtime.so
collect2: 致命错误: cannot find ‘ld’
编译中断。
CMakeFiles/tvm_runtime.dir/build.make:163: recipe for target 'libtvm_runtime.so' failed
make[3]: *** [libtvm_runtime.so] Error 1
CMakeFiles/Makefile2:138: recipe for target 'CMakeFiles/tvm_runtime.dir/all' failed
make[2]: *** [CMakeFiles/tvm_runtime.dir/all] Error 2
CMakeFiles/Makefile2:74: recipe for target 'CMakeFiles/runtime.dir/rule' failed
make[1]: *** [CMakeFiles/runtime.dir/rule] Error 2
Makefile:164: recipe for target 'runtime' failed
make: *** [runtime] Error 2

But I can find ld.

whereis ld

return

/usr/local/toolchain/aarch64/aarch64-none-linux-gnu/bin/ld /usr/local/toolchain/aarch64/aarch64-none-linux-gnu/bin/ld.bfd /usr/local/toolchain/aarch64/aarch64-none-linux-gnu/bin/ld.gold

I have try to remake the soft link. It still doesn’t work.

Hi,

I had the same issue. I fixed it by running cmake and make as sudo.

Hope it works for you as well.

BR

i have same question, do you fix it?