diff --git a/srcpkgs/llvm19/patches/llvm-007-constantfolding-null-tli-fp128.patch b/srcpkgs/llvm19/patches/llvm-007-constantfolding-null-tli-fp128.patch new file mode 100644 index 00000000000000..3e9ec8ca4db77d --- /dev/null +++ b/srcpkgs/llvm19/patches/llvm-007-constantfolding-null-tli-fp128.patch @@ -0,0 +1,17 @@ +Backport of upstream commit 83a5c7cb62e404a713a35445b755cf0109650279 +"[ConstantFolding] Ensure TLI is valid when simplifying fp128 intrinsics" + +The inliner's cost analysis calls ConstantFoldCall without a TargetLibraryInfo. +When the host build has logf128, the fp128 folding path dereferences TLI and segfaults. + +--- a/llvm/lib/Analysis/ConstantFolding.cpp ++++ b/llvm/lib/Analysis/ConstantFolding.cpp +@@ -2124,7 +2124,7 @@ + } + + LibFunc Fp128Func = NotLibFunc; +- if (TLI->getLibFunc(Name, Fp128Func) && TLI->has(Fp128Func) && ++ if (TLI && TLI->getLibFunc(Name, Fp128Func) && TLI->has(Fp128Func) && + Fp128Func == LibFunc_logl) + return ConstantFoldFP128(logf128, Op->getValueAPF(), Ty); + } diff --git a/srcpkgs/llvm19/template b/srcpkgs/llvm19/template index 503b6e9dc52e5d..03080a1634c18e 100644 --- a/srcpkgs/llvm19/template +++ b/srcpkgs/llvm19/template @@ -1,7 +1,7 @@ # Template file for 'llvm19' pkgname=llvm19 version=19.1.4 -revision=8 +revision=9 build_wrksrc=llvm build_style=cmake _llvm_prefix=lib/llvm/19