package/libopenssl does not support riscv32
PATCH 1/1 package/libopenssl does not support riscv32
riscv32 is (surprise!) a 32-bit architecture. But it has been Y2038-safe from its inception. As such, there are no legacy binaries that may use the 32-bit time syscalls, and thus they are not available on riscv32.
Code that directly calls to the syscalls without using the C libraries wrappers thus need to handle this case by themselves. That's what upstream tried to do with:
https://github.com/openssl/openssl/commit/5b5e2985f355c8e99c196d9ce5d02c15bebadfbc
We initially carried that patch with 2bb26c1a1d24 (package/libopenssl:
fix build on riscv32).
However, as Arnd Bergmann puts it [0]:
The patch looks wrong to me: __NR_io_pgetevents_time64 must be used whenever time_t is 64-bit wide on a 32-bit architecture, while __NR_io_getevents/__NR_io_pgetevents must be used when time_t is the same width as 'long'.
Checking whether __NR_io_getevents is defined is wrong for all architectures other than riscv
And Arnd agrees that patch should be reverted [1] [2] (there are further comments in that stream, that are worth reading).
As such, we've reverted 2bb26c1a1d24 with 6cfb4ad7f76a.
This means we have no working solution to enable openssl on riscv32 for now. So, rather than fail the build, or backport a dysfunctional patch, let's just forbid openssl on riscv32.
Drop the default from the choice selection; it was anyway superfluous:
the default of a choice, if left unspecified, is the first entry of the choice.
While at it, drop a useless redundant comment in ibm-sw-tpm2: if we select FORCE_LIBOPENSSL, it is obvious that's because libressl is not supported... Besides none of the other users of FORCE_LIBOPENSSL have such a comment.
Fixes:
http://autobuild.buildroot.org/results/eb9/eb9a64d4ffae8569b5225083f282cf87ffa7c681/ ... http://autobuild.buildroot.org/results/07e/07e413b24ba8adc9558c80267ce16dda339bf032/
[0] https://github.com/openssl/openssl/commit/5b5e2985f355c8e99c196d9ce5d02c15bebadfbc#commitcomment-44782859
[1] https://github.com/openssl/openssl/commit/5b5e2985f355c8e99c196d9ce5d02c15bebadfbc#commitcomment-47826509
[2] https://github.com/openssl/openssl/commit/5b5e2985f355c8e99c196d9ce5d02c15bebadfbc#commitcomment-47830530
--- package/hostapd/Config.in | 1 + package/ibm-sw-tpm2/Config.in | 3 ++- package/openssl/Config.in | 8 +++++++- package/softether/Config.in | 2 ++ package/tpm2-tss/Config.in | 2 ++ package/wpa_supplicant/Config.in | 2 ++ 6 files changed, 16 insertions(+), 2 deletions(-)
package/hostapd/Config.in +1 -0
@@ -76,6 +76,7 @@ config BR2_PACKAGE_HOSTAPD_WPS config BR2_PACKAGE_HOSTAPD_WPA3 bool "Enable WPA3 support" + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL help
package/ibm-sw-tpm2/Config.in +2 -1
@@ -2,8 +2,8 @@ config BR2_PACKAGE_IBM_SW_TPM2 bool "ibm-sw-tpm2" depends on BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_STATIC_LIBS # ibm-sw-tpm2 + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS select BR2_PACKAGE_OPENSSL - # libressl is not supported select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL help This project is an implementation of the TCG TPM 2.0
@@ -14,4 +14,5 @@ config BR2_PACKAGE_IBM_SW_TPM2 https://sourceforge.net/projects/ibmswtpm2/ comment "ibm-sw-tpm2 needs a toolchain w/ threads, dynamic library" + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
package/openssl/Config.in +7 -1
@@ -1,5 +1,11 @@ +config BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS + bool + default y + depends on !BR2_RISCV_32 + config BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL bool + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS config BR2_PACKAGE_OPENSSL bool "openssl support"
@@ -11,12 +17,12 @@ if BR2_PACKAGE_OPENSSL choice prompt "ssl library" - default BR2_PACKAGE_LIBOPENSSL help Select OpenSSL or LibreSSL. config BR2_PACKAGE_LIBOPENSSL bool "openssl" + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS select BR2_PACKAGE_ZLIB help A collaborative effort to develop a robust, commercial-grade,
package/softether/Config.in +2 -0
@@ -3,6 +3,7 @@ config BR2_PACKAGE_SOFTETHER depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # fork() depends on BR2_USE_WCHAR + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
@@ -27,4 +28,5 @@ config BR2_PACKAGE_SOFTETHER comment "softether needs a toolchain w/ wchar, threads" depends on BR2_USE_MMU + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS depends on !(BR2_USE_WCHAR && BR2_TOOLCHAIN_HAS_THREADS)
package/tpm2-tss/Config.in +2 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_TPM2_TSS bool "tpm2-tss" depends on !BR2_STATIC_LIBS # dlfcn.h + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS select BR2_PACKAGE_LIBURIPARSER select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
@@ -55,4 +56,5 @@ config BR2_PACKAGE_TPM2_TSS_FAPI endif comment "tpm2-tss needs a toolchain w/ dynamic library" + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS depends on BR2_STATIC_LIBS
package/wpa_supplicant/Config.in +2 -0
@@ -49,6 +49,7 @@ config BR2_PACKAGE_WPA_SUPPLICANT_WIFI_DISPLAY config BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING bool "Enable mesh networking" depends on BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL help
@@ -83,6 +84,7 @@ config BR2_PACKAGE_WPA_SUPPLICANT_WPS config BR2_PACKAGE_WPA_SUPPLICANT_WPA3 bool "Enable WPA3 support" + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL help
Signature · 1 line
2.25.1
PATCH 1/1 package/libopenssl does not support riscv32
Hi Yann,
Quoted 3 lines · Yann E. MORIN
Drop the default from the choice selection; it was anyway superfluous:
the default of a choice, if left unspecified, is the first entry of the choice.
Bikeshedding time!
IMHO, it is still good to have an explicit default. Its effect remains exactly
the same (if the default cannot be selected due to missing dependencies, the first available options will be chosen), but it makes it clear for the reader what is the default, and it makes sure that inserting a new option or reordering the options doesn't affect the default.
[snip]
Review
Quoted 3 lines
config
BR2_PACKAGE_HOSTAPD_WPA3(quoted diff) +1
-0bool "Enable WPA3 support" + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
We normally add a comment of depends on. But I guess it's pretty obvious here.
Quoted 3 lines
package/hostapd/Config.in +0
-0select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL help
[snip]
package/tpm2-tss/Config.in line 1
Quoted 6 lines
package/tpm2-tss/Config.in +0
-0@@ -1,6 +1,7 @@ config BR2_PACKAGE_TPM2_TSS
Unfortunately, TPM2_TSS is selected by ima-evm-utils, tpm2-abrmd, tpm2-pkcs11,
tpm2-tools, tpm2-totp. Fortunately, it doesn't recurse any further.
[snip]
package/tpm2-tss/Config.in line 2
Quoted 1 line
package/tpm2-tss/Config.in +0
-0config BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING
WPA_SUPPLICANT is selected by connman but fortunately no mesh or WPA3. We got
lucky there!
With the propagation of the TPM2_TSS dependency (and for those, a comment
*should* be added), you can add my
and apply directly to master.
Regards,
Arnout
Quoted 15 lines
package/tpm2-tss/Config.in +1
-0bool "Enable mesh networking" depends on BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSLpackage/tpm2-tss/Config.in +1
-0help@@ -83,6 +84,7 @@ config BR2_PACKAGE_WPA_SUPPLICANT_WPS config BR2_PACKAGE_WPA_SUPPLICANT_WPA3 bool "Enable WPA3 support" + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL help
PATCH 1/1 package/libopenssl does not support riscv32
Arnout, All,
On 2021-03-04 20:36 +0100, Arnout Vandecappelle spake thusly:
Quoted 6 lines · Yann E. MORIN
Quoted 4 lines
Drop the default from the choice selection; it was anyway superfluous:
the default of a choice, if left unspecified, is the first entry of the choice.Bikeshedding time!
Aha! ;-)
Quoted 5 lines
IMHO, it is still good to have an explicit default. Its effect remains exactly
the same (if the default cannot be selected due to missing dependencies, the first available options will be chosen), but it makes it clear for the reader what is the default, and it makes sure that inserting a new option or reordering the options doesn't affect the default.
OK, I see and understand your point.
Still, defaults are cumbersome to manage when said default gains or loses dependencies; that's another location where we need to track those...
Besides, the probability tht we gain a third implementation of openssl is... slim. Very slim...
So, I would still drop the default here.
Quoted 5 lines
[snip]
Review
Quoted 3 lines
config
BR2_PACKAGE_HOSTAPD_WPA3(quoted diff) +1
-0bool "Enable WPA3 support" + depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTSWe normally add a comment of depends on. But I guess it's pretty obvious here.
Yes, it is pretty obvious. So much so that it really does not warrant a comment, because it is really is overloading.
Quoted 5 lines
Quoted 3 lines
package/hostapd/Config.in +0
-0select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL help[snip]
Quoted 8 lines
package/tpm2-tss/Config.in line 1
Quoted 6 lines
package/tpm2-tss/Config.in +0
-0@@ -1,6 +1,7 @@ config BR2_PACKAGE_TPM2_TSSUnfortunately,
TPM2_TSSis selected by ima-evm-utils, tpm2-abrmd, tpm2-pkcs11,
tpm2-tools, tpm2-totp. Fortunately, it doesn't recurse any further.
Ah, right, well spotted. I was not carefull enough on that one.
Quoted 2 lines
With the propagation of the
TPM2_TSSdependency (and for those, a comment
*should* be added),
s/should/must/
Quoted 5 lines
you can add my
and apply directly to master.
Since you did not insist on keeping the default as a condition for your rev-by tag, I'll still drop it. ;-)
Thanks!
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'