Hopefully a very newbie question. I have Morello Linux up and running and I can compile software on it. However, how do I know whether I'm building against purecap libraries vs. plain vanilla Debian libraries? I've tried readelf, objdump, and ldd - there doesn't seem to be any special information in there. Does Morello Linux implement purecap universally everywhere by default? Thanks!
Hi Russell,The Debian distro in Morello Linux is essentially straight from upstream, so it does not include any purecap packages. Everything purecap is part of the SDK under /morello - see sdk.morello-project.org/.../ for more information.To address your question of checking the ABI of a binary: standard tools like file are not aware of it, but you can easily figure it out by inspecting the ELF flags. Standard arm64 binaries have no ELF flag set:
/morello
file
# readelf -h /usr/lib/aarch64-linux-gnu/libc.so.6 | grep Flags Flags: 0x0
Conversely purecap Morello binaries have the EF_AARCH64_CHERI_PURECAP flag set:
EF_AARCH64_CHERI_PURECAP
# readelf -h /morello/musl/lib/libc.so | grep Flags Flags: 0x10000
Cheers,Kevin
Thank you - one further question - to build purecap from an actual Morello ARM box, do I need to install the Morello-SDK locally on that box?
Yes, the SDK is what you need to build purecap binaries, as well as to run them (if they're dynamic).