Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

musl-cross-make compile OpenSSL 3.4.0 failed #100

Open
travislee89 opened this issue Nov 11, 2024 · 1 comment
Open

musl-cross-make compile OpenSSL 3.4.0 failed #100

travislee89 opened this issue Nov 11, 2024 · 1 comment

Comments

@travislee89
Copy link
Contributor

crypto/riscvcap.c:85: return syscall(__NR_riscv_hwprobe, pairs, pair_count, cpu_count, cpus, flags); was added in OpenSSL v3.4.0

#define __NR_riscv_hwprobe 258 is defined in /data/riscv64-linux-musl/include/asm/unistd_64.h, but it looks like the compiler didn't include this macro

FYI: The musl version is now compiled using OpenSSL 3.3.2

2024-11-10T17:00:25.3502288Z CC="/data/riscv64-linux-musl/bin/riscv64-linux-musl-cc" /usr/bin/perl crypto/riscv64cpuid.pl "linux64" -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include -pthread -Wa,--noexecstack -O3 -Wno-error=unknown-pragmas -Wno-error=sign-compare -Wno-error=cast-align -Wno-maybe-uninitialized -fPIC --static -DOPENSSL_USE_NODELETE -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/data/curl-riscv64/lib/engines-3\"" -DMODULESDIR="\"/data/curl-riscv64/lib/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG  -DAES_ASM -DGHASH_ASM -DINCLUDE_C_CHACHA20 -DINCLUDE_C_SHA256 -DINCLUDE_C_SHA512 -DOPENSSL_CPUID_OBJ -DOPENSSL_SM3_ASM -DSHA256_ASM -DSHA512_ASM -DSM4_ASM -DSTATIC_LEGACY  crypto/riscv64cpuid.s
2024-11-10T17:00:25.3563091Z /data/riscv64-linux-musl/bin/riscv64-linux-musl-cc  -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include  -DAES_ASM -DGHASH_ASM -DINCLUDE_C_CHACHA20 -DINCLUDE_C_SHA256 -DINCLUDE_C_SHA512 -DOPENSSL_CPUID_OBJ -DOPENSSL_SM3_ASM -DSHA256_ASM -DSHA512_ASM -DSM4_ASM -DSTATIC_LEGACY -pthread -Wa,--noexecstack -O3 -Wno-error=unknown-pragmas -Wno-error=sign-compare -Wno-error=cast-align -Wno-maybe-uninitialized -fPIC --static -DOPENSSL_USE_NODELETE -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/data/curl-riscv64/lib/engines-3\"" -DMODULESDIR="\"/data/curl-riscv64/lib/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG  -MMD -MF crypto/libcrypto-lib-riscvcap.d.tmp -c -o crypto/libcrypto-lib-riscvcap.o crypto/riscvcap.c
2024-11-10T17:00:25.4053504Z /data/riscv64-linux-musl/bin/riscv64-linux-musl-cc  -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include  -DAES_ASM -DGHASH_ASM -DINCLUDE_C_CHACHA20 -DINCLUDE_C_SHA256 -DINCLUDE_C_SHA512 -DOPENSSL_CPUID_OBJ -DOPENSSL_SM3_ASM -DSHA256_ASM -DSHA512_ASM -DSM4_ASM -DSTATIC_LEGACY -pthread -Wa,--noexecstack -O3 -Wno-error=unknown-pragmas -Wno-error=sign-compare -Wno-error=cast-align -Wno-maybe-uninitialized -fPIC --static -DOPENSSL_USE_NODELETE -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/data/curl-riscv64/lib/engines-3\"" -DMODULESDIR="\"/data/curl-riscv64/lib/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG  -MMD -MF crypto/libcrypto-lib-self_test_core.d.tmp -c -o crypto/libcrypto-lib-self_test_core.o crypto/self_test_core.c
2024-11-10T17:00:25.4420285Z crypto/riscvcap.c: In function 'riscv_hwprobe':
2024-11-10T17:00:25.4427504Z crypto/riscvcap.c:85:20: error: '__NR_riscv_hwprobe' undeclared (first use in this function); did you mean 'riscv_hwprobe'?
2024-11-10T17:00:25.4429055Z    85 |     return syscall(__NR_riscv_hwprobe, pairs, pair_count, cpu_count, cpus, flags);
2024-11-10T17:00:25.4429960Z       |                    ^~~~~~~~~~~~~~~~~~
2024-11-10T17:00:25.4430562Z       |                    riscv_hwprobe
2024-11-10T17:00:25.4431694Z crypto/riscvcap.c:85:20: note: each undeclared identifier is reported only once for each function it appears in
2024-11-10T17:00:25.4484069Z make[1]: *** [Makefile:9810: crypto/libcrypto-lib-riscvcap.o] Error 1
2024-11-10T17:00:25.4484988Z make[1]: *** Waiting for unfinished jobs....
2024-11-10T17:00:25.9797345Z make[1]: Leaving directory '/data/openssl-3.4.0'
2024-11-10T17:00:25.9803675Z make: *** [Makefile:2961: build_sw] Error 2
@travislee89
Copy link
Contributor Author

Adding these codes to the beginning of file crypto/riscvcap.c.

#ifndef __NR_riscv_hwprobe
/* RISC-V specific syscall number for hwprobe */
#define __NR_riscv_hwprobe 258
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant