cheriot-baremetal: depend on compiler emitting -D__CHERIOT_BAREMETAL__ The CHERIoT compiler automatically emits a #define for __CHERIOT_BAREMETAL__ when run with -mabi=cheriot-baremetal. Replace old (manual) usage of _CHERIOT_BAREMETAL_. Bypass-Presubmit-Reason: camera b0rked breaks Nexus test; missing bazelversion breaks sencha test Change-Id: If78d0ec974353232691165fc8fd553c1d62ff5ba
diff --git a/sw/device/lib/testing/test_rom/BUILD b/sw/device/lib/testing/test_rom/BUILD index 6474063..e57fb2e 100644 --- a/sw/device/lib/testing/test_rom/BUILD +++ b/sw/device/lib/testing/test_rom/BUILD
@@ -172,7 +172,7 @@ ) for target in TARGETS] # Only build for CHERIoT targets. Requires that bazel be invoked with -# --config=cheriot-baremetal --copt=-D_CHERIOT_BAREMETAL_=1 +# --config=cheriot-baremetal # so that all dependencies use those options. opentitan_rom_binary( name = "test_rom_no_otp_cheri",
diff --git a/sw/device/lib/testing/test_rom/cheriot-baremetal.h b/sw/device/lib/testing/test_rom/cheriot-baremetal.h index 38bed19..7ad3a51 100644 --- a/sw/device/lib/testing/test_rom/cheriot-baremetal.h +++ b/sw/device/lib/testing/test_rom/cheriot-baremetal.h
@@ -17,7 +17,7 @@ #define SW_DEVICE_LIB_TESTING_TEST_ROM_CHERIOT_BAREMETAL_H_ // XXX just make this a noop? -#ifndef _CHERIOT_BAREMETAL_ +#ifndef __CHERIOT_BAREMETAL__ #error "This file is only useful when compiling for baremetal" #endif