Skip to contentSkip to conversation

package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32)

PATCH New Yann E. MORIN 3 participants 7 messages Mar 9, 2021 – Mar 19, 2021

lore
Share & tools
lore
#0 lore raw

cover package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32)

Hello All!

This two-patch series aims at fixing, once and for all, the many build failures we've seen in the autobuilders, related to riscv32.

It turns out that those failures exposed a deeper issue in openssl, that was just fixed upstream

Note: the first pach is a candidate for backporting to 2021.02.x, but the second patch is not.

Thanks to Alistair for working promptly on the issue and coming up with a fix! ;-)

Regards,
Yann E. MORIN.

Regards,
Yann E. MORIN.

----------------------------------------------------------------
Yann E. MORIN (2):
package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs Revert "package/libopenssl does not support riscv32"

 package/hostapd/Config.in                          |  1 -
 package/ibm-sw-tpm2/Config.in                      |  2 -
 package/ima-evm-utils/Config.in                    |  2 -
 ...-support-for-io_pgetevents_time64-syscall.patch | 61 ++++++++++++++
 ...-support-for-io_pgetevents_time64-syscall.patch | 98 ++++++++++++++++++++++
 package/openssl/Config.in                          |  7 --
 package/softether/Config.in                        |  2 -
 package/tpm2-abrmd/Config.in                       |  2 -
 package/tpm2-pkcs11/Config.in                      |  2 -
 package/tpm2-tools/Config.in                       |  2 -
 package/tpm2-totp/Config.in                        |  2 -
 package/tpm2-tss/Config.in                         |  2 -
 package/wpa_supplicant/Config.in                   |  2 -
 13 files changed, 159 insertions(+), 26 deletions(-)
 create mode 100644 package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch
 create mode 100644 package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch
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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/2 package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs

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.

Backport two cumulative patches from the upstream openssl development branch that will eventually be openssl 3.0, but has not yet been backported to the 1.1.1 stable branch.

Fixes:

    http://autobuild.buildroot.org/results/eb9/eb9a64d4ffae8569b5225083f282cf87ffa7c681/
    ...
    http://autobuild.buildroot.org/results/07e/07e413b24ba8adc9558c80267ce16dda339bf032/
Cc Alistair Francis <[email protected]>
Cc Matthew Weber <[email protected]>
Cc Mark Corbin <[email protected]>
---
 ...ort-for-io_pgetevents_time64-syscall.patch | 61 ++++++++++++
 ...ort-for-io_pgetevents_time64-syscall.patch | 98 +++++++++++++++++++
 2 files changed, 159 insertions(+)
 create mode 100644 package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch
 create mode 100644 package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch
package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch new file +61 -0
new file mode 100644
index 0000000000..0f59fa648e
@@ -0,0 +1,61 @@
+From 5b5e2985f355c8e99c196d9ce5d02c15bebadfbc Mon Sep 17 00:00:00 2001
+From: Alistair Francis <[email protected]>
+Date: Thu, 29 Aug 2019 13:56:21 -0700
+Subject: [PATCH] Add support for io_pgetevents_time64 syscall
+
+32-bit architectures that are y2038 safe don't include syscalls that use
+32-bit time_t. Instead these architectures have suffixed syscalls that
+always use a 64-bit time_t. In the case of the io_getevents syscall the
+syscall has been replaced with the io_pgetevents_time64 syscall instead.
+
+This patch changes the io_getevents() function to use the correct
+syscall based on the avaliable syscalls and the time_t size. We will
+only use the new 64-bit time_t syscall if the architecture is using a
+64-bit time_t. This is to avoid having to deal with 32/64-bit
+conversions and relying on a 64-bit timespec struct on 32-bit time_t
+platforms. As of Linux 5.3 there are no 32-bit time_t architectures
+without __NR_io_getevents. In the future if a 32-bit time_t architecture
+wants to use the 64-bit syscalls we can handle the conversion.
+
+This fixes build failures on 32-bit RISC-V.
+
+Signed-off-by: Alistair Francis <[email protected]>
+
+Reviewed-by: Richard Levitte <[email protected]>
+Reviewed-by: Paul Dale <[email protected]>
+(Merged from https://github.com/openssl/openssl/pull/9819)
+---
+ engines/e_afalg.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/engines/e_afalg.c b/engines/e_afalg.c
+index dacbe358cb..99516cb1bb 100644
+--- a/engines/e_afalg.c
++++ b/engines/e_afalg.c
+@@ -125,7 +125,23 @@ static ossl_inline int io_getevents(aio_context_t ctx, long min, long max,
+                                struct io_event *events,
+                                struct timespec *timeout)
+ {
++#if defined(__NR_io_getevents)
+     return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
++#elif defined(__NR_io_pgetevents_time64)
++    /* Let's only support the 64 suffix syscalls for 64-bit time_t.
++     * This simplifies the code for us as we don't need to use a 64-bit
++     * version of timespec with a 32-bit time_t and handle converting
++     * between 64-bit and 32-bit times and check for overflows.
++     */
++    if (sizeof(timeout->tv_sec) == 8)
++        return syscall(__NR_io_pgetevents_time64, ctx, min, max, events, timeout, NULL);
++    else {
++        errno = ENOSYS;
++        return -1;
++    }
++#else
++# error "We require either the io_getevents syscall or __NR_io_pgetevents_time64."
++#endif
+ }
+ 
+ static void afalg_waitfd_cleanup(ASYNC_WAIT_CTX *ctx, const void *key,
+-- 
+2.25.1
+
package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch new file +98 -0

98 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

PATCH 1/2 package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs

Quoted 13 lines · Yann E. MORIN

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.

Backport two cumulative patches from the upstream openssl development branch that will eventually be openssl 3.0, but has not yet been backported to the 1.1.1 stable branch.

Fixes:

Quoted 8 lines
    http://autobuild.buildroot.org/results/eb9/eb9a64d4ffae8569b5225083f282cf87ffa7c681/
    ...
    http://autobuild.buildroot.org/results/07e/07e413b24ba8adc9558c80267ce16dda339bf032/
Cc Alistair Francis <[email protected]>
Cc Matthew Weber <[email protected]>
Cc Mark Corbin <[email protected]>

Alistair

Quoted 185 lines
---
 ...ort-for-io_pgetevents_time64-syscall.patch | 61 ++++++++++++
 ...ort-for-io_pgetevents_time64-syscall.patch | 98 +++++++++++++++++++
 2 files changed, 159 insertions(+)
 create mode 100644 package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch
 create mode 100644 package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch
package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch new file +61 -0
new file mode 100644
index 0000000000..0f59fa648e
@@ -0,0 +1,61 @@
+From 5b5e2985f355c8e99c196d9ce5d02c15bebadfbc Mon Sep 17 00:00:00 2001
+From: Alistair Francis <[email protected]>
+Date: Thu, 29 Aug 2019 13:56:21 -0700
+Subject: [PATCH] Add support for io_pgetevents_time64 syscall
+
+32-bit architectures that are y2038 safe don't include syscalls that use
+32-bit time_t. Instead these architectures have suffixed syscalls that
+always use a 64-bit time_t. In the case of the io_getevents syscall the
+syscall has been replaced with the io_pgetevents_time64 syscall instead.
+
+This patch changes the io_getevents() function to use the correct
+syscall based on the avaliable syscalls and the time_t size. We will
+only use the new 64-bit time_t syscall if the architecture is using a
+64-bit time_t. This is to avoid having to deal with 32/64-bit
+conversions and relying on a 64-bit timespec struct on 32-bit time_t
+platforms. As of Linux 5.3 there are no 32-bit time_t architectures
+without __NR_io_getevents. In the future if a 32-bit time_t architecture
+wants to use the 64-bit syscalls we can handle the conversion.
+
+This fixes build failures on 32-bit RISC-V.
+
+Signed-off-by: Alistair Francis <[email protected]>
+
+Reviewed-by: Richard Levitte <[email protected]>
+Reviewed-by: Paul Dale <[email protected]>
+(Merged from https://github.com/openssl/openssl/pull/9819)
+---
+ engines/e_afalg.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/engines/e_afalg.c b/engines/e_afalg.c
+index dacbe358cb..99516cb1bb 100644
+--- a/engines/e_afalg.c
++++ b/engines/e_afalg.c
+@@ -125,7 +125,23 @@ static ossl_inline int io_getevents(aio_context_t ctx, long min, long max,
+                                struct io_event *events,
+                                struct timespec *timeout)
+ {
++#if defined(__NR_io_getevents)
+     return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
++#elif defined(__NR_io_pgetevents_time64)
++    /* Let's only support the 64 suffix syscalls for 64-bit time_t.
++     * This simplifies the code for us as we don't need to use a 64-bit
++     * version of timespec with a 32-bit time_t and handle converting
++     * between 64-bit and 32-bit times and check for overflows.
++     */
++    if (sizeof(timeout->tv_sec) == 8)
++        return syscall(__NR_io_pgetevents_time64, ctx, min, max, events, timeout, NULL);
++    else {
++        errno = ENOSYS;
++        return -1;
++    }
++#else
++# error "We require either the io_getevents syscall or __NR_io_pgetevents_time64."
++#endif
+ }
+
+ static void afalg_waitfd_cleanup(ASYNC_WAIT_CTX *ctx, const void *key,
+--
+2.25.1
+
package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch new file +98 -1
new file mode 100644
index 0000000000..4313eecd6d
@@ -0,0 +1,98 @@
+From e5499a3cac1e823c3e0697e8667e952317b70cc8 Mon Sep 17 00:00:00 2001
+From: Alistair Francis <[email protected]>
+Date: Thu, 4 Mar 2021 12:10:11 -0500
+Subject: [PATCH] Fixup support for io_pgetevents_time64 syscall
+
+This is a fixup for the original commit 5b5e2985f355c8e99c196d9ce5d02c15bebadfbc
+"Add support for io_pgetevents_time64 syscall" that didn't correctly
+work for 32-bit architecutres with a 64-bit time_t that aren't RISC-V.
+
+For a full discussion of the issue see:
+https://github.com/openssl/openssl/commit/5b5e2985f355c8e99c196d9ce5d02c15bebadfbc
+
+Signed-off-by: Alistair Francis <[email protected]>
+
+Reviewed-by: Tomas Mraz <[email protected]>
+Reviewed-by: Paul Dale <[email protected]>
+(Merged from https://github.com/openssl/openssl/pull/14432)
+---
+ engines/e_afalg.c | 55 ++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 42 insertions(+), 13 deletions(-)
+
+diff --git a/engines/e_afalg.c b/engines/e_afalg.c
+index 9480d7c24b..4e9d67db2d 100644
+--- a/engines/e_afalg.c
++++ b/engines/e_afalg.c
+@@ -124,27 +124,56 @@ static ossl_inline int io_read(aio_context_t ctx, long n, struct iocb **iocb)
+     return syscall(__NR_io_submit, ctx, n, iocb);
+ }
+
++/* A version of 'struct timespec' with 32-bit time_t and nanoseconds.  */
++struct __timespec32
++{
++  __kernel_long_t tv_sec;
++  __kernel_long_t tv_nsec;
++};
++
+ static ossl_inline int io_getevents(aio_context_t ctx, long min, long max,
+                                struct io_event *events,
+                                struct timespec *timeout)
+ {
++#if defined(__NR_io_pgetevents_time64)
++    /* Check if we are a 32-bit architecture with a 64-bit time_t */
++    if (sizeof(*timeout) != sizeof(struct __timespec32)) {
++        int ret = syscall(__NR_io_pgetevents_time64, ctx, min, max, events,
++                          timeout, NULL);
++        if (ret == 0 || errno != ENOSYS)
++            return ret;
++    }
++#endif
++
+ #if defined(__NR_io_getevents)
+-    return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
+-#elif defined(__NR_io_pgetevents_time64)
+-    /* Let's only support the 64 suffix syscalls for 64-bit time_t.
+-     * This simplifies the code for us as we don't need to use a 64-bit
+-     * version of timespec with a 32-bit time_t and handle converting
+-     * between 64-bit and 32-bit times and check for overflows.
+-     */
+-    if (sizeof(timeout->tv_sec) == 8)
+-        return syscall(__NR_io_pgetevents_time64, ctx, min, max, events, timeout, NULL);
++    if (sizeof(*timeout) == sizeof(struct __timespec32))
++        /*
++         * time_t matches our architecture length, we can just use
++         * __NR_io_getevents
++         */
++        return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
+     else {
+-        errno = ENOSYS;
+-        return -1;
++        /*
++         * We don't have __NR_io_pgetevents_time64, but we are using a
++         * 64-bit time_t on a 32-bit architecture. If we can fit the
++         * timeout value in a 32-bit time_t, then let's do that
++         * and then use the __NR_io_getevents syscall.
++         */
++        if (timeout && timeout->tv_sec == (long)timeout->tv_sec) {
++            struct __timespec32 ts32;
++
++            ts32.tv_sec = (__kernel_long_t) timeout->tv_sec;
++            ts32.tv_nsec = (__kernel_long_t) timeout->tv_nsec;
++
++            return syscall(__NR_io_getevents, ctx, min, max, events, ts32);
++        } else {
++            return syscall(__NR_io_getevents, ctx, min, max, events, NULL);
++        }
+     }
+-#else
+-# error "We require either the io_getevents syscall or __NR_io_pgetevents_time64."
+ #endif
++
++    errno = ENOSYS;
++    return -1;
+ }
+
+ static void afalg_waitfd_cleanup(ASYNC_WAIT_CTX *ctx, const void *key,
+--
+2.25.1
+
--

2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#3 lore raw

PATCH 2/2 Revert "package/libopenssl does not support riscv32"

In reply to Yann E. MORIN

Now that we have a backport from upstream with a proper fix for the build on riscv32 *and* a proper implementationfor 64-bit time structs, we can re-activate the build on riscv32.

This partially reverts commit c72be5dd2f5aef9162a0ec90465d9220b3546887.

Cc Alistair Francis <[email protected]>
Cc Matthew Weber <[email protected]>
Cc Mark Corbin <[email protected]>
---
 package/hostapd/Config.in        | 1 -
 package/ibm-sw-tpm2/Config.in    | 2 --
 package/ima-evm-utils/Config.in  | 2 --
 package/openssl/Config.in        | 7 -------
 package/softether/Config.in      | 2 --
 package/tpm2-abrmd/Config.in     | 2 --
 package/tpm2-pkcs11/Config.in    | 2 --
 package/tpm2-tools/Config.in     | 2 --
 package/tpm2-totp/Config.in      | 2 --
 package/tpm2-tss/Config.in       | 2 --
 package/wpa_supplicant/Config.in | 2 --
 11 files changed, 26 deletions(-)
package/hostapd/Config.in +0 -1
index 38cead90ca..54d2086c09 100644
@@ -76,7 +76,6 @@ 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 +0 -2
index 57781a54bb..179fa73951 100644
@@ -2,7 +2,6 @@ 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
 	select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
 	help
@@ -14,5 +13,4 @@ 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/ima-evm-utils/Config.in +0 -2
index 59df58e5b3..6c29c9de28 100644
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_IMA_EVM_UTILS
 	bool "ima-evm-utils"
 	depends on BR2_USE_MMU # keyutils
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
 	depends on !BR2_STATIC_LIBS # keyutils, tpm2-tss
 	select BR2_PACKAGE_OPENSSL
 	select BR2_PACKAGE_KEYUTILS
@@ -14,5 +13,4 @@ config BR2_PACKAGE_IMA_EVM_UTILS
 
 comment "ima-evm-utils needs dynamic library support"
 	depends on BR2_USE_MMU
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
 	depends on BR2_STATIC_LIBS
package/openssl/Config.in +0 -7
index dd47091300..f69e85978f 100644
@@ -1,11 +1,5 @@
-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"
@@ -22,7 +16,6 @@ choice
 
 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 +0 -2
index 01104b5d39..bfb45b0315 100644
@@ -3,7 +3,6 @@ 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
@@ -28,5 +27,4 @@ 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-abrmd/Config.in +0 -2
index 0c60db8095..4931641af4 100644
@@ -3,7 +3,6 @@ config BR2_PACKAGE_TPM2_ABRMD
 	depends on BR2_USE_WCHAR # libglib2
 	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
 	depends on BR2_USE_MMU # libglib2
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
 	depends on !BR2_STATIC_LIBS # tpm2-tss
 	select BR2_PACKAGE_LIBGLIB2
 	select BR2_PACKAGE_TPM2_TSS
@@ -23,6 +22,5 @@ config BR2_PACKAGE_TPM2_ABRMD
 
 comment "tpm2-abrmd needs a toolchain w/ dynamic library, wchar, threads"
 	depends on BR2_USE_MMU
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
 		BR2_STATIC_LIBS
package/tpm2-pkcs11/Config.in +0 -2
index ec82d72ae3..5d45703223 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_TPM2_PKCS11
 	bool "tpm2-pkcs11"
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
 	depends on !BR2_STATIC_LIBS # tpm2-tss
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_PACKAGE_LIBYAML
@@ -13,5 +12,4 @@ config BR2_PACKAGE_TPM2_PKCS11
 	  https://github.com/tpm2-software/tpm2-pkcs11
 
 comment "tpm2-pkcs11 needs a toolchain w/ dynamic library, threads"
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
 	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
package/tpm2-tools/Config.in +0 -2
index 642bd9e462..35ca63bf64 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_TPM2_TOOLS
 	bool "tpm2-tools"
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
 	depends on !BR2_STATIC_LIBS # tpm2-tss
 	select BR2_PACKAGE_LIBCURL
 	select BR2_PACKAGE_OPENSSL
@@ -20,5 +19,4 @@ config BR2_PACKAGE_TPM2_TOOLS
 	  https://github.com/tpm2-software/tpm2-tools
 
 comment "tpm2-tools needs a toolchain w/ dynamic library"
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
 	depends on BR2_STATIC_LIBS
package/tpm2-totp/Config.in +0 -2
index 7f274fa130..dcadf5a5f2 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_TPM2_TOTP
 	bool "tpm2-totp"
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
 	depends on !BR2_STATIC_LIBS # tpm2-tss
 	depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM # glibc < 2.20
 	select BR2_PACKAGE_LIBQRENCODE
@@ -20,6 +19,5 @@ config BR2_PACKAGE_TPM2_TOTP
 	  https://github.com/tpm2-software/tpm2-totp
 
 comment "tpm2-totp needs a toolchain w/ dynamic library"
-	depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
 	depends on BR2_STATIC_LIBS
 	depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM
package/tpm2-tss/Config.in +0 -2
index b1ab00dd38..2fc56dbd76 100644
@@ -1,7 +1,6 @@
 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
@@ -56,5 +55,4 @@ 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 +0 -2
index 788409ed3f..27ad22430a 100644
@@ -76,7 +76,6 @@ 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
@@ -112,7 +111,6 @@ 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
#4 lore raw

PATCH 2/2 Revert "package/libopenssl does not support riscv32"

Quoted 11 lines · Yann E. MORIN

Now that we have a backport from upstream with a proper fix for the build on riscv32 *and* a proper implementationfor 64-bit time structs, we can re-activate the build on riscv32.

This partially reverts commit c72be5dd2f5aef9162a0ec90465d9220b3546887.

Cc Alistair Francis <[email protected]>
Cc Matthew Weber <[email protected]>
Cc Mark Corbin <[email protected]>

Alistair

Quoted 220 lines
---
 package/hostapd/Config.in        | 1 -
 package/ibm-sw-tpm2/Config.in    | 2 --
 package/ima-evm-utils/Config.in  | 2 --
 package/openssl/Config.in        | 7 -------
 package/softether/Config.in      | 2 --
 package/tpm2-abrmd/Config.in     | 2 --
 package/tpm2-pkcs11/Config.in    | 2 --
 package/tpm2-tools/Config.in     | 2 --
 package/tpm2-totp/Config.in      | 2 --
 package/tpm2-tss/Config.in       | 2 --
 package/wpa_supplicant/Config.in | 2 --
 11 files changed, 26 deletions(-)
package/hostapd/Config.in +0 -1
index 38cead90ca..54d2086c09 100644
@@ -76,7 +76,6 @@ 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 +0 -2
index 57781a54bb..179fa73951 100644
@@ -2,7 +2,6 @@ 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
        select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
        help
@@ -14,5 +13,4 @@ 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/ima-evm-utils/Config.in +0 -2
index 59df58e5b3..6c29c9de28 100644
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_IMA_EVM_UTILS
        bool "ima-evm-utils"
        depends on BR2_USE_MMU # keyutils
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
        depends on !BR2_STATIC_LIBS # keyutils, tpm2-tss
        select BR2_PACKAGE_OPENSSL
        select BR2_PACKAGE_KEYUTILS
@@ -14,5 +13,4 @@ config BR2_PACKAGE_IMA_EVM_UTILS
 
 comment "ima-evm-utils needs dynamic library support"
        depends on BR2_USE_MMU
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
        depends on BR2_STATIC_LIBS
package/openssl/Config.in +0 -7
index dd47091300..f69e85978f 100644
@@ -1,11 +1,5 @@
-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"
@@ -22,7 +16,6 @@ choice
 
 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 +0 -2
index 01104b5d39..bfb45b0315 100644
@@ -3,7 +3,6 @@ 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
@@ -28,5 +27,4 @@ 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-abrmd/Config.in +0 -2
index 0c60db8095..4931641af4 100644
@@ -3,7 +3,6 @@ config BR2_PACKAGE_TPM2_ABRMD
        depends on BR2_USE_WCHAR # libglib2
        depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
        depends on BR2_USE_MMU # libglib2
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
        depends on !BR2_STATIC_LIBS # tpm2-tss
        select BR2_PACKAGE_LIBGLIB2
        select BR2_PACKAGE_TPM2_TSS
@@ -23,6 +22,5 @@ config BR2_PACKAGE_TPM2_ABRMD
 
 comment "tpm2-abrmd needs a toolchain w/ dynamic library, wchar, threads"
        depends on BR2_USE_MMU
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
        depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
                BR2_STATIC_LIBS
package/tpm2-pkcs11/Config.in +0 -2
index ec82d72ae3..5d45703223 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_TPM2_PKCS11
        bool "tpm2-pkcs11"
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
        depends on !BR2_STATIC_LIBS # tpm2-tss
        depends on BR2_TOOLCHAIN_HAS_THREADS
        select BR2_PACKAGE_LIBYAML
@@ -13,5 +12,4 @@ config BR2_PACKAGE_TPM2_PKCS11
          https://github.com/tpm2-software/tpm2-pkcs11
 
 comment "tpm2-pkcs11 needs a toolchain w/ dynamic library, threads"
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
        depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
package/tpm2-tools/Config.in +0 -2
index 642bd9e462..35ca63bf64 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_TPM2_TOOLS
        bool "tpm2-tools"
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
        depends on !BR2_STATIC_LIBS # tpm2-tss
        select BR2_PACKAGE_LIBCURL
        select BR2_PACKAGE_OPENSSL
@@ -20,5 +19,4 @@ config BR2_PACKAGE_TPM2_TOOLS
          https://github.com/tpm2-software/tpm2-tools
 
 comment "tpm2-tools needs a toolchain w/ dynamic library"
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
        depends on BR2_STATIC_LIBS
package/tpm2-totp/Config.in +0 -2
index 7f274fa130..dcadf5a5f2 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_TPM2_TOTP
        bool "tpm2-totp"
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS # tpm2-tss
        depends on !BR2_STATIC_LIBS # tpm2-tss
        depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM # glibc < 2.20
        select BR2_PACKAGE_LIBQRENCODE
@@ -20,6 +19,5 @@ config BR2_PACKAGE_TPM2_TOTP
          https://github.com/tpm2-software/tpm2-totp
 
 comment "tpm2-totp needs a toolchain w/ dynamic library"
-       depends on BR2_PACKAGE_LIBOPENSSL_ARCH_SUPPORTS
        depends on BR2_STATIC_LIBS
        depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM
package/tpm2-tss/Config.in +0 -2
index b1ab00dd38..2fc56dbd76 100644
@@ -1,7 +1,6 @@
 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
@@ -56,5 +55,4 @@ 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 +0 -3
index 788409ed3f..27ad22430a 100644
@@ -76,7 +76,6 @@ 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
@@ -112,7 +111,6 @@ 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
--

2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#5 lore raw

cover package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32)

In reply to Yann E. MORIN
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Hello All!
This two-patch series aims at fixing, once and for all, the many build failures we've seen in the autobuilders, related to riscv32.

Those issues are "fixed" now that libopenssl is disabled for riscv32, right?

Quoted 5 lines

It turns out that those failures exposed a deeper issue in openssl, that was just fixed upstream

Note: the first pach is a candidate for backporting to 2021.02.x, but the second patch is not.

Why? Isn't this only an issue on riscv32? What would the advantage be of adding those patches if libopenssl isn't available for riscv32?

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

cover package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32)

Peter, All,

On 2021-03-19 21:49 +0100, Peter Korsgaard spake thusly:

Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

This two-patch series aims at fixing, once and for all, the many build failures we've seen in the autobuilders, related to riscv32.

Those issues are "fixed" now that libopenssl is disabled for riscv32, right?

This patch really fixes the build failures we saw on riscv32, before we disabled it. Thanks to this fix, we could reinstate riscv32 on master.

But for 2021.02.x...

Quoted 4 lines
Quoted 2 lines

Note: the first pach is a candidate for backporting to 2021.02.x, but the second patch is not.

Why? Isn't this only an issue on riscv32? What would the advantage be of adding those patches if libopenssl isn't available for riscv32?

... right: 2021.02.x does not cary the faulty patch, and we do not need to reinstate support for riscv32.

Forget it.

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.  |
'------------------------------^-------^------------------^--------------------'