<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
<div><br></div><div>Automatic wrap with llvm-config does get the version right so it has to be something else.</div><div><br></div><div>I usually build LLVM myself like this:</div><div><br></div><div><br></div><div><span>cd llvm-7.0.0.src & md buildsys-x86 & cd buildsys-x86 & cmake -G "Ninja" -Thost=x64 -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../x86 ..</span></div><div><span><br></span></div><div><span><br></span></div><div><span>Followed by ninja install<br></span></div><div><span><br></span></div><div><span><br></span></div><div><span>LLVM 6.0.1 was also affected<br></span></div><div><span><br></span></div><div><span><br></span></div><div><span>I also downloaded and tried LLVM 5.0.1 MTd x86 build that Appveyor uses and built Mesa with Meson 0.47.2, used the llvm-wrap included in Mesa codebase and passed the exact same c_args and cpp_args as Appveyor. Unfortunately I was greeted by an assertion failure as soon as I began testing it so I don't know if it has llvmpipe active or not. <br></span></div><div><span><br></span></div><div><span>Mesa3D build config - Meson 0.48.0<br></span></div><div><span><br></span></div><div><span><span><br></span></span></div><div><span><span>C:\Software\DEVELO~1\projects\mesa\Py3\Scripts\meson.exe x86 --backend=vs2017 --buildtype=plain -Db_vscrt=mt -Dllvm-wrap=llvm</span><br></span></div><div><span><br></span></div><div><span><br></span></div><div><span>Omission of -Dllvm=true doesn't seam to make any difference as long as I have -Dllvm-wrap in, as I tried both ways.</span></div><div><span><br></span></div><div><span><br></span></div><div><span>-Db_vscrt appears to be non functional as it still builds with the defaults /MD /O2.</span></div><div><span>Changing buildtype from plain to release makes no difference as well. It still does a /MD /O2 build.<br></span></div><div><span><br></span></div><div><span><br></span></div><div><span><br></span></div><div><span><br></span></div><div><span><br></span></div><div><span><br></span></div><div><span><br></span></div><div><span><br></span></div><div><span><br></span></div><div><span></span><br></div>
</div><div id="yahoo_quoted_8550870394" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Wednesday, October 3, 2018, 12:26:33 AM GMT+3, Dylan Baker <dylan@pnwbakers.com> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr">Quoting Liviu Prodea (2018-10-02 14:05:09)<br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> On Tuesday, October 2, 2018, 8:08:39 PM GMT+3, Dylan Baker<br clear="none">> <<a shape="rect" ymailto="mailto:dylan@pnwbakers.com" href="mailto:dylan@pnwbakers.com">dylan@pnwbakers.com</a>> wrote:<br clear="none">> <br clear="none">> <br clear="none">> Quoting Liviu Prodea (2018-10-02 08:08:41)<br clear="none">> > Made a comprehensive test of this patch series and I still stumbled upon some<br clear="none">> > big problems:<br clear="none">> ><br clear="none">> > 1. Automatic LLVM linking via llvm-config if used by adding LLVM bin folder<br clear="none">> to<br clear="none">> > PATH results in build failure with 'llvm-c/Core.h' not found in src/gallium/<br clear="none">> > auxiliary/gallivm/lp_bld.h. Appveyor CI from <a shape="rect" href="https://ci.appveyor.com/project/" target="_blank">https://ci.appveyor.com/project/</a><br clear="none">> > dcbaker/mesa didn't encounter this as it is using llvm-wrap option.<br clear="none">> <br clear="none">> It's possible that llvm-config wrapping on windows is broken atm, it is on<br clear="none">> macos, I have pull request open, https://github.com/mesonbuild/meson/pull/4283.<br clear="none">> I'll see if that fixes windows as well, or if we need some more work there.<br clear="none">> <br clear="none">> <br clear="none">> > 2. Even if build succeeds with LLVM linked via llvm-wrap and everything<br clear="none">> looking<br clear="none">> > good at first glance, llvmpipe and swr if it was built cannot be selected.<br clear="none">> > GALLIUM_DRIVER variable has no effect. You only get softpipe despite<br clear="none">> > opengl32.dll file looking big enough and swrAVX-0.dll and swrAVX2-0,dll being<br clear="none">> > generated when expected. Even when having LLVM built dynamically to avoid /MD<br clear="none">> > to /MT override warnings and building Mesa3D with default c_args and cpp_args<br clear="none">> > this issue is still in effect.<br clear="none">> ><br clear="none">> > 3. Meson 0.48.0 doesn't pass the /MT or /MTd c_args and cpp_args for some<br clear="none">> > unexplained reasons which leads to build failure if LLVM is not built with /<br clear="none">> MD.<br clear="none">> <br clear="none">> <br clear="none">> Meson 0.48 has added a new option to allow you to pick which crt you want:<br clear="none">> <br clear="none">> <a shape="rect" href="https://mesonbuild.com/Release-notes-for-0-48-0.html#" target="_blank">https://mesonbuild.com/Release-notes-for-0-48-0.html#</a><br clear="none">> toggles-for-build-type-optimization-and-vcrt-type<br clear="none">> <br clear="none">> The list of options are here:<br clear="none">> <br clear="none">> <a shape="rect" href="https://mesonbuild.com/Builtin-options.html#base-options" target="_blank">https://mesonbuild.com/Builtin-options.html#base-options</a><br clear="none">> <br clear="none">> I'll test and see if I can add b_vscrt=from_builtype to the default options<br clear="none">> without requiring a bumpt ot 0.48.0 for the whole project.<br clear="none">> <br clear="none">> Dylan<br clear="none">> <br clear="none">> ---<br clear="none">> <br clear="none">> -Db_vscrt=mt doesn't help. I use LLVM built with /MT. I still get a bunch of<br clear="none">> <br clear="none">> error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'<br clear="none"><br clear="none">What is your -Dbuildtype set to?<br clear="none"><br clear="none">> <br clear="none">> As for why I don't get llvmpipe and swr to work when Mesa3D and LLVM CRT linking match when using manual llvm-wrap option I think the explanation is highlighted by Appveyor: <a shape="rect" href="https://ci.appveyor.com/project/dcbaker/mesa/build/job/k02oo9qfyuxaxpgi?fullLog=true#L221" target="_blank">https://ci.appveyor.com/project/dcbaker/mesa/build/job/k02oo9qfyuxaxpgi?fullLog=true#L221</a><br clear="none">> Looking at line 224, LLVN version is reported as undefined. This can't be good and I am seeing this as well. Automatic wrap with llvm-config doesn't have this problem. Unfortunately it fails to find the headers as already reported.<br clear="none"><br clear="none">In that appveyor the fact that version is undefined is harmless, it's because<br clear="none">the `project()` definition in the wrap doesn't define a version, the<br clear="none">`declare_dependency()` does that. If you're seeing that with llvm-config then<br clear="none">that's bad, and may be related to the pull request I mentioned above.<br clear="none"><br clear="none">Are you building LLVM yourself, or getting it from somewhere?<div class="yqt3985406200" id="yqtfd18010"><br clear="none"><br clear="none">Dylan</div></div></div>
</div>
</div></div></body></html>