[Mesa-dev] [Mesa-stable] [PATCH] swr: [rasterizer jitter] fix llvm >= 7 build break

Dylan Baker dylan at pnwbakers.com
Mon Sep 24 16:29:18 UTC 2018

Quoting Chuck Atkins (2018-09-24 09:01:37)
> Hi Dylan,
>     >          xswr)
>     >              llvm_require_version $LLVM_REQUIRED_SWR "swr"
>     > +            llvm_add_default_components "swr"
>     > +            if test $LLVM_VERSION_MAJOR -ge 7; then
>     > +                llvm_add_component "ipo" "swr"
>     > +                llvm_add_component "ObjCARCOpts" "swr"
>     Presumably this should be added to the meson build as well? There's an
>     "llvm_modules" array around line 1170.
> I'm not quite sure how to add this.  The additional modules are only required
> for LLVM >= 7.  From the implementation in meson.build, it looks like the
> required llvm_modules are assembled and then used  the llvm dependency is
> searched for.  It seems a bit of chicken-egg problem in that I don't know if
> the extra modules are required until after I know the llvm version, but I need
> the required modules to dertime the llvm version.  Suggestions?
> Thanks,
> - Chuck

Hmmm, that is an interesting problem. We could put them in the optional modules,
and that would probably work most of the time, but it would fail in some corner

I'm afraid what we're going to have to do is something like:

dep_llvm = dependency('llvm', required : $required)
if dep_llvm.found()
  if dep_llvm.version().version_compare('>= 7.0.0')
    llvm_modules += 'ObjCARCopts'
  dep_llvm = ...

This seems like the sort of problem we'll have again in the future, so I've
opened a ticket with meson so that we can fix this upstream and have a syntax
for this:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180924/894826b8/attachment.sig>

More information about the mesa-dev mailing list