libunwind/libunwind

Compilation failed for aarch64 linux platform

qiomi opened this issue · 3 comments

qiomi commented

I want to compile a libunwind library for the aarch64 Linux platform on ubuntu using the build command ./configure --host=aarch64 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ --target=aarch64,
build succeeded. Then 'make' failed ! ! !

make[1]: Entering directory '/home/qiomi/code/libunwind/tests'
  CC       Gperf-simple.o
  CCLD     Gperf-simple
/usr/lib/gcc-cross/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/bin/ld: ../src/.libs/libunwind-aarch64.a(Ginit.o): in function `_Uaarch64_local_addr_space_init':
/home/qiomi/code/libunwind/src/aarch64/Ginit.c:244: undefined reference to `_Uaarch64_local_resume'
/usr/lib/gcc-cross/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/bin/ld: /home/qiomi/code/libunwind/src/aarch64/Ginit.c:244: undefined reference to `_Uaarch64_local_resume'
/usr/lib/gcc-cross/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/bin/ld: ../src/.libs/libunwind-aarch64.a(Gfind_proc_info-lsb.o): in function `dwarf_find_eh_frame_section':
/home/qiomi/code/libunwind/src/dwarf/Gfind_proc_info-lsb.c:532: undefined reference to `_Uaarch64_get_exe_image_path'
/usr/lib/gcc-cross/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/bin/ld: ../src/.libs/libunwind-aarch64.a(elf64.o): in function `_Uelf64_get_proc_name':
/home/qiomi/code/libunwind/src/elfxx.c:388: undefined reference to `_Uaarch64_get_elf_image'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1238: Gperf-simple] Error 1
make[1]: Leaving directory '/home/qiomi/code/libunwind/tests'
make: *** [Makefile:617: all-recursive] Error 1
bregma commented

It looks like you may have not configured properly for a proper cross-build of libunwind hosted on aarch64 GNU/Linux.

It should be something more like this.

./configure --build=x86_64-linux-gnu --host=aarch64-linux-gnu 

If you have the cross-development packages installed, it should automatically determine the toolchain. Please try this and see if it resolves your issue.

They way you have configured it it is assuming you want to build a remote-only library, which is probably incorrect, although I can't say with certainty without seeing the config.log. On the other hand this reveals that the tests fail to build in a remote-only configuration, which maybe some day someone might look in to.

qiomi commented

It looks like you may have not configured properly for a proper cross-build of libunwind hosted on aarch64 GNU/Linux.

It should be something more like this.

./configure --build=x86_64-linux-gnu --host=aarch64-linux-gnu 

If you have the cross-development packages installed, it should automatically determine the toolchain. Please try this and see if it resolves your issue.

They way you have configured it it is assuming you want to build a remote-only library, which is probably incorrect, although I can't say with certainty without seeing the config.log. On the other hand this reveals that the tests fail to build in a remote-only configuration, which maybe some day someone might look in to.

Thank you for your reminder. I have found a solution to my problem