-
Notifications
You must be signed in to change notification settings - Fork 72
Initial support for AArch32 #987
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
cc @travitch |
Neat! This is exciting. The compile times are a huge problem generally - I'd love to find some ways to improve them. Is there anything in particular I can do to support this? It seems like a good opportunity for us to take stock of what shared infrastructure is lacking around the binary analysis symbolic execution backends. |
This is not going to be buildable until someone updates asl-parser to use text >= 2; currently it demands text < 2 and that's inconsistent with things it depends on. |
This surprises me, as there is no upper bound on |
Erm. It's asl-translator, not asl-parser. Also it occurs to me I didn't think to check whether those submodule references were anything like current and I'm sure they aren't. |
I've opened GaloisInc/macaw#480 to discuss this. |
Regarding the submodules, it almost suffices to just bump |
Now that the submodule bumps above have landed, I tried to build this branch using them, but I discovered that the code in |
(I merged macaw master with the small aarch32 commit in macaw and this is the result) (There was an earlier version of this commit that references a broken version of the macaw commit; that commit got reconned and so did the one referencing it, and if you're seeing this both should have disappeared. This note is to prevent confusion in case one of them comes back from the dead again at some point.)
(merge branch 'master' into aarch32)
(the new git submodules on this branch, aarch32, are exactly the ones updated in this commit, since all were quite out of date)
macaw-loader-aarch32 is now needed by the other aarch32 bits; what4-serialize was merged into what4 upstream.
(it was added on this branch)
This will be SAWScript.Crucible.CrucibleSAW.SAWCore in the module namespace, at least for now. (The old module path was Lang.Crucible.Backend.SAWCore.) This is a verbatim copy of the file from crucible-saw as it existed when it was deleted from the crucible tree two months ago. It won't build without updating its module header, but I'm going to commit that separately for ease of possible later rearrangements.
(not clear why, not worth arguing about)
Interface changes have assimilated some of the code that was here into the Crucible OnlineBackend interface. So we don't need that any more. However, those changes also make the initialization we need to do circular. The only viable way to break that cycle without upstream interface changes is to set the initial online state to Nothing and then update it after we've constructed the objects. This means it will always be Just at runtime, so fake out the prior field accessor to unwrap the Maybe and panic if it's Nothing, which it should never be. XXX: This is using the wrong panic interface; clean that up later if XXX: this code sticks around. XXX: This is a hack. If this code sticks around, we should look into XXX: upstream interface changes to avoid the cyclic initialization.
XXX: this can almost certainly be done better
I took a look at it and concluded the path of least resistance was to resurrect crucible-saw-core temporarily, so I did that, and got it probably 3/4 of the way to building. And probably spent longer on it than I should have, and it may not have been the right idea anyway, and some of the changes should be polished further if they're wanted (e.g. actually removing obsolete stuff instead of commenting it out). However, having done so I figured it was better to push what I had for later use. If it was a bad idea we can always prune it and start over at c8509bc. |
The CI is still failing on deps, but it was getting past that for me, I expect because I was test-building without applying one of the freeze files. FWIW |
This PR adds support for 32-bit ARM verification using LLVM specifications, introducing a new top-level function
llvm_verify_aarch32
with an interface similar tollvm_verify_x86
.I've marked this as a draft since it's very hacky and fragile right now.
A few things that I'd like to fix before merging:
SAWScript.X86
andSAWScript.X86Spec
, and use them in bothSAWScript.Crucible.LLVM.X86
andSAWScript.Crucible.LLVM.AArch32
.asl-translator
.There's also a problem of compile time. Some of the new dependencies take significantly longer to build, which could negatively impact the CI experience.
In the long run, I'd like to make these low-level backends less of a "walled garden". Right now, the
llvm_verify_<arch>
commands have two (tightly-coupled) steps: translate an LLVM spec to an<arch>
spec according to the ABI, and then verify that<arch>
spec. It might be nice to decouple these steps a bit to make future development cleaner.Example usage! I used Zig for a convenient binary because it's really easy to cross compile.
zig build-exe test.zig -target arm-linux --release-fast
will build a 32-bit ARM ELF withTo test:
clang -m32 -c -emit-llvm test.c
will build some reasonable bitcode that usesadd
.