Created attachment 397966 [details, diff]
Patch to make llvm ebuild use correct patch with clang
This should be assigned to firstname.lastname@example.org who maintains the musl overlay
sys-devel/llvm fails to install on the musl overlay for the following reasons:
1) The patch llvm-3.5-musl-support.patch fails because the file locations in the diff point to "llvm-3.5.0.src/include/llvm/ADT/Triple.h" while in fact it should omit the "llvm-3.5.0.src" part and just have "include/...". Removing "llvm-3.5.0.src" fixed this issue.
2) The patch llvm-3.5-musl-support.patch includes a diff for the file "tools/clang/lib/Driver/Tools.cpp". This path only exists if llvm is emerged with the "clang" USE-flag.
3) As number 1, the patch llvm-3.5-musl-compiler-rt.patch fails because the file location is prefixed with "llvm-3.5.0.src", and like number 2, if the "clang" USE-flag is not enabled the patch fails
To fix those issues I have removed the "llvm-3.5.0.src" prefix from those patches. I have also extracted the diff in llvm-3.5-musl-support.patch, which points to a clang-specific path, to an own file called llvm-3.5-musl-clang-support.patch. Lastly I modified the ebuild script to only run llvm-3.5-musl-clang-support.patch and llvm-3.5-musl-compiler-rt.patch if "clang" is added as a USE flag.
Attached is a diff of the ebuild as well as the updated patch files and the new, extracted llvm-3.5-musl-clang-support patch. For visibility I've also attached a diff showing what part of llvm-3.5-musl-support.patch I extracted to llvm-3.5-musl-clang-support.patch.
Created attachment 397968 [details]
llvm build log
Created attachment 397970 [details, diff]
This is the updated llvm-3.5-musl-compiler-rt.patch which don't have the wrong prefix
Created attachment 397972 [details, diff]
This is the updated llvm-3.5-musl-support.patch with the correct paths and don't have the clang specific things
Created attachment 397974 [details, diff]
This is what I extracted from llvm-3.5-musl-support.patch which requires the clang use flag.
The botched patch is from me. Obviously I didn't try building without
the clang use flag. Thanks for the fixes.
Please attach a patch against the musl branch of the hardened-overlay
that blueness can directly apply.
(In reply to Felix Janda from comment #5)
> The botched patch is from me. Obviously I didn't try building without
> the clang use flag. Thanks for the fixes.
> Please attach a patch against the musl branch of the hardened-overlay
> that blueness can directly apply.
Didn't know if it was a good idea to create a patch for a patch, but seems like its okay. I'll make a single patch for the ebuild and the patches for musl-support and musl-compiler-rt tomorrow. Then it should only be necessary to apply the patch and copy llvm-3.5-musl-clang-support.patch to make llvm install correctly.
Created attachment 398182 [details, diff]
Attached is a single patch which fixes all the issues reported in this bug. Run from layman/hardened-development/sys-devel/llvm with "patch -p1 < llvm-3.5-musl-path-fix.patch"
(In reply to Cato Auestad from comment #7)
> Created attachment 398182 [details, diff] [details, diff]
> Attached is a single patch which fixes all the issues reported in this bug.
> Run from layman/hardened-development/sys-devel/llvm with "patch -p1 <
Okay this is in the tree. I'm not sure these patches could go upstream to llvm, but I'm not going to track that here, so I'm closing this RESOLVED FIX. If there's any problem with this, please reopen the bug.