[Mesa-dev] [PATCH 08/12] configure.ac: deprecate --with-llvm-prefix

Jan Vesely jan.vesely at rutgers.edu
Wed Nov 7 20:53:14 UTC 2018


On Wed, 2018-11-07 at 18:51 +0000, Emil Velikov wrote:
> On Wed, 7 Nov 2018 at 18:39, Jan Vesely <jan.vesely at rutgers.edu> wrote:
> > On Tue, 2018-11-06 at 12:09 +0000, Emil Velikov wrote:
> > > On Thu, 1 Nov 2018 at 16:13, Michel Dänzer <michel at daenzer.net> wrote:
> > > > On 2018-11-01 5:03 p.m., Jan Vesely wrote:
> > > > > On Wed, 2018-10-31 at 18:40 +0000, Emil Velikov wrote:
> > > > > > On Wed, 31 Oct 2018 at 17:41, Jan Vesely <jan.vesely at rutgers.edu> wrote:
> > > > > > > On Wed, 2018-10-31 at 17:22 +0000, Emil Velikov wrote:
> > > > > > > > On Wed, 31 Oct 2018 at 16:24, Michel Dänzer <michel at daenzer.net> wrote:
> > > > > > > > > On 2018-10-31 5:19 p.m., Jan Vesely wrote:
> > > > > > > > > > This might be a stupid question; is the LLVM_CONFIG env var remembered
> > > > > > > > > > between reconfigure (touch configure.ac; make) or do I need to provide
> > > > > > > > > > it explicitly every time configure is run?
> > > > > > > > > 
> > > > > > > > > I don't know the answer, but agree that would be a minimum requirement
> > > > > > > > > for this change.
> > > > > > > > > 
> > > > > > > > Nope, yet it's not really a minimum. LLVM_CONFIG has been around for
> > > > > > > > years, it will work for any Mesa checkout since its inception.
> > > > > > > > You can safely bisect Mesa and things will just work.
> > > > > > > 
> > > > > > > The question is; Do I have to do "LLVM_CONFIG=..." make every time
> > > > > > > bisect changes configure.ac?
> > > > > > > 
> > > > > > You can do (although there's other options if this one seems weird)
> > > > > > 
> > > > > > $ LLVM_CONFIG=... ../autogen.sh
> > > > > 
> > > > > That does not answer my question.
> > > > > 
> > > > > suppose the following sequence:
> > > > > $ LLVM_CONFIG=/usr/local/llvm-4/bin/llvm-config ../mesa-src/autogen.sh
> > > > > ...
> > > > >         llvm:            yes
> > > > >         llvm-config:     /usr/local/llvm-4/bin/llvm-config
> > > > >         llvm-version:    4.0.1
> > > > > ...
> > > > > $ make -j128
> > > > > $ touch ../mesa-src/configure.ac
> > > > > $ make -j128
> > > > > ...
> > > > >         llvm:            yes
> > > > >         llvm-config:     /usr/bin/llvm-config
> > > > >         llvm-version:    7.0.0
> > > > > ...
> > > > > 
> > > > > the second reconfigure silently reverted back to system default llvm.
> > > > > That's a loss of capabilty for me.
> > > > 
> > > > Thanks for checking, Jan. That's a NAK from me for this patch in the
> > > > current form.
> > > > 
> > > > FWIW, LLVM_CONFIG is available in the generated Makefiles, so it might
> > > > not be too hard to make this work with the environment variable. I don't
> > > > know the preferred way to do that however.
> > > > 
> > > Right, I misread the usecase :-( Sorry about that.
> > > The following works like a charm:
> > > 
> > > .../autogen.sh ac_cv_path_LLVM_CONFIG=/...
> > > make
> > > touch .../configure.ac
> > > make
> > 
> > ouch, that's rather ugly. What is the reason to prefer env var vs.
> > proper option (like --with-llvm-config)?
> > meson also seems to prefer env var for some reason.
> > I don't mind spending the time to send out the patches, but I'd like to
> > make sure it's not a wasted effort.
> > 
> From a general distribution POV, adding llvm-config to every project
> 'feels' wasteful IMHO. Even if we ignore the "feels" part, there's the
> aspect of duplicating the same code in XX projects.
> Which with due time will result in a behavioural shift as copies diverge.
> 
> In Mesa the toggle conflicts, in some weird ways, with the existing
> --with-clang-libdir

The idea would be to have one --with-llvm-config switch that subsumes
all llvm related options (except maybe static vs. dynamic linking).

I don't get the argument about other projects.
Not all projects need to support multiple llvm versions. For those that
do provide that option, having a configure, ehm, option sounds like the
most straightforward way.

If divergence from other projects is a worry, then the solution can be
upstreamed to the autoconf archive to replace the current ax_llvm [0].
libclc (another piece of the mesa based OpenCL stack) has provided '
--with-llvm-config' option since Jan 2012, so it'd be nice to follow
suite.

I don't understand how using env var addresses any of that.

> Now stepping back to look at the big picture:
> Ideally LLVM/Clang would provide .pc files like nearly every project
> in wild. LLVM 7.0 doesn't seem to be shipping any, so we need [ideally
> very small] solution in the meanwhile.

The reality is that LLVM doesn't, and probably won't ever provide .pc
file. The bug for this was open in 2011 against LLVM 2.8 [1]. I don't
know if there's a policy or just lack of volunteers, but hoping that
mesa only needs a stop gap solution until it happens is unrealistic.

regards,
Jan

[0] https://www.gnu.org/software/autoconf-archive/ax_llvm.html#ax_llvm
[1] https://bugs.llvm.org/show_bug.cgi?id=9405

> 
> HTH
> Emil

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181107/6834cfb8/attachment-0001.sig>


More information about the mesa-dev mailing list