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
- UI Overlay Image gets darker on each Camera when multiple Cameras are used
- Assertion failed on expression: 'scriptedImporterClass == SCRIPTING_NULL error when opening the standalone profiler window
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
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.