tailwind-config-viewer icon indicating copy to clipboard operation
tailwind-config-viewer copied to clipboard

Linking issue with libunwind and zlib on aarch64

Open gbryant-arm opened this issue 2 years ago • 3 comments

On arm and aarch64, libunwind is configured to use debug frames (CONFIG_DEBUG_FRAME), but this feature requires zlib. This is what happens when building sandboxed-api on aarch64:

...
[ 89%] Linking CXX executable forkserver_bin
/usr/bin/ld: ../../libunwind_ptrace.a(Gfind_proc_info-lsb.c.o): in function `load_debug_frame':
Gfind_proc_info-lsb.c:(.text+0x157c): undefined reference to `uncompress'
collect2: error: ld returned 1 exit status
make[2]: *** [sandboxed_api/sandbox2/CMakeFiles/sandbox2_forkserver_bin.dir/build.make:197: sandboxed_api/sandbox2/forkserver_bin] Error 1
make[1]: *** [CMakeFiles/Makefile2:9407: sandboxed_api/sandbox2/CMakeFiles/sandbox2_forkserver_bin.dir/all] Error 2

Looks like neither libunwind nor sandboxed-api resolves the zlib symbols. As a dirty workaround I've added z to target_link_libraries in cmake/libunwind.cmake.

Can anyone confirm it's a bug?

To reproduce

Run this on aarch64:

git clone --recursive https://github.com/google/sandboxed-api
mkdir build
cd build
cmake ..
make -j 8

gbryant-arm avatar Oct 06 '23 10:10 gbryant-arm

i got the same problem when i compile glog on aarch64 machine, i wonder whether there is a good solution

Harvey-13 avatar Jun 25 '25 09:06 Harvey-13

Which distribution are you using? I just tested this on Debian 12 Arm with Clang-19 packages and it compiles and links successfully.

cblichmann avatar Jun 25 '25 17:06 cblichmann

i guess this has nothing to do with sandboxed, maybe i get the reason. when compile a static library of libunwind, additional pkgconfig args is needed, or libz would be missing from it.

Harvey-13 avatar Jun 25 '25 18:06 Harvey-13