I'm able to build both Production and Development, but not script debugging on

Hi there,

I’m able to build both Prod and Development build for Android but not when i check Script Debugging + Wait for Managed Debugger.

Please advise

Building Library\Bee\artifacts\Android\d8kzr\libil2cpp.so failed with output:
Library/Bee/artifacts/Android/87lik/20dd_6_vm3.lump.o: In function `il2cpp::os::ThreadLocalValueImpl::GetValue(void**)':
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\os\Posix/ThreadLocalValueImpl.h:51:(.text._ZN6il2cpp2vm6Domain10ContextSetEP16Il2CppAppContext+0x18): relocation truncated to fit: R_AARCH64_CALL26 against symbol `pthread_getspecific@@LIBC' defined in .text section in D:/Program Files/Unity Editors/2021.2.0b16/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\os\Posix/ThreadLocalValueImpl.h:51:(.text._ZN6il2cpp2vm6Thread7CurrentEv+0xc): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `pthread_getspecific@@LIBC' defined in .text section in D:/Program Files/Unity Editors/2021.2.0b16/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\os\Posix/ThreadLocalValueImpl.h:51:(.text._ZN6il2cpp2vm6Domain10ContextGetEv+0x10): relocation truncated to fit: R_AARCH64_CALL26 against symbol `pthread_getspecific@@LIBC' defined in .text section in D:/Program Files/Unity Editors/2021.2.0b16/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/20dd_6_vm3.lump.o: In function `il2cpp::vm::GlobalMetadata::GetTypeInfoFromTypeDefinitionIndex(int)':
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\vm/GlobalMetadata.cpp:660:(.text._ZN6il2cpp2vm14GlobalMetadata34GetTypeInfoFromTypeDefinitionIndexEi+0x40c): relocation truncated to fit: R_AARCH64_CALL26 against symbol `_Unwind_Resume' defined in .text section in D:/Program Files/Unity Editors/2021.2.0b16/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x\libgcc_real.a(unwind-dw2.o)
Library/Bee/artifacts/Android/87lik/20dd_6_vm3.lump.o: In function `~FastAutoLock':
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\utils\..\os/Mutex.h:86:(.text._ZN6il2cpp2os12FastAutoLockD2Ev[_ZN6il2cpp2os12FastAutoLockD2Ev]+0x50): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__clang_call_terminate' defined in .text.__clang_call_terminate[__clang_call_terminate] section in Library/Bee/artifacts/Android/d8kzr/yooz_-firstpass.o
Library/Bee/artifacts/Android/87lik/20dd_6_vm3.lump.o: In function `il2cpp::vm::GlobalMetadata::GetCustomAttributeTypeToken(Il2CppImage const*, unsigned int)':
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\vm/GlobalMetadata.cpp:928:(.text._ZN6il2cpp2vm14GlobalMetadata27GetCustomAttributeTypeTokenEPK11Il2CppImagej+0x44): relocation truncated to fit: R_AARCH64_CALL26 against symbol `bsearch@@LIBC' defined in .text section in D:/Program Files/Unity Editors/2021.2.0b16/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/20dd_6_vm3.lump.o: In function `il2cpp::vm::GlobalMetadata::GetCustomAttributeDataRange(Il2CppImage const*, unsigned int)':
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\vm/GlobalMetadata.cpp:941:(.text._ZN6il2cpp2vm14GlobalMetadata27GetCustomAttributeDataRangeEPK11Il2CppImagej+0x48): relocation truncated to fit: R_AARCH64_CALL26 against symbol `bsearch@@LIBC' defined in .text section in D:/Program Files/Unity Editors/2021.2.0b16/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/20dd_6_vm3.lump.o: In function `il2cpp::vm::GlobalMetadata::GetCustomAttributeTypeToken(Il2CppImage const*, unsigned int)':
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\vm/GlobalMetadata.cpp:928:(.text._ZN6il2cpp2vm14GlobalMetadata29GenerateCustomAttributesCacheEPK11Il2CppImagej+0x4c): relocation truncated to fit: R_AARCH64_CALL26 against symbol `bsearch@@LIBC' defined in .text section in D:/Program Files/Unity Editors/2021.2.0b16/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/20dd_6_vm3.lump.o: In function `il2cpp::utils::CallOnce(il2cpp::utils::OnceFlag&, void (*)(void*), void*)':
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\utils/CallOnce.h:44:(.text._ZL37GenerateCustomAttributesCacheInternalPK25Il2CppImageGlobalMetadatai+0x310): relocation truncated to fit: R_AARCH64_CALL26 against symbol `_Unwind_Resume' defined in .text section in D:/Program Files/Unity Editors/2021.2.0b16/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x\libgcc_real.a(unwind-dw2.o)
Library/Bee/artifacts/Android/87lik/20dd_6_vm3.lump.o: In function `il2cpp::vm::GlobalMetadata::GetCustomAttributeTypeToken(Il2CppImage const*, unsigned int)':
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\il2cpp\libil2cpp\vm/GlobalMetadata.cpp:928:(.text._ZN6il2cpp2vm14GlobalMetadata12HasAttributeEPK11Il2CppImagejP11Il2CppClass+0x54): relocation truncated to fit: R_AARCH64_CALL26 against symbol `bsearch@@LIBC' defined in .text section in D:/Program Files/Unity Editors/2021.2.0b16/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/20dd_6_vm3.lump.o: In function `std::__ndk1::__libcpp_allocate(unsigned long, unsigned long)':
D:/Program Files\Unity Editors\2021.2.0b16\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\..\sysroot\usr\include\c++\v1/new:253:(.text._ZN6il2cpp2vm14GlobalMetadata20GetAllManagedMethodsERNSt6__ndk16vectorI19MethodDefinitionKeyNS2_9allocatorIS4_EEEE+0x160): additional relocation overflows omitted from the output
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
A

