[Mesa-dev] [PATCH] r600: add amdgpuinfo to the llvm requiredmodule list
Emil Velikov
emil.l.velikov at gmail.com
Mon Feb 27 15:20:08 UTC 2017
On 27 February 2017 at 14:43, Marc Dietrich <marvin24 at gmx.de> wrote:
> Am Montag, 27. Februar 2017, 15:26:18 CET schrieb Jan Vesely:
>> On Mon, 2017-02-27 at 12:54 +0100, Marc Dietrich wrote:
>> > This fixes the build when mesa is build against a static libllvm and
>> > consolidates the module collection a bit.
>> >
>> > Signed-off-by: Marc Dietrich <marvin24 at gmx.de>
>> > ---
>> >
>> > configure.ac | 7 +++----
>> > 1 file changed, 3 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/configure.ac b/configure.ac
>> > index 890a37999c..adc81260a9 100644
>> > --- a/configure.ac
>> > +++ b/configure.ac
>> > @@ -1005,6 +1005,8 @@ radeon_llvm_check() {
>> >
>> > llvm_add_target $amdgpu_llvm_target_name $2
>> >
>> > llvm_add_default_components $2
>> >
>> > + llvm_add_component "amdgpuinfo" "r600"
>> > + llvm_add_component "asmparser" "r600"
>>
>> this looks wrong. -lLLVMAMDGPUInfo should be included in target
>> specific libs.
>> does running `llvm-config --libs amdgpu` not list amdgpuinfo?
>
> yes, it does list it, but as written in [1] it gets somehow* not included.
>
> *) Maybe because radeon_llvm_check is never called if opencl is not enabled
> (but llvm is enabled) for r600. This is why I added a seccond check in my
> patch.
>
This one here is the key.
That can happen since HAVE_LLVM is set and hence the r600 llvm code is
built, even if we don't have the actual user (opencl) enabled.
To avoid all the mayhem that this can cause (has started to cause),
I'll just do the one-liner as below.
Afaict thing were broken since day one and are not caused by
Tobias'/my work in here.
>> >
>> > - if test "x$enable_opencl" = xyes; then
>> > + if test "x$enable_llvm" = xyes -o "x$enable_opencl" = xyes;
>> > then>
// To avoid adding extra guard (BUILD_OPENCL) in the r600/radeon
common code, simply link with LLVM when present.
// Otherwise we'll need to track and extra macro for r600 and always
enable it for radeonsi - the latter a workaround in order to get
things to build properly.
if test "x$enable_llvm" = xyes; then
The above should be sufficient, afaict. Please polish/wrap in a
commit, cc stable and feel free to reuse (elaborate) any of my comment
above.
Thanks
Emil
More information about the mesa-dev
mailing list