diff --git a/cap_build.c b/cap_build.c index f08aae9..294b743 100644 --- a/cap_build.c +++ b/cap_build.c @@ -23,6 +23,11 @@ int main() { + // This example relies on morello-specific symbols, so we won't run + // it on anything else. +#if !(defined(__aarch64__) && __ARM_ARCH == 8) + printf("Skipping; this example only runs on morello."); +#else // We create two capabilities: x, and y, which is derived from x. We note // that, though we use `cheri_address_set()`, it doesn't actually set (i.e. // _change_) the address of its arguments, but construct a new capability @@ -150,4 +155,5 @@ int main() free((void *) y_ptr); free(my_cap_mem); return 0; +#endif }