[Beignet] [PATCH] Fix llvm3.6 build error.

Song, Ruiling ruiling.song at intel.com
Wed Mar 4 00:24:17 PST 2015


LGTM. And I tried, it works well with llvm 3.6

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Yang Rong
> Sent: Tuesday, March 03, 2015 12:54 PM
> To: beignet at lists.freedesktop.org
> Cc: Yang, Rong R
> Subject: [Beignet] [PATCH] Fix llvm3.6 build error.
> 
> LLVM3.6 revert the c api LLVMLinkModules to LLVM3.5 last-minute. Consist
> with it.
> ---
>  backend/src/backend/gen_program.cpp    | 4 ----
>  backend/src/llvm/llvm_bitcode_link.cpp | 4 ----
>  2 files changed, 8 deletions(-)
> 
> diff --git a/backend/src/backend/gen_program.cpp
> b/backend/src/backend/gen_program.cpp
> index 2525825..755c60e 100644
> --- a/backend/src/backend/gen_program.cpp
> +++ b/backend/src/backend/gen_program.cpp
> @@ -388,11 +388,7 @@ namespace gbe {
>        llvm::Module* src =
> (llvm::Module*)((GenProgram*)src_program)->module;
>        llvm::Module* dst =
> (llvm::Module*)((GenProgram*)dst_program)->module;
> 
> -#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR <= 5
>        if (LLVMLinkModules(wrap(dst), wrap(src),
> LLVMLinkerPreserveSource, &errMsg)) { -#else
> -      if (LLVMLinkModules(wrap(dst), wrap(src), 0, &errMsg)) {
> -#endif
>          if (err != NULL && errSize != NULL && stringSize > 0u) {
>            strncpy(err, errMsg, stringSize-1);
>            err[stringSize-1] = '\0';
> diff --git a/backend/src/llvm/llvm_bitcode_link.cpp
> b/backend/src/llvm/llvm_bitcode_link.cpp
> index 96f7781..17248c0 100644
> --- a/backend/src/llvm/llvm_bitcode_link.cpp
> +++ b/backend/src/llvm/llvm_bitcode_link.cpp
> @@ -240,11 +240,7 @@ namespace gbe
>      /* We use beignet's bitcode as dst because it will have a lot of
>         lazy functions which will not be loaded. */
>      char* errorMsg;
> -#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR <= 5
>      if(LLVMLinkModules(wrap(clonedLib), wrap(mod),
> LLVMLinkerDestroySource, &errorMsg)) { -#else
> -    if(LLVMLinkModules(wrap(clonedLib), wrap(mod), 0, &errorMsg)) {
> -#endif
>        delete clonedLib;
>        printf("Fatal Error: link the bitcode error:\n%s\n", errorMsg);
>        return NULL;
> --
> 2.1.0
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list