All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32)
@ 2021-03-09 21:37 Yann E. MORIN
  2021-03-09 21:37 ` [Buildroot] [PATCH 1/2] package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yann E. MORIN @ 2021-03-09 21:37 UTC (permalink / raw)
  To: buildroot

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 1/2] package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs
  2021-03-09 21:37 [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32) Yann E. MORIN
@ 2021-03-09 21:37 ` Yann E. MORIN
  2021-03-09 21:49   ` Alistair Francis
  2021-03-09 21:37 ` [Buildroot] [PATCH 2/2] Revert "package/libopenssl does not support riscv32" Yann E. MORIN
  2021-03-19 20:49 ` [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32) Peter Korsgaard
  2 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2021-03-09 21:37 UTC (permalink / raw)
  To: buildroot

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/

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Alistair Francis <alistair.francis@wdc.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Mark Corbin <mark@dibsco.co.uk>
---
 ...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

diff --git a/package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch b/package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch
new file mode 100644
index 0000000000..0f59fa648e
--- /dev/null
+++ b/package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch
@@ -0,0 +1,61 @@
+From 5b5e2985f355c8e99c196d9ce5d02c15bebadfbc Mon Sep 17 00:00:00 2001
+From: Alistair Francis <alistair.francis@wdc.com>
+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 <alistair.francis@wdc.com>
+
+Reviewed-by: Richard Levitte <levitte@openssl.org>
+Reviewed-by: Paul Dale <paul.dale@oracle.com>
+(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
+
diff --git a/package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch b/package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch
new file mode 100644
index 0000000000..4313eecd6d
--- /dev/null
+++ b/package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch
@@ -0,0 +1,98 @@
+From e5499a3cac1e823c3e0697e8667e952317b70cc8 Mon Sep 17 00:00:00 2001
+From: Alistair Francis <alistair.francis@wdc.com>
+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 <alistair.francis@wdc.com>
+
+Reviewed-by: Tomas Mraz <tomas@openssl.org>
+Reviewed-by: Paul Dale <pauli@openssl.org>
+(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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 2/2] Revert "package/libopenssl does not support riscv32"
  2021-03-09 21:37 [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32) Yann E. MORIN
  2021-03-09 21:37 ` [Buildroot] [PATCH 1/2] package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs Yann E. MORIN
@ 2021-03-09 21:37 ` Yann E. MORIN
  2021-03-09 21:50   ` Alistair Francis
  2021-03-19 20:49 ` [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32) Peter Korsgaard
  2 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2021-03-09 21:37 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Alistair Francis <alistair.francis@wdc.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Mark Corbin <mark@dibsco.co.uk>
---
 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(-)

diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
index 38cead90ca..54d2086c09 100644
--- a/package/hostapd/Config.in
+++ b/package/hostapd/Config.in
@@ -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
diff --git a/package/ibm-sw-tpm2/Config.in b/package/ibm-sw-tpm2/Config.in
index 57781a54bb..179fa73951 100644
--- a/package/ibm-sw-tpm2/Config.in
+++ b/package/ibm-sw-tpm2/Config.in
@@ -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
diff --git a/package/ima-evm-utils/Config.in b/package/ima-evm-utils/Config.in
index 59df58e5b3..6c29c9de28 100644
--- a/package/ima-evm-utils/Config.in
+++ b/package/ima-evm-utils/Config.in
@@ -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
diff --git a/package/openssl/Config.in b/package/openssl/Config.in
index dd47091300..f69e85978f 100644
--- a/package/openssl/Config.in
+++ b/package/openssl/Config.in
@@ -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,
diff --git a/package/softether/Config.in b/package/softether/Config.in
index 01104b5d39..bfb45b0315 100644
--- a/package/softether/Config.in
+++ b/package/softether/Config.in
@@ -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)
diff --git a/package/tpm2-abrmd/Config.in b/package/tpm2-abrmd/Config.in
index 0c60db8095..4931641af4 100644
--- a/package/tpm2-abrmd/Config.in
+++ b/package/tpm2-abrmd/Config.in
@@ -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
diff --git a/package/tpm2-pkcs11/Config.in b/package/tpm2-pkcs11/Config.in
index ec82d72ae3..5d45703223 100644
--- a/package/tpm2-pkcs11/Config.in
+++ b/package/tpm2-pkcs11/Config.in
@@ -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
diff --git a/package/tpm2-tools/Config.in b/package/tpm2-tools/Config.in
index 642bd9e462..35ca63bf64 100644
--- a/package/tpm2-tools/Config.in
+++ b/package/tpm2-tools/Config.in
@@ -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
diff --git a/package/tpm2-totp/Config.in b/package/tpm2-totp/Config.in
index 7f274fa130..dcadf5a5f2 100644
--- a/package/tpm2-totp/Config.in
+++ b/package/tpm2-totp/Config.in
@@ -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
diff --git a/package/tpm2-tss/Config.in b/package/tpm2-tss/Config.in
index b1ab00dd38..2fc56dbd76 100644
--- a/package/tpm2-tss/Config.in
+++ b/package/tpm2-tss/Config.in
@@ -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
diff --git a/package/wpa_supplicant/Config.in b/package/wpa_supplicant/Config.in
index 788409ed3f..27ad22430a 100644
--- a/package/wpa_supplicant/Config.in
+++ b/package/wpa_supplicant/Config.in
@@ -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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 1/2] package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs
  2021-03-09 21:37 ` [Buildroot] [PATCH 1/2] package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs Yann E. MORIN
