> The security/libsodium port fails to compile on OpenBSD 7.8 for mips64el > (loongson) architecture. > > > During compilation, the following error occurs: > /usr/ports/pobj/libsodium-1.0.20/libsodium-1.0.20/src/libsodium/sodium/utils.c:104:34: > error: use of undeclared identifier 'PAGE_SHIFT' > 104 | static size_t page_size = DEFAULT_PAGE_SIZE; > | ^ > /usr/ports/pobj/libsodium-1.0.20/libsodium-1.0.20/src/libsodium/sodium/utils.c:98:29: > note: expanded from macro 'DEFAULT_PAGE_SIZE' > 98 | # define DEFAULT_PAGE_SIZE PAGE_SIZE > | ^ > /usr/include/mips64/param.h:44:25: note: expanded from macro 'PAGE_SIZE' > 44 | #define PAGE_SIZE (1 << PAGE_SHIFT) > | ^ > > > The root cause is that on OpenBSD/mips64 (loongson), the system headers do > not define `PAGE_SHIFT` in all contexts where `PAGE_SIZE` is used. The > libsodium code indirectly uses `PAGE_SIZE` via its `DEFAULT_PAGE_SIZE` macro, > which expands to `(1 << PAGE_SHIFT)`, but `PAGE_SHIFT` is not defined, > causing the compilation error.
Thanks for reporting this! This is a loongson-specific mistake in <machine/param.h>, which has now been fixed. Miod
