diff options
| author | Logan Chien <tzuhsiang.chien@gmail.com> | 2014-06-26 13:56:23 +0000 |
|---|---|---|
| committer | Logan Chien <tzuhsiang.chien@gmail.com> | 2014-06-26 13:56:23 +0000 |
| commit | 37be06a0c642aa560c544684f458c7aa9d8e9f48 (patch) | |
| tree | 3eb13f7988dc71e9cbfff94fdab0d87b631cf5df /libcxxabi | |
| parent | 3c81e46b57b6a3585abc745e76f277cc0cda01d3 (diff) | |
| download | bcm5719-llvm-37be06a0c642aa560c544684f458c7aa9d8e9f48.tar.gz bcm5719-llvm-37be06a0c642aa560c544684f458c7aa9d8e9f48.zip | |
Fix linux build.
* Replace strlcpy with snprintf since strlcpy is not available
in glibc.
* Replace __LINUX__ with __linux__.
llvm-svn: 211784
Diffstat (limited to 'libcxxabi')
| -rw-r--r-- | libcxxabi/src/Unwind/AddressSpace.hpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libcxxabi/src/Unwind/AddressSpace.hpp b/libcxxabi/src/Unwind/AddressSpace.hpp index 2682ec4169b..d0688f7f414 100644 --- a/libcxxabi/src/Unwind/AddressSpace.hpp +++ b/libcxxabi/src/Unwind/AddressSpace.hpp @@ -32,14 +32,16 @@ namespace libunwind { #include "Registers.hpp" #if LIBCXXABI_ARM_EHABI -#if __LINUX__ - // Emulate the BSD dl_unwind_find_exidx API when on a GNU libdl system. - typedef long unsigned int *_Unwind_Ptr; - extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr targetAddr, int *length); - _Unwind_Ptr (*dl_unwind_find_exidx)(_Unwind_Ptr targetAddr, int *length) = - __gnu_Unwind_Find_exidx; +#if __linux__ + +typedef long unsigned int *_Unwind_Ptr; +extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); + +// Emulate the BSD dl_unwind_find_exidx API when on a GNU libdl system. +#define dl_unwind_find_exidx __gnu_Unwind_Find_exidx + #else - #include <link.h> +#include <link.h> #endif #endif // LIBCXXABI_ARM_EHABI @@ -353,7 +355,7 @@ inline bool LocalAddressSpace::findFunctionName(pint_t addr, char *buf, Dl_info dyldInfo; if (dladdr((void *)addr, &dyldInfo)) { if (dyldInfo.dli_sname != NULL) { - strlcpy(buf, dyldInfo.dli_sname, bufLen); + snprintf(buf, bufLen, "%s", dyldInfo.dli_sname); *offset = (addr - (pint_t) dyldInfo.dli_saddr); return true; } |

