[Mesa-stable] [PATCH] opencl: autotools: Fix linking order for OpenCL target

Jan Vesely jan.vesely at rutgers.edu
Tue May 1 15:19:39 UTC 2018


On Tue, 2018-05-01 at 14:14 +0200, Kai Wasserbäch wrote:
> Otherwise the build fails with an undefined reference to
> clang::FrontendTimesIsEnabled.
> 
> Bugzilla: https://bugs.freedesktop.org/106209
> Cc: mesa-stable at lists.freedesktop.org
> Cc: Jan Vesely <jan.vesely at rutgers.edu>
> Signed-off-by: Kai Wasserbäch <kai at dev.carbon-project.org>
> ---
> 
> Hey,
> this patch fixes a FTBFS for me with recent LLVM/Clang 7 revisions from
> upstream's SVN (I use the packages from apt.llvm.org).
> 
> If you accept it, please commit it for me, I do not have commit access.
> 
> The CC to stable can be dropped, if stable branches are not to be
> expected to be buildable with LLVM/Clang from SVN.
> 
> Thank you in advance for considering this patch.

Hi,

thanks for looking into this. TBH I don't understand how this patch
works, it's dropping and reordering linked libraries.
I've added Emil and Francisco to cc.

> 
> Cheers,
> Kai
> 
> 
>  src/gallium/targets/opencl/Makefile.am | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/gallium/targets/opencl/Makefile.am b/src/gallium/targets/opencl/Makefile.am
> index de68a93ad5..f0e1de7797 100644
> --- a/src/gallium/targets/opencl/Makefile.am
> +++ b/src/gallium/targets/opencl/Makefile.am
> @@ -23,11 +23,10 @@ lib at OPENCL_LIBNAME@_la_LIBADD = \
>  	$(LIBELF_LIBS) \
>  	$(DLOPEN_LIBS) \
>  	-lclangCodeGen \
> -	-lclangFrontendTool \
>  	-lclangFrontend \
> +	-lclangFrontendTool \

This is strange. Why does reordering help here? Do we use -Wl,--as-
needed anywhere?
Should we use -Wl,--start-group/-Wl,--end-group for all clang libraries
instead?

>  	-lclangDriver \
>  	-lclangSerialization \
> -	-lclangCodeGen \

Is this change related?

>  	-lclangParse \
>  	-lclangSema \
>  	-lclangAnalysis \

thanks,
Jan
-------------- 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-stable/attachments/20180501/b90215b9/attachment.sig>


More information about the mesa-stable mailing list