This error usually means that the executable code in the project is too large. There is a bug in the Android NDK linker that causes this issue.

You can work around this by changing the IL2CPP Code Generation option in the Build Settings window to a value of “Faster (smaller) builds”. This will decrease the executable code size, and often can allow a script debugging enabled build to succeed when it fails like this.

3 Likes

Faster smaller builds actually start throwing AOT issues as im using Zenject + JsonDotNet a lot
I tried using linker but that didnt solve the problem

Can you let me know which AOT issues you see? This mode should actually do a better job of avoiding AOT issues, because it generates shared versions of all generic types.

1 Like

A simple call like this was crashing the app on android while using faster builds
var jData = JsonConvert.DeserializeObject(json)[“data”];

Do you have a call stack or crash dump available when this crash happens?

1 Like

I could get a player log right before it happens, for windows IL2CPP with script debugging on
and this is where it crashes, i spent almost a day chasing this issue

Let me provide it tomorrow

1 Like

Here it is

7606537–944602–Crash_2021-10-27_113434928.zip (63.2 KB)

Thanks! Can you submit a project that causes this along with a bug report? This looks like something we should investigate and correct.

Hi, I’ve just tried upgrading to unity 2021.2 from 2020.3.11 and I am noticing the same issue as the original post. Has there been any progress on this? Building for release or development is fine but building for development with allow debugging and wait for player connection throws me the following error…

Building Library/Bee/artifacts/Android/d8kzr/libil2cpp.so failed with output:
Library/Bee/artifacts/Android/87lik/1kkz_e_vm5.lump.o: In function `il2cpp::vm::Field::SetValueRaw(Il2CppType const*, void*, void*, bool)':

I’ve attached a full build log if it’s of any help diagnosing.

It seems when allow debugging is selected the build takes significantly longer and uses up a lot more resources on my mac (Everything else grinds to a halt) before failing. Switching IL2CPP Code Generation to Faster (smaller) builds produces the same results.

7681315–960121–unity-2021-development-build-failure.txt (249 KB)

Thanks for the information. We have not made any progress on this issue. Actually there seem to be two issues here.

First, the linker error during a build when script debugging is enabled. This is a known issue with the Android NDK tools when the executable code size is too large. When script debugging is enabled, IL2CPP has to inject extra code into the generated code stream to support script debugging, so the code size can grow too large and trigger this problem in the Android NDK linker.

Since switching IL2CPP Code Generation to Faster (smaller) builds does not correct the issue for your case, I don’t have a good solution. We are working on an update to the Android NDK where the llvm linker will be used. I don’t believe that linker has this same problem. Until that is ready though, your best option is to try to make the executable code in the project smaller, if at all possible.

Second, there was an error at run time which occurred, but I don’t believe that we received a bug report about that issue.

We are also encountering this issue, the error changes with different settings but script debugging is a no go. Any timelines on a fix would be good, once the project expands a bit if we hit this on our final build scripts it will be quite troublesome.

A sample of our build failures:

Building Library\Bee\artifacts\Android\19qtv\libil2cpp.so failed with output:
C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(locale.o): In function `std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char> > std::__ndk1::num_get<char, std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char> > >::__do_get_floating_point<long double>(std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char> >, std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char> >, std::__ndk1::ios_base&, unsigned int&, long double&) const':
/buildbot/src/android/ndk-release-r21/external/libcxx/include/locale:1015:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_]+0x54): relocation truncated to fit: R_AARCH64_CALL26 against symbol `std::__ndk1::__num_get<char>::__stage2_float_prep(std::__ndk1::ios_base&, char*, char&, char&)' defined in .text._ZNSt6__ndk19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_[_ZNSt6__ndk19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_] section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(locale.o)
C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(locale.o): In function `std::__ndk1::_DeallocateCaller::__do_call(void*)':
/buildbot/src/android/ndk-release-r21/external/libcxx/include/new:334:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_]+0x2d0): relocation truncated to fit: R_AARCH64_CALL26 against symbol `operator delete(void*)' defined in .text._ZdlPv section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(new.o)
/buildbot/src/android/ndk-release-r21/external/libcxx/include/new:334:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_]+0x2e0): relocation truncated to fit: R_AARCH64_CALL26 against symbol `operator delete(void*)' defined in .text._ZdlPv section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(new.o)
/buildbot/src/android/ndk-release-r21/external/libcxx/include/new:334:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_]+0x370): relocation truncated to fit: R_AARCH64_CALL26 against symbol `operator delete(void*)' defined in .text._ZdlPv section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(new.o)
/buildbot/src/android/ndk-release-r21/external/libcxx/include/new:334:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_]+0x380): relocation truncated to fit: R_AARCH64_CALL26 against symbol `operator delete(void*)' defined in .text._ZdlPv section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(new.o)
C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(locale.o): In function `void std::__ndk1::call_once<std::__ndk1::(anonymous namespace)::__fake_bind>(std::__ndk1::once_flag&, std::__ndk1::(anonymous namespace)::__fake_bind&&)':
/buildbot/src/android/ndk-release-r21/external/libcxx/include/mutex:675:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv]+0xa4): relocation truncated to fit: R_AARCH64_CALL26 against symbol `std::__ndk1::__call_once(unsigned long volatile&, void*, void (*)(void*))' defined in .text._ZNSt6__ndk111__call_onceERVmPvPFvS2_E section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(mutex.o)
C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(locale.o): In function `std::__ndk1::num_get<char, std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char> > >::do_get(std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char> >, std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char> >, std::__ndk1::ios_base&, unsigned int&, void*&) const':
/buildbot/src/android/ndk-release-r21/external/libcxx/include/locale:1094:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv]+0x2dc): relocation truncated to fit: R_AARCH64_CALL26 against symbol `std::__ndk1::__libcpp_sscanf_l(char const*, __locale_t*, char const*, ...)' defined in .text._ZNSt6__ndk117__libcpp_sscanf_lEPKcP10__locale_tS1_z[_ZNSt6__ndk117__libcpp_sscanf_lEPKcP10__locale_tS1_z] section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(locale.o)
C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(locale.o): In function `std::__ndk1::_DeallocateCaller::__do_call(void*)':
/buildbot/src/android/ndk-release-r21/external/libcxx/include/new:334:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv]+0x344): relocation truncated to fit: R_AARCH64_CALL26 against symbol `operator delete(void*)' defined in .text._ZdlPv section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(new.o)
/buildbot/src/android/ndk-release-r21/external/libcxx/include/new:334:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv]+0x354): relocation truncated to fit: R_AARCH64_CALL26 against symbol `operator delete(void*)' defined in .text._ZdlPv section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(new.o)
C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(locale.o): In function `std::__ndk1::__cloc()':
/buildbot/src/android/ndk-release-r21/external/libcxx/src/locale.cpp:75:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv]+0x3d0): relocation truncated to fit: R_AARCH64_CALL26 against symbol `newlocale@@LIBC' defined in .text section in C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
C:/Program Files/Unity/Hub/Editor/2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android\libc++_static.a(locale.o): In function `std::__ndk1::_DeallocateCaller::__do_call(void*)':
/buildbot/src/android/ndk-release-r21/external/libcxx/include/new:334:(.text._ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv[_ZNKSt6__ndk17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv]+0x454): additional relocation overflows omitted from the output
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
BuildAssetBundlesAutomatically:BuildPlayerHandler (UnityEditor.BuildPlayerOptions) (at Assets/00_Everything/ResourcesStatic/Scripts/AssetBundleSystem/BuildAssetBundlesAutomatically.cs:76)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)

Right now we’re targeting Unity 2022.2 for use of an updated NDK version and use of the lld linker, which should avoid these linker bugs.

1 Like

I’m using 2021.2.5f1 version and I got a similar error when the “script debugging” is checked (unchecking it solve the problem, cleaning all cache and build dir did not help):

Building Library/Bee/artifacts/Android/d8kzr/libil2cpp.so failed with output:
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `il2cpp::os::MarshalAlloc::Allocate(unsigned long)':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/MarshalAlloc.cpp:14:(.text._ZN6il2cpp2os12MarshalAlloc8AllocateEm+0x0): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `malloc@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `il2cpp::os::MarshalAlloc::Free(void*)':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/MarshalAlloc.cpp:24:(.text._ZN6il2cpp2os12MarshalAlloc4FreeEPv+0x0): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `free@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `il2cpp::os::MarshalAlloc::AllocateHGlobal(unsigned long)':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/MarshalAlloc.cpp:29:(.text._ZN6il2cpp2os12MarshalAlloc15AllocateHGlobalEm+0x0): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `malloc@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `il2cpp::os::MarshalAlloc::FreeHGlobal(void*)':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/MarshalAlloc.cpp:39:(.text._ZN6il2cpp2os12MarshalAlloc11FreeHGlobalEPv+0x0): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `free@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `il2cpp::os::Memory::AlignedAlloc(unsigned long, unsigned long)':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/Memory.cpp:18:(.text._ZN6il2cpp2os6Memory12AlignedAllocEmm+0xc): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `memalign@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `il2cpp::os::Memory::AlignedReAlloc(void*, unsigned long, unsigned long)':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/Memory.cpp:28:(.text._ZN6il2cpp2os6Memory14AlignedReAllocEPvmm+0x10): relocation truncated to fit: R_AARCH64_CALL26 against symbol `realloc@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `il2cpp::os::Memory::AlignedAlloc(unsigned long, unsigned long)':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/Memory.cpp:18:(.text._ZN6il2cpp2os6Memory14AlignedReAllocEPvmm+0x2c): relocation truncated to fit: R_AARCH64_CALL26 against symbol `memalign@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `il2cpp::os::Memory::AlignedReAlloc(void*, unsigned long, unsigned long)':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/Memory.cpp:36:(.text._ZN6il2cpp2os6Memory14AlignedReAllocEPvmm+0x3c): relocation truncated to fit: R_AARCH64_CALL26 against symbol `memcpy@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/Memory.cpp:37:(.text._ZN6il2cpp2os6Memory14AlignedReAllocEPvmm+0x44): relocation truncated to fit: R_AARCH64_CALL26 against symbol `free@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `il2cpp::os::Memory::AlignedFree(void*)':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/Memory.cpp:43:(.text._ZN6il2cpp2os6Memory11AlignedFreeEPv+0x0): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `free@@LIBC' defined in .text section in /Applications/Unity/Hub/Editor/2021.2.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/21/libc.so
Library/Bee/artifacts/Android/87lik/2ad5_osix3.lump.o: In function `PosixAutoLock':
/Applications/Unity/Hub/Editor/2021.2.5f1/Unity.app/Contents/il2cpp/libil2cpp/os/Posix/PosixHelpers.h:44:(.text._ZN6il2cpp2os9MutexImpl6UnlockEv+0x24): additional relocation overflows omitted from the output
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:462)

I also have an issue with a shader when the “script debugging” option is checked:

Shader error in 'Hidden/Universal/CoreBlit': invalid subscript 'positionCS' at /Users/godboutj/Code/gf-asbuiltdrawingapp/Library/PackageCache/com.unity.render-pipelines.core@12.1.2/Runtime/Utilities/Blit.hlsl(92) (on gles)

Compiling Vertex program
Platform defines: SHADER_API_MOBILE UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3
Disabled keywords: BLIT_SINGLE_SLICE DISABLE_TEXTURE2D_X_ARRAY SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING

Shader error in 'Hidden/kMotion/CameraMotionVectors': SV_VertexID semantic is not supported on GLES 2.0 at line 11 (on gles)

Compiling Vertex program
Platform defines: SHADER_API_MOBILE UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3
Disabled keywords: SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING
1 Like

The shader error is not one I’ve seen before, so I can’t offer any help there, unfortunately.

The other error is the common one we see with projects on Android that get too large (in executable code size) when script debugging is enabled. Unity is planning an NDK update that will eliminate this issue, but I’m not sure yet which version of Unity will have it.

That’s sad that the 2021.1.x was generating smaller images then! cause If I take the same solution to the 2021.1.x I can debug it no problems where 2021.2.x choke on it! is the unity framework just getting just and we are so unlucky that we do cross a gap barely? If so we will soon have the problems into 2021.1.x build too, which will put our developer to an alt to debug under Android.

I begin to regret all that Unity development, it’s painful, bad player with CI, awful package manager and git integration, cloudy future with .Net version, now the debugger that doesn’t work on some platform with a not so very large application at all… Damn, I guess it’s time to give 8thwall, Vuforia or Wikitude or something like it a shot to see if we can ditch Unity and stop the wasted time bleed.

1 Like

Any update on this? I cannot enable script debugging on my 2D mobile game for android, which is quite limiting to my workflow. I’m using Unity 2021.2.

We have changes on the way to Unity 2022.2 that will use a newer version of the Android NDK and switch to use the lld linker, which seems to handle these large executables much better. But I don’t have an ETA for those to be available yet.

1 Like

atleast is is being solved, and that is good news :slight_smile:

Thanks for the quick reply. Any chance those changes would be backported to 2021?