From: pal1000 Date: Sun, 9 Oct 2022 21:56:03 +0000 (+0300) Subject: OpenCL/draw module: Support linking with LLVM and clang 15 static libraries X-Git-Tag: upstream/22.3.5~221 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cfe9bb623f810ab401233338442b180b3cd61bb;p=platform%2Fupstream%2Fmesa.git OpenCL/draw module: Support linking with LLVM and clang 15 static libraries Cc: mesa-stable Closes: #7243 Closes: #7487 Reviewed-by: Karol Herbst Reviewed-by: Yonggang Luo Part-of: (cherry picked from commit f69b43ae3ef9a34ea360d96dfc698f83fad7a823) --- diff --git a/.pick_status.json b/.pick_status.json index c9b177c..773d5ca 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2335,7 +2335,7 @@ "description": "OpenCL/draw module: Support linking with LLVM and clang 15 static libraries", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/meson.build b/meson.build index e32338b..172c64a 100644 --- a/meson.build +++ b/meson.build @@ -1739,15 +1739,21 @@ if with_gallium_opencl 'linker', 'coverage', 'instrumentation', 'ipo', 'irreader', 'lto', 'option', 'objcarcopts', 'profiledata' ] - llvm_optional_modules += ['all-targets', 'frontendopenmp'] + # all-targets is needed to support static linking LLVM build with multiple targets + # windowsdriver is needded with LLVM>=15, but we don't know what LLVM verrsion we are using yet + llvm_optional_modules += ['all-targets', 'frontendopenmp', 'windowsdriver'] endif if with_clc llvm_modules += ['coverage', 'target', 'linker', 'irreader', 'option', 'libdriver', 'lto'] - llvm_optional_modules += ['all-targets'] + # all-targets is needed to support static linking LLVM build with multiple targets + # windowsdriver is needded with LLVM>=15, but we don't know what LLVM verrsion we are using yet + llvm_optional_modules += ['all-targets', 'windowsdriver'] endif draw_with_llvm = get_option('draw-use-llvm') if draw_with_llvm llvm_modules += 'native' + # lto is needded with LLVM>=15, but we don't know what LLVM verrsion we are using yet + llvm_optional_modules += ['lto'] endif if with_intel_clc @@ -1905,6 +1911,9 @@ if with_clc 'clangHandleCXX', 'clangHandleLLVM', 'clangSerialization', 'clangSema', 'clangParse', 'clangEdit', 'clangAnalysis' ] + if dep_llvm.version().version_compare('>= 15.0') + clang_modules += 'clangSupport' + endif dep_clang = [] foreach m : clang_modules diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build index 7af210b..db3586b 100644 --- a/src/gallium/targets/opencl/meson.build +++ b/src/gallium/targets/opencl/meson.build @@ -75,6 +75,10 @@ if not _shared_llvm or not (dep_clang.found() and dep_clang_usable) cpp.find_library('clangBasic', dirs : llvm_libdir), polly_dep, polly_isl_dep, ] + if dep_llvm.version().version_compare('>= 15.0') + dep_clang += cpp.find_library('clangSupport', dirs : llvm_libdir) + endif + # check clang once more if can_check_clang test_run = cpp.run(clang_test_code, name : 'dep-clang-usable',