linking fails when compiled with clang and -fsanitize=undefined
envgap__abseil__abseil-cpp-841
Original GitHub issue ↗Opened 2020-11-11
01 / FAILURE SIGNATURE
As reported upstream
The int128 support in SimpleAtoi introduced in abseil/abseil-cpp@4b915e7 triggers this bug in Clang: [__int128_t multiply with -fsanitize=undefined fails to link (undefined reference to __muloti4)](https://bugs.llvm.org/show_bug.cgi?id=16404)
Not a benchmark task.
- No curated issue-specific recipe or verified environment fix is available.
02 / ENVIRONMENT RECIPE
- Base commit
Not freshly verified- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
abseil/abseil-cpp #841 · read the original issue
The int128 support in SimpleAtoi introduced in abseil/abseil-cpp@4b915e7 triggers this bug in Clang: [__int128_t multiply with -fsanitize=undefined fails to link (undefined reference to __muloti4)](https://bugs.llvm.org/show_bug.cgi?id=16404) ``` 2020-11-05T15:34:46.1334065Z ERROR: /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/envoy/test/integration/BUILD:254:14: Linking of rule '@envoy//test/integration:hotrestart_test' failed (Exit 1): clang failed: error executing command 2020-11-05T15:34:46.1335612Z (cd /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/execroot/envoy && \ 2020-11-05T15:34:46.1336305Z exec env - \ 2020-11-05T15:34:46.1336703Z BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \ 2020-11-05T15:34:46.1337306Z BAZEL_LINKLIBS=-l%:libstdc++.a \ 2020-11-05T15:34:46.1337873Z BAZEL_LINKOPTS=-lm \ 2020-11-05T15:34:46.1338251Z CC=clang \ 2020-11-05T15:34:46.1338572Z CXX=clang++ \ 2020-11-05T15:34:46.1338900Z ENVOY_ASAN=1 \ 2020-11-05T15:34:46.1339237Z ENVOY_UBSAN_VPTR=1 \ 2020-11-05T15:34:46.1339644Z PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin \ 2020-11-05T15:34:46.1340034Z PWD=/proc/self/cwd \ 2020-11-05T15:34:46.1340759Z /opt/llvm/bin/clang @bazel-out/k8-dbg/bin/external/envoy/test/integration/hotrestart_test-2.params) 2020-11-05T15:34:46.1341345Z Execution platform: @rbe_ubuntu_clang//config:platform 2020-11-05T15:34:46.1341798Z ld.lld: error: undefined symbol: __muloti4 2020-11-05T15:34:46.1342380Z >>> referenced by int128_have_intrinsic.inc:251 (external/com_google_absl/absl/numeric/int128_have_intrinsic.inc:251) 2020-11-05T15:34:46.1343451Z >>> bazel-out/k8-dbg/bin/external/com_google_absl/absl/strings/_objs/strings/numbers.pic.o:(absl::operator*(absl::int128, absl::int128)) 2020-11-05T15:34:46.1344374Z clang-10: error: linker command failed with exit code 1 (use -v to see invocation) ``` **Steps to reproduce the bug** I stumble upon this issue when running Envoy's unit tests: 1. git clone https://github.com/envoyproxy/envoy.git && cd envoy 1. update Abseil to the latest master in `bazel/repository_locations.bzl`; 1. run `ci/run_envoy_docker.sh 'ci/do_ci.sh bazel.compile_time_options'` **What version of Abseil are you using?** The latest master. **What operating system and version are you using** Ubuntu 18.04.5 LTS **What compiler and version are you using?** clang version 10.0.0 **What build system are you using?** bazel 3.6.0 **Additional context** In the referenced LLVM bug it's suggested to link with compiler-rt which contains the implementation of `__muloti4`, but it's an optional LLVM component. Is it possible to include `__muloti4` in Abseil?
04 / LABELS
Labels from the report text only; not yet run
underspecificationLabel rules and the text that matched
[
{
"category": "underspecification",
"rule": "signature.missing_system_requirement",
"source": "failure_signature",
"excerpt": "The int128 support in SimpleAtoi introduced in abseil/abseil-cpp@4b915e7 triggers this bug in Clang: [__int128_t multiply with -fsanitize=undefined fails to link (undefined reference to __muloti4)](https://bugs.llvm.org/show_bug.cgi?id=16404)"
}
]Issue-specific recipe and runtime smoke command require review against the complete issue and repository.
Legacy reproduction is generic install-only; match the actual issue failure before admission.