<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 23/02/17 09:44, Marc Dietrich wrote:<br>
    </div>
    <blockquote cite="mid:5727074.kzYNcAqRSb@fb07-iapwap2" type="cite">
      <pre wrap="">Am Mittwoch, 22. Februar 2017, 22:27:42 CET schrieb Timothy Arceri:
</pre>
      <blockquote type="cite">
        <pre wrap="">On 23/02/17 01:57, Marc Dietrich wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">Am Mittwoch, 22. Februar 2017, 15:48:18 CET schrieb Emil Velikov:
</pre>
          <blockquote type="cite">
            <pre wrap="">On 22 February 2017 at 13:31, Marc Dietrich <a class="moz-txt-link-rfc2396E" href="mailto:marvin24@gmx.de"><marvin24@gmx.de></a> wrote:
</pre>
            <blockquote type="cite">
              <pre wrap="">Am Mittwoch, 22. Februar 2017, 04:45:46 CET schrieb Timothy Arceri:
</pre>
              <blockquote type="cite">
                <pre wrap="">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 <a class="moz-txt-link-rfc2396E" href="mailto:marek.olsak@amd.com"><marek.olsak@amd.com></a>
Reviewed-by: Edward O'Callaghan <a class="moz-txt-link-rfc2396E" href="mailto:funfunctor@folklore1984.net"><funfunctor@folklore1984.net></a>
---

 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
</pre>
              </blockquote>
              <pre wrap="">
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_commo
n.
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
</pre>
            </blockquote>
            <pre wrap="">
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.
</pre>
          </blockquote>
          <pre wrap="">
still same. I added -lLLVMAMDGPUInfo to LLVM_{LDFLAGS|LIBS}. Now it
compiles, but GL apps crash during context creation. I also tested the
initial version posted and this worked just fine. I have llvm enabled.
</pre>
        </blockquote>
        <pre wrap="">
I just built it with omx and only r600 without any issues. Did you do
'git clean -xfd' of just make clean?
</pre>
      </blockquote>
      <pre wrap="">
yes - I always do.
 
</pre>
      <blockquote type="cite">
        <pre wrap="">If it's still failing with a git clean then please post the params you
are using to build mesa.
</pre>
      </blockquote>
      <pre wrap="">
#!/bin/sh -x

git clean -fdx --exclude b.sh --exclude "0*" --exclude b2.sh

COMMON_FLAGS="--prefix=/usr     \
        --enable-texture-float  \
        --enable-gles1          \
        --enable-gles2          \
        --enable-egl            \
        --enable-opengl         \
        --enable-shared-glapi   \
        --enable-gbm            \
        --enable-xa             \
        --enable-xvmc           \
        --enable-vdpau          \
        --enable-omx            \
        --enable-va             \
        --enable-nine           \
        --enable-gallium-osmesa \
        --enable-dri3           \
        --enable-gallium-llvm   \
        --disable-opencl-icd    \
        --disable-debug         \
        --enable-glx-tls        \
        --disable-opencl                \
        --with-gallium-drivers=r600,swrast \
        --with-egl-platforms=drm,wayland,x11 \
        --with-dri-drivers=no"

./autogen.sh \
        $COMMON_FLAGS \
        CFLAGS="$OPT_FLAGS $LTO_GCC" \
        CXXFLAGS="$OPT_FLAGS $LTO_GCC" \
        LDFLAGS="$OPT_FLAGS $LTO_GCC" \
        CC="gcc$GCC_VER" \
        CXX="g++$GCC_VER" \
        LD="ld.gold" \
        AR="gcc-ar$GCC_VER" \
        NM="gcc-nm$GCC_VER" \
        RANLIB="gcc-ranlib$GCC_VER" \
        && \
make -j2 && make install</pre>
    </blockquote>
    <br>
    It builds correctly for me with that script.<br>
    <br>
    <blockquote cite="mid:5727074.kzYNcAqRSb@fb07-iapwap2" type="cite">
      <pre wrap="">

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
mesa-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>