google / google/sandboxed-api

Linking issue with libunwind and zlib on aarch64

Open
#169 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
1.8k
Forks
200
Avg merge
12d 2h
Merged PRs (30d)
1

Description

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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.