Issue 61571
Summary ASan runtime has unsatisfiable undefined references to __extend* builtins on Android
Labels new issue
Assignees
Reporter glandium
    Because the ASan runtime is linked with `-nodefaultlibs` per the various things that add the flag in different `CMakeFiles.txt` under `compiler-rt/`, when compiling compiler-rt for Android with clang, references to `__extend*` builtins from calls added by the compiler in `__ubsan::Value::getFloatValue()` are left undefined (since libclang_rt.builtins is not linked in), and later on, that can yield linker errors when linking against that ASan runtime, because the linker (BFD) sees the visibility-hidden `__extend*` symbols from libclang_rt.builtins and doesn't like that it's the only thing that resolves the ASan runtime symbols (hidden symbol `__extenddftf2' in linux/libclang_rt.builtins-x86_64-android.a(extenddftf2.c.o) is referenced by DSO). Or even later on, that can yield dynamic loader errors when loading the ASan runtime requires those symbols that can't be found anywhere.

As a matter of fact, building compiler-rt via `runtimes` with `-DLLVM_ENABLE_RUNTIMES=compiler-rt` fails to build entirely because it adds `-Wl,-z,defs`, which barfs about the undefined symbols directly (which, BTW, include libunwind symbols too).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to