deps: enable OpenSSL asm support for riscv64#62606
Open
JamieMagee wants to merge 1 commit intonodejs:mainfrom
Open
deps: enable OpenSSL asm support for riscv64#62606JamieMagee wants to merge 1 commit intonodejs:mainfrom
JamieMagee wants to merge 1 commit intonodejs:mainfrom
Conversation
Move linux64-riscv64 from NO_ASM_ARCHS to ASM_ARCHS in the OpenSSL config Makefile and regenerate the configuration. This adds asm/ and asm_avx2/ config variants alongside the existing no-asm/ variant. When riscv64 was first added to the OpenSSL config in 2021 (nodejs#40063), OpenSSL had no RISC-V assembly support. OpenSSL 3.5.x now ships 17 perlasm generators covering AES (zvkned, zvkb, zkn), SHA-256/512 (zvknha, zvknhb), GHASH/GCM (zvkg, zvbc), ChaCha (v, zbb), SM3 (zvksh), SM4 (zvksed), and CPUID detection. Runtime capability detection via riscvcap.c and the Linux hwprobe syscall ensures safe fallback to generic C code on hardware without these extensions. Also add riscv64 entries to the six asm gypi selector files: openssl_asm.gypi, openssl_asm_avx2.gypi, openssl-cl_asm.gypi, openssl-cl_asm_avx2.gypi, openssl-fips_asm.gypi, and openssl-fips_asm_avx2.gypi. Refs: nodejs/build#4099 Signed-off-by: Jamie Magee <jamie.magee@gmail.com>
Collaborator
|
Review requested:
|
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When riscv64 was added to the OpenSSL config in 2021 (#40063), OpenSSL had no RISC-V assembly at all, so it went into
NO_ASM_ARCHS. OpenSSL 3.5.x now has perlasm generators for AES, SHA-256/512, GHASH/GCM, ChaCha, SM3, SM4, and CPUID. All with runtime extension detection viariscvcap.cand the Linuxhwprobesyscall, so there's no risk on hardware without the crypto extensions.This moves linux64-riscv64 from
NO_ASM_ARCHStoASM_ARCHSin deps/openssl/config/Makefile, regenerates the config (addingasm/andasm_avx2/variants with 16 generated assembly files each), and adds riscv64 entries to the six gypi selector files.Generated with
nix shell nixpkgs#nasm -c make linux64-riscv64in deps/openssl/config/.Refs: nodejs/build#4099