How do I show linking against purecap?

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!

Parents
  • 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:

    # 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:

    # readelf -h /morello/musl/lib/libc.so | grep Flags
      Flags:                             0x10000

    Cheers,
    Kevin

Reply
  • 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:

    # 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:

    # readelf -h /morello/musl/lib/libc.so | grep Flags
      Flags:                             0x10000

    Cheers,
    Kevin

Children