From 1b3ee2386ebec1f32bf3603c573d6b65ec33fbcd Mon Sep 17 00:00:00 2001 From: Automatic Build System Date: Fri, 5 Jan 2024 17:47:59 +0100 Subject: [PATCH] rebuilt by autoport with build requirements: libclang-devel>=17.0.3-1mamba [release 23.2.1-2mamba;Wed Oct 25 2023] --- Mesa-23.2.1-llvm-17.0.3.patch | 108 ++++++++++++++++++++++++++++++++++ Mesa.spec | 14 ++++- 2 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 Mesa-23.2.1-llvm-17.0.3.patch diff --git a/Mesa-23.2.1-llvm-17.0.3.patch b/Mesa-23.2.1-llvm-17.0.3.patch new file mode 100644 index 0000000..8875d89 --- /dev/null +++ b/Mesa-23.2.1-llvm-17.0.3.patch @@ -0,0 +1,108 @@ +diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp +index 7a50fea332395d3d1f350b0c7a733b29817a616d..43d26fe1abbce7411ee2a224e0abf7f560101e25 100644 +--- a/src/gallium/frontends/clover/llvm/invocation.cpp ++++ b/src/gallium/frontends/clover/llvm/invocation.cpp +@@ -27,13 +27,17 @@ + #include + #include + #include ++#include + #include +-#include ++#include + #include + #ifdef HAVE_CLOVER_SPIRV + #include + #endif + ++#include ++#include ++#include + #include + #include + #include +@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source, + + namespace { + void +- optimize(Module &mod, unsigned optimization_level, ++ optimize(Module &mod, ++ const std::string& ir_target, ++ unsigned optimization_level, + bool internalize_symbols) { +- ::llvm::legacy::PassManager pm; +- + // By default, the function internalizer pass will look for a function + // called "main" and then mark all other functions as internal. Marking + // functions as internal enables the optimizer to perform optimizations +@@ -458,19 +462,53 @@ namespace { + if (internalize_symbols) { + std::vector names = + map(std::mem_fn(&Function::getName), get_kernels(mod)); +- pm.add(::llvm::createInternalizePass( ++ internalizeModule(mod, + [=](const ::llvm::GlobalValue &gv) { + return std::find(names.begin(), names.end(), + gv.getName()) != names.end(); +- })); ++ }); + } + +- ::llvm::PassManagerBuilder pmb; +- pmb.OptLevel = optimization_level; +- pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl( +- ::llvm::Triple(mod.getTargetTriple())); +- pmb.populateModulePassManager(pm); +- pm.run(mod); ++ ++ const char *opt_str = NULL; ++ LLVMCodeGenOptLevel level; ++ switch (optimization_level) { ++ case 0: ++ default: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelNone; ++ break; ++ case 1: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelLess; ++ break; ++ case 2: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelDefault; ++ break; ++ case 3: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelAggressive; ++ break; ++ } ++ ++ const target &target = ir_target; ++ LLVMTargetRef targ; ++ char *err_message; ++ ++ if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message)) ++ return; ++ LLVMTargetMachineRef tm = ++ LLVMCreateTargetMachine(targ, target.triple.c_str(), ++ target.cpu.c_str(), "", level, ++ LLVMRelocDefault, LLVMCodeModelDefault); ++ ++ if (!tm) ++ return; ++ LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions(); ++ LLVMRunPasses(wrap(&mod), opt_str, tm, opts); ++ ++ LLVMDisposeTargetMachine(tm); + } + + std::unique_ptr +@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector &binaries, + auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log); + auto mod = link(*ctx, *c, binaries, r_log); + +- optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library); ++ optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library); + + static std::atomic_uint seq(0); + const std::string id = "." + mod->getModuleIdentifier() + "-" + diff --git a/Mesa.spec b/Mesa.spec index 6c0db7e..e2bf5ef 100644 --- a/Mesa.spec +++ b/Mesa.spec @@ -1,14 +1,14 @@ Name: Mesa Epoch: 1 Version: 23.2.1 -Release: 1mamba +Release: 2mamba Summary: A 3-D graphics library with an API which is very similar to that of OpenGL Group: System/Libraries Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco URL: https://mesa3d.org/ -Source: ftp://ftp.freedesktop.org/pub/mesa/mesa-%{version}.tar.xz +Source: https://archive.mesa3d.org/mesa-%{version}.tar.xz Patch0: Mesa-7.10.2-driproto-2.4.patch Patch1: Mesa-7.10.2-fix_nouveau_dri_includes.patch Patch2: Mesa-8.0.4-llvm-3.1-fixes-1.patch @@ -18,6 +18,7 @@ Patch5: Mesa-21.2.5-llvm-13-patch2.patch Patch6: Mesa-21.2.5-aarch64-rip-out-VC4-forced-NEON.patch Patch7: Mesa-22.2.4-revert-glx-fix-drawable-refounting-for-naked-windows.patch Patch8: Mesa-23.0.3-rustc-1.69.0.patch +Patch9: Mesa-23.2.1-llvm-17.0.3.patch License: MIT ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -44,7 +45,7 @@ BuildRequires: libxshmfence-devel BuildRequires: libz-devel BuildRequires: libzstd-devel ## AUTOBUILDREQ-END -BuildRequires: libclang-devel >= 0:16.0.4-1mamba +BuildRequires: libclang-devel >= 17.0.3-1mamba BuildRequires: libllvm-devel >= 14.0.3 BuildRequires: xproto-devel >= 7.1 BuildRequires: dri2proto-devel @@ -135,13 +136,17 @@ Common files and tools for the Mesa GL libraries. %prep %setup -q -n mesa-%{version} +#-D -T +#:<< _EOF %define _default_patch_fuzz 2 #%patch4 -p1 #%patch5 -p1 #%patch7 -p1 #%patch 8 -p1 -b .rustc-1.69.0 +%patch 9 -p1 -b .llvm-17.0.3 %build +#:<< _EOF #%ifnarch arm export CC=clang export CXX=clang++ @@ -304,6 +309,9 @@ ln -s libGLX_mesa.so.0 %{buildroot}%{_libdir}/libGLX_indirect.so.0 %{_libdir}/pkgconfig/xatracker.pc %changelog +* Wed Oct 25 2023 Automatic Build System 23.2.1-2mamba +- rebuilt by autoport with build requirements: libclang-devel>=17.0.3-1mamba + * Sat Oct 07 2023 Automatic Build System 23.2.1-1mamba - automatic version update by autodist