llvmpipe: Allow building with LLVM 2.6 too.
authorJosé Fonseca <jfonseca@vmware.com>
Sat, 26 Sep 2009 08:33:32 +0000 (09:33 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 26 Sep 2009 08:37:43 +0000 (09:37 +0100)
src/gallium/drivers/llvmpipe/lp_jit.c
src/gallium/drivers/llvmpipe/lp_test_format.c
src/gallium/drivers/llvmpipe/lp_test_main.c

index b4a22ff4a97bcdae7cc23f2cc0836427588ce80f..f7111c1e5cf888fcbdbcd03507f600b60a3e1d90 100644 (file)
@@ -147,6 +147,11 @@ lp_jit_screen_init(struct llvmpipe_screen *screen)
 {
    char *error = NULL;
 
+#ifdef LLVM_NATIVE_ARCH
+   LLVMLinkInJIT();
+   LLVMInitializeNativeTarget();
+#endif
+
    screen->module = LLVMModuleCreateWithName("llvmpipe");
 
    screen->provider = LLVMCreateModuleProviderForExistingModule(screen->module);
index d8455e5649026a9cb4674361ac7a8ebc175af8e6..7d83f899e6aa8227bae3b199eb9132125e686e0f 100644 (file)
@@ -264,6 +264,11 @@ int main(int argc, char **argv)
    unsigned i;
    int ret;
 
+#ifdef LLVM_NATIVE_ARCH
+   LLVMLinkInJIT();
+   LLVMInitializeNativeTarget();
+#endif
+
    for (i = 0; i < sizeof(test_cases)/sizeof(test_cases[0]); ++i)
       if(!test_format(&test_cases[i]))
         ret = 1;
index 4592dc0b2d070dc27d0774c0eac70d4af1f2da00..f07fa256f16d3d4a199d525a6e699253ff54aaad 100644 (file)
@@ -365,6 +365,11 @@ int main(int argc, char **argv)
          n = atoi(argv[i]);
    }
 
+#ifdef LLVM_NATIVE_ARCH
+   LLVMLinkInJIT();
+   LLVMInitializeNativeTarget();
+#endif
+
    if(fp) {
       /* Warm up the caches */
       test_some(0, NULL, 100);