Bug 102318

Summary: Mesa3D Scons build - LLVM 5.0 not supported
Product: Mesa Reporter: pal1000 <liviuprodea>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: major    
Priority: medium CC: genpfault, jfonseca
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=100201
Whiteboard:
i915 platform: i915 features:
Attachments: Mesa3D scons build output with LLVM 5.0 and MSVC
Patch that enables LLVM 5.0 support to Mesa3D scons build

Description pal1000 2017-08-20 09:19:50 UTC
Created attachment 133638 [details]
Mesa3D scons build output with LLVM 5.0 and MSVC

I tried building Mesa using Scons and LLVM 5.0 RC2 on Windows using MSVC.
It appears that LLVM 5.0 changes stuff once again. According to the error message Mesa3D attempts to call a LLVM function with incorrect number of parameters.
Comment 1 Emil Velikov 2017-08-30 07:55:29 UTC
Based on the error message, it seems that the HAVE_LLVM does not end up with the correct version (0x0500).

To fix this you want to look at the way llvm_version is handled in scons/llvm.py.
I doubt I'll have time to look at this soon, but you're more than welcome to send patches [1]

[1] https://www.mesa3d.org/submittingpatches.html
Comment 3 pal1000 2017-09-14 09:07:55 UTC
Created attachment 134221 [details] [review]
Patch that enables LLVM 5.0 support to Mesa3D scons build

Here is the patch that adds support for LLVM 5.0 to Scons build.
Turned out to be very straight-forward.
Comment 4 Emil Velikov 2017-09-14 13:50:48 UTC
(In reply to Alex Granni from comment #3)
> Created attachment 134221 [details] [review] [review]
> Patch that enables LLVM 5.0 support to Mesa3D scons build
> 
> Here is the patch that adds support for LLVM 5.0 to Scons build.
> Turned out to be very straight-forward.

Nicely done. Please sent it to the list for review.
Small nit: please keep the hunk alike the 4.0 one, adding any extra entries at the end.
Comment 5 Emil Velikov 2017-09-19 11:21:47 UTC
Should be fixed with the following. I'll pick it up for 17.2 series.

commit c1b01370486d203a6bccff2161afb288cfda1de3
Author: Alexandru-Liviu Prodea <liviuprodea@yahoo.com>
Date:   Fri Sep 15 07:26:33 2017 +0000

    Scons: Add LLVM 5.0 support

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.