diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2019-01-25 10:44:25 +0300 |
---|---|---|
committer | Yury Habets <yury@unity3d.com> | 2022-04-04 16:27:29 +0300 |
commit | 917319ba9d2d529eeb4205921b5c8d1e8eaf7f29 (patch) | |
tree | 207d2871ed04ac4ecaebecb43a9992f655049f47 | |
parent | b994dff67511d4014867d55794ca392eb58ee694 (diff) |
Fix 'undefined reference to __data_start' linker error (Android/aarch64)android/fix-bitcode-with-lld-ndkr23b
As of NDK r18b, __data_start symbol is only provided by bfd linker.
* include/private/gcconfig.h [AARCH64 && LINUX && HOST_ANDROID]
(__data_start): Do not declare extern variable.
* include/private/gcconfig.h [AARCH64 && LINUX && HOST_ANDROID]
(SEARCH_FOR_DATA_START): Define (instead of DATASTART); add comment.
(cherry picked from commit fdf4b56cba6c7eec2b4459eee69ec63377e10571)
-rw-r--r-- | include/private/gcconfig.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 7ecaf955..f04263a2 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -2268,9 +2268,16 @@ EXTERN_C_BEGIN # define OS_TYPE "LINUX" # define LINUX_STACKBOTTOM # define DYNAMIC_LOADING - extern int __data_start[]; +# if defined(HOST_ANDROID) +# define SEARCH_FOR_DATA_START + /* As of NDK r18b, __data_start is not provided */ + /* if "gold" linker is used. But __dso_handle */ + /* symbol should be usable instead. */ +# else + extern int __data_start[]; +# define DATASTART ((ptr_t)__data_start) +# endif extern int _end[]; -# define DATASTART ((ptr_t)__data_start) # define DATAEND ((ptr_t)(&_end)) # endif # ifdef DARWIN |