Skip to content

SHA: Assembly Branch for ARM SIMD "neon" #1360

Description

@SamGinrich

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions