# Clang 4.0 support

**URL:** <https://forums.unrealengine.com/t/clang-4-0-support/391467>\
**Category:** Platform & Builds\
**Tags:** clang, Linux, unreal-engine, crash, UE4, CPP, question\
**Created:** [April 20, 2017, 11:46pm UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467 "2017-04-20T23:46:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4efcd70](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4efcd70](https://forums.unrealengine.com/u/anonymous_user_d4efcd70)\
**Post date:** [April 20, 2017, 11:46pm UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467/1 "2017-04-20T23:46:59Z")

</div>

It looks like a lot of the Linux distros are starting to push out clang 4.0. I haven’t seen anything in the issue tracker for 4.0 support. So, I just thought being aware of this for 4.16 would be a good idea.

---

<div class="post-metadata">

**Author:** ![Acheta\_Games](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Acheta\_Games](https://forums.unrealengine.com/u/Acheta_Games)\
**Post date:** [April 22, 2017, 5:01pm UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467/2 "2017-04-22T17:01:52Z")

</div>

I can agree with this, it does seem just like an artificial limitation of the clang versions. In the mean time most distros do have the dependency set for Clang 3.5, so…

---

<div class="post-metadata">

**Author:** ![jaked122](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jaked122](https://forums.unrealengine.com/u/jaked122)\
**Post date:** [April 23, 2017, 10:28pm UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467/3 "2017-04-23T22:28:30Z")

</div>

Sadly I can’t have both the newest clang and clang35 installed, so I’m not really sure where to go from there.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4efcd70](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4efcd70](https://forums.unrealengine.com/u/anonymous_user_d4efcd70)\
**Post date:** [April 24, 2017, 12:12am UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467/4 "2017-04-24T00:12:46Z")

</div>

3.9 works perfectly fine as far as I’m aware. I know arch has a patch that gets the engine to start compilation on 4.0, but some of the actual engine code needs to be updated to support 4.0’s changes. I’ll be looking into it within the next week.

---

<div class="post-metadata">

**Author:** ![RCL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RCL](https://forums.unrealengine.com/u/RCL)\
**Post date:** [April 24, 2017, 1:02am UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467/5 "2017-04-24T01:02:15Z")

</div>

4.16 can be compiled with clang 4.0. Moreover, it is included in the new cross-toolchain that is shipped with 4.16.

---

<div class="post-metadata">

**Author:** ![cemas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cemas](https://forums.unrealengine.com/u/cemas)\
**Post date:** [August 8, 2017, 9:38pm UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467/6 "2017-08-08T21:38:22Z")

</div>

Is this also true for 4.17?  
Compiling 4.17 on Ubuntu 17.04 x64 with clang 4.0 does not work for me:

_clang: error: unable to execute command: Segmentation fault (core dumped)_

_clang: error: clang frontend command failed due to signal (use -v to see invocation)_

_clang version 4.0.0-1ubuntu1 (tags/RELEASE\_400/rc1)_

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4efcd70](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4efcd70](https://forums.unrealengine.com/u/anonymous_user_d4efcd70)\
**Post date:** [August 8, 2017, 10:29pm UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467/7 "2017-08-08T22:29:06Z")

</div>

It compiles fine on Arch. Look in the aur for our copy of Unreal with patches. You might need to patch the compilation command Unreal uses to not apply pie, while compiling.

---

<div class="post-metadata">

**Author:** ![RCL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RCL](https://forums.unrealengine.com/u/RCL)\
**Post date:** [August 8, 2017, 11:54pm UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467/8 "2017-08-08T23:54:44Z")

</div>

Notice that Ubuntu 17.04 shipped pre-release clang (RC1). RC1 cannot compile the engine due to bugs that were fixed in the final version. Look for clang version that says tags/RELEASE\_400/final)

---

<div class="post-metadata">

**Author:** ![cemas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cemas](https://forums.unrealengine.com/u/cemas)\
**Post date:** [August 10, 2017, 2:32pm UTC](https://forums.unrealengine.com/t/clang-4-0-support/391467/9 "2017-08-10T14:32:54Z")

</div>

Thank you!  
The second clang version of Ubuntu 17.04 (clang 3.9.1-5ubuntu1 (tags/RELEASE\_391/rc2)) also did not work and 4.0final would not install due to the installed 4.0rc1.  
Ultimately, I downloaded 3.8 and compiled successfully.
