Closed eupharina closed 5 months ago
@brooksdavis Could you have a look at this PR? The change in devel/llvm-cheri would require your approval. Would it have to be upstreamed to FreeBSD first?
@eupharina Brooks has added the change from devel/llvm-cheri/Makefile in upstream and cherry-picked it into main
. Could you rebase this PR onto latest main
?
I added one more change to devel/llvm-cheri, I guess this should not be squashed. Otherwise, I think everything else should be squashed into a single commit.
@brooksdavis Do you want to upstream https://github.com/CTSRD-CHERI/cheribsd-ports/pull/109/commits/5ed36818139d8b17066be65660f1860571dc04b4 first?
I added one more change to devel/llvm-cheri, I guess this should not be squashed. Otherwise, I think everything else should be squashed into a single commit.
I agree.
@brooksdavis Do you want to upstream 5ed3681 first?
Sure, I can do that.
@brooksdavis Do you want to upstream 5ed3681 first?
Sure, I can do that.
I've done this and pushed a cherry-pick of it.
@brooksdavis Thank you!
@eupharina Could you rebase this PR and squash appropriate commits? Once it's done, I can merge this PR.
I think all of the issues except for the duplicate code in csa-wrapper.sh.in
are resolved now. I've correctly built the port and its package in a hybrid ABI jail.
I agree with Jessica's point that it would be better to make use of llvm-base instead. However, I think it will require changes to llvm-base itself. For now, we can use the port as it is and improve it separately.
This is the port for Clang Static Analyzer for Morello. I used
llvm-morello
port as a template but had to add a few auxiliary scripts:ccc-analyzer
andcxx-analyzer
wrappers are installed toLOCALBASE/libexec
(similar to the wrappers installed byllvm-base
) to build code with purecap ABI for analysis by default.CSA works by overriding the path to the original compiler with
c**-analyzer
wrapper to capture all the compiler invocations and their arguments. When building a project for analysis usingcc
wrapper to add purecap flags to the compiler, CSA doesn't capture these flags, as they don't appear in the original compiler's arguments list but are added later bycc
. Therefore, CSA builds code for analysis with-target-abi aapcs
even though the original compiler invocation eventually builds project code for purecap.c**-analyzer
wrapper adds purecap flags toc**-analyzer
argument list, which then get propagated to the original compiler (cc
) and analyser's clang, making the latter build and analyse code for purecap ABI.scan-build-csa
script is installed toLOCALBASE/bin
. This is a copy ofLOCALBASE/llvm-csa/bin/scan-build
patched after installation to useLOCALBASE/llvm-csa/bin
to look for the analyser's compiler and scripts (except forc**-analyzer
s, which are located by relative paths leading to wrappers mentioned above). Seescan-build-base.patch.in
.I am unsure about a few things regarding the port:
I added to the
pkg-plist
only the files that CSA needs, makingllvm-csa
package size to be ~30MB vs. ~130MB forllvm-morello
. Is it OK ifSTAGEDIR
contains files that are not included inpkg-plist
, or must I clean it somehow?What would be a proper revision of Morello LLVM to rebase all my CSA patches onto (probably the one that will be used in the upcoming release)?
Thanks!