Closed akai-hana closed 1 month ago
To be completely honest sys-devel/llvm[polly]
has been in a rather poor state for a while now. It always was a hack and likely always will be unless there are some major changes in LLVM.
I personally don't even use it anymore in favour of just passing -fplugin=LLVMPolly.so -mllvm=-polly ...
to clang where needed and leaving LLVM alone.
This has some minor drawbacks (e.g. no Polly in rustc, extra flag to manage, occasional build issues if -fplugin*
is filtered) but it's definitely the less hacky way of doing things and avoids loading Polly everywhere LLVM is loaded.
Like I already said in https://github.com/xarblu/xarblu-overlay/issues/345#issuecomment-2020755947 I mainly just keep it around because people use it but seeing it might cause actual harm like here... it might be time to pull the trigger and finally drop this huge hack from the repo...
If anyone wants to use POLLY without build issues here's a patch I made for sys-devel/clang in order to force -fplugin=LLVMPolly.so
(overkill + probably not the best way to do it, but it works™ and doesn't have the issues I had with patchelf)
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
--- a/clang/lib/Driver/ToolChains/Clang.cpp (revision HEAD)
+++ b/clang/lib/Driver/ToolChains/Clang.cpp (revision Staged)
@@ -64,6 +64,7 @@
#include "llvm/TargetParser/RISCVISAInfo.h"
#include "llvm/TargetParser/RISCVTargetParser.h"
#include <cctype>
+#include <filesystem>
using namespace clang::driver;
using namespace clang::driver::tools;
@@ -7549,6 +7550,11 @@
// Forward -fparse-all-comments to -cc1.
Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments);
+ if (std::filesystem::exists(std::string("/usr/lib/llvm/") + CLANG_VERSION_MAJOR_STRING + "/lib64/LLVMPolly.so")) {
+ CmdArgs.push_back("-load");
+ CmdArgs.push_back("LLVMPolly.so");
+ }
+
// Turn -fplugin=name.so into -load name.so
for (const Arg *A : Args.filtered(options::OPT_fplugin_EQ)) {
CmdArgs.push_back("-load");
When opening the game "Milk Outside a Bag of Milk" using Wine and LLVM 18 compiled with the
-polly
USE flag, the program will fail, outputting the following error:(full logs)
The program will then freeze indefinitely until I force stop it. Switching to LLVM 18 without polly, from the official Gentoo repo, solves the issue. I guessed LLVMPolly.so had something to do with the crash, but I lack the skill to diagnose this further.
I'm running Gentoo on an AMD CPU & GPU. I use mesa for my graphic drivers, and my VIDEO_CARDS setting is as following:
VIDEO_CARDS="amdgpu radeonsi radeon"
.If I'm missing any key info, or you would want a copy of the game to test it, LMK.
I couldn't find this error anywhere. Sorry if it's a mistake by my part, or if I'm missing anything. TY!