Trying to build Crypto++ e.g. on a Raspberry PI 2B with make on current cursor of the source repository:
Normal CXXFLAGS would be -DNDEBUG -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
The link step for cryptest.exe fails with unresolved "*_neon" functions in sha.cpp .
Analysis:
It appears that the macro __ARM_ARCH__ in source files sha(1|256|512)_armv4.S is initially undefined,
as the flag -march=armv7-a controls __ARM_ARCH, instead.
Workaround
Macro mapping in the header of the sha*_armv4.S files
#if !defined(__ARM_ARCH__)
#define __ARM_ARCH__ __ARM_ARCH
#endif
solves the linker problem, and cryptest.exe for SHA passes.
Is there a different defensive approach for the make-procedure?
EDIT 2026-06-15: workaround fragment corrected
Trying to build Crypto++ e.g. on a Raspberry PI 2B with
makeon current cursor of the source repository:Normal
CXXFLAGSwould be-DNDEBUG -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hardThe link step for
cryptest.exefails with unresolved "*_neon" functions insha.cpp.Analysis:
It appears that the macro
__ARM_ARCH__in source filessha(1|256|512)_armv4.Sis initially undefined,as the flag
-march=armv7-acontrols__ARM_ARCH, instead.Workaround
Macro mapping in the header of the
sha*_armv4.Sfilessolves the linker problem, and
cryptest.exefor SHA passes.Is there a different defensive approach for the make-procedure?
EDIT 2026-06-15: workaround fragment corrected