Search Issue Tracker
Won't Fix
Votes
1
Found in
2019.2.0a9
Issue ID
1150223
Regression
No
[Android] [IL2CPP] Flag --long-plt is missing when building a release build (Error: PLT offset too large, try with --long-plt)
Link error "android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.gold: error: PLT offset too large, try linking with --long-plt" is shown when building a release build wih 2019.1.0a9" is shown when making a release build with Unity 2019.2.0a9.
This issue only occurs for Android release builds. We are not sure if --long-plt was removed in 2019 or there is a different issue causing the error.
Request: please add a flag --long-plt
Steps:
1. Download and open project from ownCloud (see edit)
2. Switch to Android
3. In menu bar: Build > Select Configuration
4. Choose or make sure it's using Development Bundle
5. Click Code Only
6. Wait 5-60 minutes
Result: After some time building assetbundles, it finally get to the linking phase and will fail showing this message:
android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.gold: error: PLT offset too large, try linking with --long-plt
Reproduced with: 2019.2.0a9
Not reproduced with: 2020.1.0a25 (due to errors in Console), 2019.3.2f1 (due to errors in Console), 2018.4 and earlier (due to errors in Console)
WORKAROUND: add the following line at the top of BuildCodeAndRun() in AndroidUtils.cs:
PlayerSettings.SetAdditionalIl2CppArgs("--command-log=on --linker-flags=\"-Wl,--long-plt\"");
-
Flexford
Dec 06, 2022 11:21
Also it's can be when you build IL2CPP with build option 'allowDebugging'
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Editor crashes on StoredGraphicsBuffer::GetGfxBufferID when VFX Graph property is modified during Play Mode and Application.targetFrameRate is used to limit FPS
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
- "TLS Allocator ALLOC_TEMP_TLS" errors are thrown when unsuccessfully importing an FBX file
Resolution Note:
The workaround of:
PlayerSettings.SetAdditionalIl2CppArgs("--command-log=on --linker-flags=\"-Wl,--long-plt\"");
is the way to do it. Note, that the linker used by Unity depends on Unity version and ARMv7 vs ARM64, the bfd linker does not have --long-plt option.