Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Frooxius · Aug 03, 2018 at 07:37 AM · androidbuild-erroril2cppassembly

Assertion Fail in elf32-arm.c:7827 when building for Android with IL2CPP

Hello,

I am trying to build my project with IL2CPP for Android, but I keep hitting strange issues and compiler errors that I have no idea how to fix or to even work out what could be causing them.

I have tried removing .NET assemblies from the project one by one, but it seems to be trigerred by the major one, which has a lot of dependencies and is very big on itself, so it takes long time to replicate (Unity's bug report team complained about this and asked for a smaller version, but I just can't reduce it any further, so I'm on my own).

Here's what I found:

  • Happens with recent version of Unity (2018.1.9f)

  • Compiling the same codebase with IL2CPP for Windows works

  • The major library which triggers this doesn't have any P/Invoke methods, its dependencies do

  • Compiling only the dependencies with link.xml works fine

  • Seems like a potential bug in the NDK itself, specifically the linker which fails

  • List item

The error output generates many assertion fails in the elf32-arm.c file on line 7827, the assert in that file is this:

 BFD_ASSERT ((got_displacement & 0xf0000000) == 0);

(whole source here: https://android.googlesource.com/toolchain/binutils/+/ndk-r13-beta1/binutils-2.25/bfd/elf32-arm.c )

I'm not sure what this does though and what could be potentially even causing it in my own code. I'd appreciate it if anyone has any ideas where to look or how I could isolate this.

Here's the error output from Unity Editor:

 stdout:
 Building libil2cpp.so with AndroidToolChain.
     Output directory: D:\Sync\Projects\Software\Applications\NeoS\Testing\IL2CPP_Bug3\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a
     Cache directory: D:\Sync\Projects\Software\Applications\NeoS\Testing\IL2CPP_Bug3\Library\il2cpp_android_armeabi-v7a\il2cpp_cache
 ObjectFiles: 1665 of which compiled: 0
 Total compilation time: 877 milliseconds.
 il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\android-ndk-r13b\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\Tomas\AppData\Local\Temp\tmp5EF.tmp" -o "D:\Sync\Projects\Software\Applications\NeoS\Testing\IL2CPP_Bug3\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_F38F1A33880E1CAB2A23B46AA75CE1D0\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "C:\android-ndk-r13b\platforms\android-16\arch-arm" -gcc-toolchain "C:\android-ndk-r13b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "C:\android-ndk-r13b\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -lgnustl_static -llog -Xlinker -Map="D:\Sync\Projects\Software\Applications\NeoS\Testing\IL2CPP_Bug3\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_F38F1A33880E1CAB2A23B46AA75CE1D0\libil2cpp.map" -rdynamic -fPIE -pie -fuse-ld=bfd.exe
 
 clang++.exe: warning: argument unused during compilation: '-pie'
 C:\android-ndk-r13b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld.bfd.exe: BFD (binutils-2.25-0666073) 2.25.51.20141117 assertion fail /usr/local/google/buildbot/src/android/gcc/toolchain/build/../binutils/binutils-2.25/bfd/elf32-arm.c:7827
 C:\android-ndk-r13b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld.bfd.exe: BFD (binutils-2.25-0666073) 2.25.51.20141117 assertion fail /usr/local/google/buildbot/src/android/gcc/toolchain/build/../binutils/binutils-2.25/bfd/elf32-arm.c:7827
 C:\android-ndk-r13b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld.bfd.exe: BFD (binutils-2.25-0666073) 2.25.51.20141117 assertion fail /usr/local/google/buildbot/src/android/gcc/toolchain/build/../binutils/binutils-2.25/bfd/elf32-arm.c:7827
 
 < This repeats for a few hundred lines >
 
 C:\android-ndk-r13b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld.bfd.exe: BFD (binutils-2.25-0666073) 2.25.51.20141117 assertion fail /usr/local/google/buildbot/src/android/gcc/toolchain/build/../binutils/binutils-2.25/bfd/elf32-arm.c:7827
 C:\android-ndk-r13b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld.bfd.exe: BFD (binutils-2.25-0666073) 2.25.51.20141117 assertion fail /usr/local/google/buildbot/src/android/gcc/toolchain/build/../binutils/binutils-2.25/bfd/elf32-arm.c:7827
 clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
 
 
    at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(IEnumerable`1 objectFiles, CppToolChainContext toolChainContext)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner(CppProgramBuilder builder, IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by JoshPeterson · Aug 03, 2018 at 11:58 AM

This looks like a bug in the Android linker provided with the NDK. It might be worth submitting a bug report to Unity so that we can investigate it. In Unity 2018.3 (yet to be released) we've updated to a new version of the Android NDK, so that might be worth trying when the 2018.3 beta releases are available.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Frooxius · Aug 03, 2018 at 11:31 PM 0
Share

Thanks for the answer, I'll try 2018.3 beta as soon as it's out.

I wasn't sure if submitting another bug is a good idea, since I did that several times with this project already (although with different compilation errors that I managed to work around) and the size of the project seems to be a problem for reproducing as it takes a while.

I've submitted the report with this specific issue and details here: https://fogbugz.unity3d.com/default.asp?1067240_agp1gmkiu00omkjq

avatar image JoshPeterson Frooxius · Aug 06, 2018 at 11:54 AM 0
Share

Thanks, we'll investigate this issue.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

268 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android app not building after switching to il2cpp 0 Answers

IL2CPP did not run probbably,IL2CPP Did not run probbably 0 Answers

il2cpp android build error 2019.2.19f1 1 Answer

Failed running IL2CPP on Android with "error: expected expression" (Unity 2018.1.6) 0 Answers

Assembly cannot be loaded on Cloud Build. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges