[Mesa-dev] Mesa (master): gallivm: Move LLVMStartMultithreaded() static initializer into gallivm

Tom Stellard tom at stellard.net
Mon May 6 10:02:19 PDT 2013


On Mon, May 06, 2013 at 09:51:31AM -0700, Tom Stellard wrote:
> On Mon, May 06, 2013 at 10:44:46AM -0600, Brian Paul wrote:
> > On 05/06/2013 10:09 AM, Tom Stellard wrote:
> > >Module: Mesa
> > >Branch: master
> > >Commit: 55eb8eaaa8bf8696d56effce6ed87f03bea779e0
> > >URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=55eb8eaaa8bf8696d56effce6ed87f03bea779e0
> > >
> > >Author: Tom Stellard<thomas.stellard at amd.com>
> > >Date:   Tue Apr 30 07:38:03 2013 -0700
> > >
> > >gallivm: Move LLVMStartMultithreaded() static initializer into gallivm
> > >
> > >This does not solve all of the problems with using LLVM in a
> > >multithreaded enivronment, but it should help in some cases.
> > >
> > >Reviewed-by: Mathias.Froehlich at web.de
> > >
> > >---
> > >
> > 
> > Something in your series broke the build:
> >
> 
> Sorry, those C API functions were added in LLVM 3.3, I need to use the
> C++ for older versions of LLVM.  I will send a fix shortly.
> 

Hi Brian,

Does the attached patch fix the build for you?

-Tom
>  
> > gallivm/lp_bld_misc.cpp: In constructor
> > '<unnamed>::LLVMEnsureMultithreaded::LLVMEnsureMultithreaded()':
> > gallivm/lp_bld_misc.cpp:88:32: error: 'LLVMIsMultithreaded' was not
> > declared in this scope
> > gallivm/lp_bld_misc.cpp:89:33: error: 'LLVMStartMultithreaded' was
> > not declared in this scope
> > gmake[3]: *** [gallivm/lp_bld_misc.lo] Error 1
> > 
> > -Brian
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
>From 9f4bc9f894204660c0f9bc95c0269aaf5e794d12 Mon Sep 17 00:00:00 2001
From: Tom Stellard <thomas.stellard at amd.com>
Date: Mon, 6 May 2013 09:58:56 -0700
Subject: [PATCH] gallivm: Fix build for LLVM < 3.3

The C API versions of the LLVM multithreaded functions were added in
LLVM 3.3.
---
 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 897f7ff..1e5adb7 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -85,9 +85,15 @@ class LLVMEnsureMultithreaded {
 public:
    LLVMEnsureMultithreaded()
    {
+#if HAVE_LLVM < 0x0303
+      if (!llvm::llvm_is_multithreaded()) {
+         llvm::llvm_start_multithreaded();
+      }
+#else
       if (!LLVMIsMultithreaded()) {
          LLVMStartMultithreaded();
       }
+#endif
    }
 };
 
-- 
1.7.11.4



More information about the mesa-dev mailing list