From: Yonghong Song Date: Thu, 27 Oct 2022 16:05:53 +0000 (-0700) Subject: Fix a llvm16 compilation error X-Git-Tag: accepted/tizen/unified/20240223.064455^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74c6eaf12c5a0d0444ce5052711469a9667f6240;p=platform%2Fupstream%2Fbcc.git Fix a llvm16 compilation error With latest llvm16, I got the following build errors: ... /.../bcc/build/src/cc/libbcc.so: undefined reference to `llvm::hlsl::FrontendResource::FrontendResource(llvm::GlobalVariable*, llvm::StringRef, llvm::hlsl::ResourceKind, unsigned int, unsigned int)' collect2: error: ld returned 1 exit status make[2]: *** [tests/cc/CMakeFiles/test_libbcc.dir/build.make:371: tests/cc/test_libbcc] Error 1 ... The reason is due to llvm upsteam patch https://reviews.llvm.org/D135110 which added llvm library FrontendHLSL as a dependency to clang CodeGen library. So we need to add it as well for non-shared library build mode. Signed-off-by: Yonghong Song --- diff --git a/cmake/clang_libs.cmake b/cmake/clang_libs.cmake index f855c6f8..fe82f2fb 100644 --- a/cmake/clang_libs.cmake +++ b/cmake/clang_libs.cmake @@ -25,6 +25,10 @@ endif() if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 15 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 15) list(APPEND llvm_raw_libs windowsdriver) endif() +if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 16 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 16) + list(APPEND llvm_raw_libs frontendhlsl) +endif() + llvm_map_components_to_libnames(_llvm_libs ${llvm_raw_libs}) llvm_expand_dependencies(llvm_libs ${_llvm_libs}) endif()