GBE: Output linkModules's error message.
authorRuiling Song <ruiling.song@intel.com>
Wed, 17 Sep 2014 03:33:49 +0000 (11:33 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Thu, 18 Sep 2014 04:23:53 +0000 (12:23 +0800)
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Junyan He <junyan.he@linux.intel.com>
backend/src/llvm/llvm_bitcode_link.cpp

index d845479..1365b32 100644 (file)
@@ -204,9 +204,10 @@ namespace gbe
 
     /* We use beignet's bitcode as dst because it will have a lot of
        lazy functions which will not be loaded. */
-    if(Linker::LinkModules(clonedLib, mod, Linker::DestroySource, NULL)) {
+    std::string errorMsg;
+    if(Linker::LinkModules(clonedLib, mod, Linker::DestroySource, &errorMsg)) {
       delete clonedLib;
-      printf("Fatal Error: link the bitcode error\n");
+      printf("Fatal Error: link the bitcode error:\n%s\n", errorMsg.c_str());
       return NULL;
     }