CTSRD-CHERI / cheribsd

FreeBSD adapted for CHERI-RISC-V and Arm Morello.
http://cheribsd.org
Other
166 stars 60 forks source link

armv8crypto doesn't build for Morello purecap kernels #1091

Open jrtc27 opened 3 years ago

jrtc27 commented 3 years ago

The build (both in sys/conf/files.arm64 and in sys/modules/armv8crypto/Makefile) passes an explicit -march=armv8-a+crypto which overrides -march=morello+c64 (or -march=morello, though so long as it's not dealing with user pointers there won't be silent ABI incompatibility with a hybrid kernel) and thus -mabi=purecap is an error (assertion failure, though https://git.morello-project.org/morello/llvm-project/-/merge_requests/76 when finally merged will turn that into a proper error). Unfortunately, whilst assembly has .arch_extension crypto to just add features, -march=+crypto isn't a thing and I'm not aware of an equivalent, so I believe the rules will either have to do ${CFLAGS:C/-march=.*/&+crypto} (though we don't always pass that upstream... it seems +crypto can also be applied to -mcpu but I'm not sure if we even always pass at least one of those) or get the right -march baseline some other way.

jrtc27 commented 3 years ago

NB: to reproduce the module build failure, comment out the broken_modules.append("armv8crypto") in cheribuild's cheribsd.py (and obviously just add it to the kernel config to test files.arm64)