abseil / abseil/abseil-cpp

Build/link error with android ndk r19 due to librt

Open
#672 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18.1k
Forks
3.2k
Avg merge
20h 36m
Merged PRs (30d)
1

Description

We face a build error with the current LTS branch during the linking stage because abseil tries to link librt which doesn't really exist for android.

```
/opt/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.gold: error: /usr/lib32/librt.so: incompatible target
```

It is fixed by replacing https://github.com/abseil/abseil-cpp/blob/68494aae959dfbbf781cdf03a988d2f5fc7e4802/absl/base/CMakeLists.txt#L17 by
```
if(NOT ANDROID)
find_library(LIBRT rt)
endif(NOT ANDROID)
```

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.