aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2021-02-10 01:25:58 -0800
committerRyan Prichard <rprichard@google.com>2021-02-25 15:40:02 -0800
commit91f8aacc040f5a458cfc2a10c4039e0028931455 (patch)
treef270d39762cd9b89509c7407fb2ec3effe0f1642 /clang/lib/Frontend/CompilerInvocation.cpp
parentc88fedef2a5d3f4c69cc668984bb93c8889890c2 (diff)
downloadllvm-91f8aacc040f5a458cfc2a10c4039e0028931455.zip
llvm-91f8aacc040f5a458cfc2a10c4039e0028931455.tar.gz
llvm-91f8aacc040f5a458cfc2a10c4039e0028931455.tar.bz2
[Android] Use -l:libunwind.a with --rtlib=compiler-rt
On Android, the unwinder isn't part of the C++ STL and isn't (in older versions) exported from libc.so. Instead, the driver links the static unwinder archive implicitly. Currently, the Android NDK implicitly links libgcc.a to provide both builtins and the unwinder. To support switching to compiler-rt builtins and libunwind, make --rtlib=compiler-rt behave the same way on Android, and implicitly pass -l:libunwind.a to the linker. Adjust the -ldl logic. For the Android NDK, the unwinder (whether libgcc.a or libunwind.a) is linked statically and calls a function in the dynamic loader for finding unwind tables (e.g. dl_iterate_phdr). On Android, this function is in libc.a for static executables and libdl.so otherwise, so -ldl is needed. (glibc doesn't need -ldl because its libc.so exports dl_iterate_phdr.) Differential Revision: https://reviews.llvm.org/D96403
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions