[Mesa-dev] [PATCH 8/8] r600/radeonsi: enable glsl/tgsi on-disk cache

Emil Velikov emil.l.velikov at gmail.com
Wed Feb 22 14:48:18 UTC 2017


On 22 February 2017 at 13:31, Marc Dietrich <marvin24 at gmx.de> wrote:
> Am Mittwoch, 22. Februar 2017, 04:45:46 CET schrieb Timothy Arceri:
>> For gpu generations that use LLVM we create a timestamp string
>> containing both the LLVM and Mesa build times, otherwise we just
>> use the Mesa build time.
>>
>> Reviewed-by: Marek Olšák <marek.olsak at amd.com>
>> Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
>> ---
>>  src/gallium/drivers/radeon/r600_pipe_common.c | 43
>> +++++++++++++++++++++++++++ src/gallium/drivers/radeon/r600_pipe_common.h |
>>  3 ++
>>  2 files changed, 46 insertions(+)
>>
>> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c
>> b/src/gallium/drivers/radeon/r600_pipe_common.c index 1781584..bae6d6f
>> 100644
>> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
>> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
>> @@ -43,6 +43,10 @@
>>  #define HAVE_LLVM 0
>>  #endif
>>
>> +#if HAVE_LLVM
>> +#include <llvm-c/TargetMachine.h>
>> +#endif
>> +
>>  #ifndef MESA_LLVM_VERSION_PATCH
>>  #define MESA_LLVM_VERSION_PATCH 0
>>  #endif
>> @@ -779,6 +783,41 @@ static const char* r600_get_chip_name(struct
>> r600_common_screen *rscreen) }
>>  }
>>
>> +static void r600_disk_cache_create(struct r600_common_screen *rscreen)
>> +{
>> +     uint32_t mesa_timestamp;
>> +     if (disk_cache_get_function_timestamp(r600_disk_cache_create,
>> +                                           &mesa_timestamp)) {
>> +             char *timestamp_str;
>> +             int res = -1;
>> +             if (rscreen->chip_class < SI) {
>> +                     res = asprintf(&timestamp_str, "%u",mesa_timestamp);
>> +             }
>> +#if HAVE_LLVM
>> +             else {
>> +                     uint32_t llvm_timestamp;
>> +                     if (disk_cache_get_function_timestamp(LLVMInitializeAMDGPUTargetInfo,
>> +                                                           &llvm_timestamp)) {
>> +                             res = asprintf(&timestamp_str, "%u_%u",
>> +                                            mesa_timestamp, llvm_timestamp);
>> +                     }
>> +             }
>> +#endif
>
>
> maybe this fails to link later in omx with r600 only compile.
>
> make[4]: Verzeichnis „/usr/src/dri-project/mesa/src/gallium/targets/omx“ wird
> betreten
>   CXXLD    libomx_mesa.la
> ../../../../src/gallium/drivers/radeon/.libs/libradeon.a(r600_pipe_common.o):
> In function `r600_disk_cache_create':
> r600_pipe_common.c:(.text+0x2000): undefined reference to
> `LLVMInitializeAMDGPUTargetInfo'
> collect2: error: ld returned 1 exit status
> make[4]: *** [Makefile:791: libomx_mesa.la] Fehler 1
> make[4]: Verzeichnis „/usr/src/dri-project/mesa/src/gallium/targets/omx“ wird
> verlassen
>
That should not happen since
 - Compile guard HAVE_LLVM is defined when --enable-llvm is set
(explicitly or not)
 - Makefile/link guard HAVE_GALLIUM_LLVM is set when the --enable-llvm is

Please make clean/git clean and report the output of make V=1 if the
final link still fails.

Thanks
Emil


More information about the mesa-dev mailing list