Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by meltysmores · Aug 19, 2020 at 07:20 AM · webglil2cpp

How exactly do I specify an IL2CPP compiler flag?

I'm trying to produce a WebGL build of my application. I'm running into an issue during IL2CPP:

 note: use -fbracket-depth=N to increase maximum nesting level
 1 error generated.
 ERROR:root:compiler frontend failed to generate LLVM bitcode, halting

I have tried creating an editor script:

 using UnityEditor;
 
 public class CompilerFlags : Editor
 {
     void OnInit()
     {
         PlayerSettings.SetAdditionalIl2CppArgs("--compiler-flags=\"-fbracket-depth=1024\"");
     }
 }

I have also tried specifying -fbracket-depth=1024 in the "Scripting Define Symbols" in the PlayerSettings (see below) along with other variations including "-DIL2CPP_ADDITIONAL_ARGS=1:-fbracket-depth=1024", "IL2CPP_ADDITIONAL_ARGS=1:-fbracket-depth=1024", "IL2CPP_ADDITIONAL_ARGS:-fbracket-depth=1024" alt text

Additionally, I have also tried adding this flag to the emscripten.config file (in C:\Program Files\Unity\Hub\Editor\2019.2.17f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config)

 import os
 LLVM_ROOT=os.getenv('LLVM')
 NODE_JS=[os.getenv('NODE'),'--stack_size=8192','--max-old-space-size=4096','--fbracket-depth=1024'] 
 EMSCRIPTEN_ROOT=os.getenv('EMSCRIPTEN')
 SPIDERMONKEY_ENGINE = ''
 V8_ENGINE = ''
 TEMP_DIR = os.getenv('EMSCRIPTEN_TMP')
 BINARYEN_ROOT = os.getenv('BINARYEN')
 COMPILER_ENGINE = NODE_JS
 JS_ENGINES = [NODE_JS]
 JAVA = ''

The problem is, for all these variations I've tried, I can't see the compiler flag show up in my log when the build fails, so I'm assuming it's not actually being utilized by the compiler. What am I doing wrong/what alternatives do you have for setting this compiler flag?

To make things more interesting, if I don't make any of these modifications and instead check the box for a "Development Build" in the build settings, the build succeeds. Mind Blown

Notes: I'm running on Windows 10 with Unity 2019.2.17f1

symbol-define.png (12.4 kB)
Comment
Add comment · Show 3
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 xxmariofer · Aug 19, 2020 at 08:55 AM 0
Share

maybe @JoshPeterson can help you

avatar image JoshPeterson · Aug 19, 2020 at 11:05 AM 0
Share

I don't see a way that you can do this. The --compiler-flags= option should work, but since it does not, I don't see any other options. Can you submit a bug report for this issue? This is something we should correct.

avatar image Petr777 · Nov 23, 2020 at 03:27 PM 0
Share

can you tell please, did you solve this?

0 Replies

· Add your reply
  • Sort: 

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

139 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

Related Questions

Asset Bundle code stripping / link.xml not working 1 Answer

WebGL Build Error: IL2CPP error 0 Answers

IL2CPP throws null exception when compiling .dll plugin for WebGL 0 Answers

WebGL build failed: "il2cpp.exe did not run properly". 1 Answer

change Scripting Backend from default to IL2CPP 3 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