@ 2021-03-09 21:49   ` Alistair Francis
  0 siblings, 0 replies; 7+ messages in thread
From: Alistair Francis @ 2021-03-09 21:49 UTC (permalink / raw)
  To: buildroot

On Tue, Mar 9, 2021 at 4:37 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> 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/
>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Alistair Francis <alistair.francis@wdc.com>
> Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
> Cc: Mark Corbin <mark@dibsco.co.uk>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  ...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
>
> diff --git a/package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch b/package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch
> new file mode 100644
> index 0000000000..0f59fa648e
> --- /dev/null
> +++ b/package/libopenssl/0006-Add-support-for-io_pgetevents_time64-syscall.patch
> @@ -0,0 +1,61 @@
> +From 5b5e2985f355c8e99c196d9ce5d02c15bebadfbc Mon Sep 17 00:00:00 2001
> +From: Alistair Francis <alistair.francis@wdc.com>
> +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 <alistair.francis@wdc.com>
> +
> +Reviewed-by: Richard Levitte <levitte@openssl.org>
> +Reviewed-by: Paul Dale <paul.dale@oracle.com>
> +(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
> +
> diff --git a/package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch b/package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch
> new file mode 100644
> index 0000000000..4313eecd6d
> --- /dev/null
> +++ b/package/libopenssl/0007-Fixup-support-for-io_pgetevents_time64-syscall.patch
> @@ -0,0 +1,98 @@
> +From e5499a3cac1e823c3e0697e8667e952317b70cc8 Mon Sep 17 00:00:00 2001
> +From: Alistair Francis <alistair.francis@wdc.com>
> +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 <alistair.francis@wdc.com>
> +
> +Reviewed-by: Tomas Mraz <tomas@openssl.org>
> +Reviewed-by: Paul Dale <pauli@openssl.org>
> +(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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 2/2] Revert "package/libopenssl does not support riscv32"
  2021-03-09 21:37 ` [Buildroot] [PATCH 2/2] Revert "package/libopenssl does not support riscv32" Yann E. MORIN
@ 2021-03-09 21:50   ` Alistair Francis
  0 siblings, 0 replies; 7+ messages in thread
From: Alistair Francis @ 2021-03-09 21:50 UTC (permalink / raw)
  To: buildroot

On Tue, Mar 9, 2021 at 4:37 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> 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.
>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Alistair Francis <alistair.francis@wdc.com>
> Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
> Cc: Mark Corbin <mark@dibsco.co.uk>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  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(-)
>
> diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
> index 38cead90ca..54d2086c09 100644
> --- a/package/hostapd/Config.in
> +++ b/package/hostapd/Config.in
> @@ -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
> diff --git a/package/ibm-sw-tpm2/Config.in b/package/ibm-sw-tpm2/Config.in
> index 57781a54bb..179fa73951 100644
> --- a/package/ibm-sw-tpm2/Config.in
> +++ b/package/ibm-sw-tpm2/Config.in
> @@ -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
> diff --git a/package/ima-evm-utils/Config.in b/package/ima-evm-utils/Config.in
> index 59df58e5b3..6c29c9de28 100644
> --- a/package/ima-evm-utils/Config.in
> +++ b/package/ima-evm-utils/Config.in
> @@ -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
> diff --git a/package/openssl/Config.in b/package/openssl/Config.in
> index dd47091300..f69e85978f 100644
> --- a/package/openssl/Config.in
> +++ b/package/openssl/Config.in
> @@ -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,
> diff --git a/package/softether/Config.in b/package/softether/Config.in
> index 01104b5d39..bfb45b0315 100644
> --- a/package/softether/Config.in
> +++ b/package/softether/Config.in
> @@ -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)
> diff --git a/package/tpm2-abrmd/Config.in b/package/tpm2-abrmd/Config.in
> index 0c60db8095..4931641af4 100644
> --- a/package/tpm2-abrmd/Config.in
> +++ b/package/tpm2-abrmd/Config.in
> @@ -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
> diff --git a/package/tpm2-pkcs11/Config.in b/package/tpm2-pkcs11/Config.in
> index ec82d72ae3..5d45703223 100644
> --- a/package/tpm2-pkcs11/Config.in
> +++ b/package/tpm2-pkcs11/Config.in
> @@ -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
> diff --git a/package/tpm2-tools/Config.in b/package/tpm2-tools/Config.in
> index 642bd9e462..35ca63bf64 100644
> --- a/package/tpm2-tools/Config.in
> +++ b/package/tpm2-tools/Config.in
> @@ -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
> diff --git a/package/tpm2-totp/Config.in b/package/tpm2-totp/Config.in
> index 7f274fa130..dcadf5a5f2 100644
> --- a/package/tpm2-totp/Config.in
> +++ b/package/tpm2-totp/Config.in
> @@ -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
> diff --git a/package/tpm2-tss/Config.in b/package/tpm2-tss/Config.in
> index b1ab00dd38..2fc56dbd76 100644
> --- a/package/tpm2-tss/Config.in
> +++ b/package/tpm2-tss/Config.in
> @@ -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
> diff --git a/package/wpa_supplicant/Config.in b/package/wpa_supplicant/Config.in
> index 788409ed3f..27ad22430a 100644
> --- a/package/wpa_supplicant/Config.in
> +++ b/package/wpa_supplicant/Config.in
> @@ -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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32)
  2021-03-09 21:37 [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32) Yann E. MORIN
  2021-03-09 21:37 ` [Buildroot] [PATCH 1/2] package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs Yann E. MORIN
  2021-03-09 21:37 ` [Buildroot] [PATCH 2/2] Revert "package/libopenssl does not support riscv32" Yann E. MORIN
@ 2021-03-19 20:49 ` Peter Korsgaard
  2021-03-19 20:59   ` Yann E. MORIN
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2021-03-19 20:49 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> 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?


 > 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?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32)
  2021-03-19 20:49 ` [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32) Peter Korsgaard
@ 2021-03-19 20:59   ` Yann E. MORIN
  0 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2021-03-19 20:59 UTC (permalink / raw)
  To: buildroot

Peter, All,

On 2021-03-19 21:49 +0100, Peter Korsgaard spake thusly:
> >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> 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...

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-19 20:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 21:37 [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32) Yann E. MORIN
2021-03-09 21:37 ` [Buildroot] [PATCH 1/2] package/libopenssl: fix build wrt. 64-bit time-related syscalls & structs Yann E. MORIN
2021-03-09 21:49   ` Alistair Francis
2021-03-09 21:37 ` [Buildroot] [PATCH 2/2] Revert "package/libopenssl does not support riscv32" Yann E. MORIN
2021-03-09 21:50   ` Alistair Francis
2021-03-19 20:49 ` [Buildroot] [PATCH 0/2] package/libopenssl: fix build wrt 64-bit time-related structs (branch yem/openssl-riscv32) Peter Korsgaard
2021-03-19 20:59   ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.