Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/rtty: fix wolfssl build
@ 2023-11-30 22:49 Fabrice Fontaine
  2023-12-01 12:24 ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2023-11-30 22:49 UTC (permalink / raw)
  To: buildroot; +Cc: Jianhui Zhao, Fabrice Fontaine

Fix the following wolfssl build failure raised at least since bump to
version 7.4.0 in commit 6b5907bf65d27ed98532e9783f92f5575f38b3d2:

/home/autobuild/autobuild/instance-4/output-1/build/rtty-8.1.0/src/ssl/openssl.c: In function 'ssl_last_error_string':
/home/autobuild/autobuild/instance-4/output-1/build/rtty-8.1.0/src/ssl/openssl.c:143:24: error: implicit declaration of function 'ERR_peek_error_line_data'; did you mean 'wolfSSL_ERR_get_error_line_data'? [-Werror=implicit-function-declaration]
  143 |         ssl_err_code = ERR_peek_error_line_data(&file, &line, &data, &flags);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~
      |                        wolfSSL_ERR_get_error_line_data

Fixes:
 - http://autobuild.buildroot.org/results/9db9f1dcc6760de4b78771bb79f109c4efd06c36
 - http://autobuild.buildroot.org/results/16422af9469de114e552124542508c3b18ea8f19

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/rtty/Config.in | 2 ++
 package/rtty/rtty.mk   | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/rtty/Config.in b/package/rtty/Config.in
index 198d465713..434c5d6ae7 100644
--- a/package/rtty/Config.in
+++ b/package/rtty/Config.in
@@ -2,6 +2,8 @@ config BR2_PACKAGE_RTTY
 	bool "rtty"
 	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_LIBEV
+	select BR2_PACKAGE_WOLFSSL_ALL if BR2_PACKAGE_WOLFSSL && \
+		!BR2_STATIC_LIBS
 	help
 	  Access your device's terminal from anywhere via the web.
 
diff --git a/package/rtty/rtty.mk b/package/rtty/rtty.mk
index 964ec04ec4..8a40f584de 100644
--- a/package/rtty/rtty.mk
+++ b/package/rtty/rtty.mk
@@ -24,7 +24,7 @@ RTTY_CONF_OPTS += \
 	-DUSE_MBEDTLS=OFF \
 	-DUSE_OPENSSL=ON \
 	-DUSE_WOLFSSL=OFF
-else ifeq ($(BR2_PACKAGE_WOLFSSL),y)
+else ifeq ($(BR2_PACKAGE_WOLFSSL_ALL),y)
 RTTY_DEPENDENCIES += wolfssl
 RTTY_CONF_OPTS += \
 	-DSSL_SUPPORT=ON \
-- 
2.42.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/rtty: fix wolfssl build
  2023-11-30 22:49 [Buildroot] [PATCH 1/1] package/rtty: fix wolfssl build Fabrice Fontaine
@ 2023-12-01 12:24 ` Yann E. MORIN
  2023-12-01 20:12   ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2023-12-01 12:24 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Jianhui Zhao, buildroot

Fabrice, All,

On 2023-11-30 23:49 +0100, Fabrice Fontaine spake thusly:
> Fix the following wolfssl build failure raised at least since bump to
> version 7.4.0 in commit 6b5907bf65d27ed98532e9783f92f5575f38b3d2:
> 
> /home/autobuild/autobuild/instance-4/output-1/build/rtty-8.1.0/src/ssl/openssl.c: In function 'ssl_last_error_string':
> /home/autobuild/autobuild/instance-4/output-1/build/rtty-8.1.0/src/ssl/openssl.c:143:24: error: implicit declaration of function 'ERR_peek_error_line_data'; did you mean 'wolfSSL_ERR_get_error_line_data'? [-Werror=implicit-function-declaration]
>   143 |         ssl_err_code = ERR_peek_error_line_data(&file, &line, &data, &flags);
>       |                        ^~~~~~~~~~~~~~~~~~~~~~~~
>       |                        wolfSSL_ERR_get_error_line_data
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/9db9f1dcc6760de4b78771bb79f109c4efd06c36
>  - http://autobuild.buildroot.org/results/16422af9469de114e552124542508c3b18ea8f19
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/rtty/Config.in | 2 ++
>  package/rtty/rtty.mk   | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/package/rtty/Config.in b/package/rtty/Config.in
> index 198d465713..434c5d6ae7 100644
> --- a/package/rtty/Config.in
> +++ b/package/rtty/Config.in
> @@ -2,6 +2,8 @@ config BR2_PACKAGE_RTTY
>  	bool "rtty"
>  	depends on BR2_USE_MMU # fork()
>  	select BR2_PACKAGE_LIBEV
> +	select BR2_PACKAGE_WOLFSSL_ALL if BR2_PACKAGE_WOLFSSL && \
> +		!BR2_STATIC_LIBS

That's not nice, as that forces wolfssl-all even in the case that it is
not used by rtty, i.e. when either mbedtls or openssl are enabled.

So, the full condition should be something like:

    select BR2_PACKAGE_WOLFSSL_ALL if BR2_PACKAGE_WOLFSSL && \
        !BR2_STATIC_LIBS && !BR2_PACKAGE_MBEDTLS && !BR2_PACKAGE_OPENSSL

But that becomes a bit too much.

I think the simplest solution is to just carry the .mk hunk of this
patch for now.

Eventually, I think it would be bettter to have a choice for the crypto
backend, like we have elsewhere, rather than rely on ordering of the
conditional blocks to defone what gets used, especially since that:

  - it does not match the ordering that upstream uses to find the
    backend (prefers openssl, then wolfssl, then mnedtls);

  - the ordering does not match the other places (e.g. libuhttpd [0] and
    libwebsockets have the same set of crypto backends, but each in yet
    a different order);

  - ordering is subject to being, well, reordered, and people would get
    confused when they update their buildroot to see their rtty change
    its crypto backend...

[0] libuhttpd suffers from the same issue in its Config.in, that this
patch would introduce: wolfssl-all os forced even if wolfssl will not be
used.

Applied to master, just the .mk hunk, thanks.

Regards,
Yann E. MORIN.

>  	help
>  	  Access your device's terminal from anywhere via the web.
>  
> diff --git a/package/rtty/rtty.mk b/package/rtty/rtty.mk
> index 964ec04ec4..8a40f584de 100644
> --- a/package/rtty/rtty.mk
> +++ b/package/rtty/rtty.mk
> @@ -24,7 +24,7 @@ RTTY_CONF_OPTS += \
>  	-DUSE_MBEDTLS=OFF \
>  	-DUSE_OPENSSL=ON \
>  	-DUSE_WOLFSSL=OFF
> -else ifeq ($(BR2_PACKAGE_WOLFSSL),y)
> +else ifeq ($(BR2_PACKAGE_WOLFSSL_ALL),y)
>  RTTY_DEPENDENCIES += wolfssl
>  RTTY_CONF_OPTS += \
>  	-DSSL_SUPPORT=ON \
> -- 
> 2.42.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/rtty: fix wolfssl build
  2023-12-01 12:24 ` Yann E. MORIN
@ 2023-12-01 20:12   ` Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2023-12-01 20:12 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Jianhui Zhao, Fabrice Fontaine, buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Fabrice, All,
 > On 2023-11-30 23:49 +0100, Fabrice Fontaine spake thusly:
 >> Fix the following wolfssl build failure raised at least since bump to
 >> version 7.4.0 in commit 6b5907bf65d27ed98532e9783f92f5575f38b3d2:
 >> 
 >> /home/autobuild/autobuild/instance-4/output-1/build/rtty-8.1.0/src/ssl/openssl.c: In function 'ssl_last_error_string':
 >> /home/autobuild/autobuild/instance-4/output-1/build/rtty-8.1.0/src/ssl/openssl.c:143:24:
 >> error: implicit declaration of function 'ERR_peek_error_line_data';
 >> did you mean 'wolfSSL_ERR_get_error_line_data'?
 >> [-Werror=implicit-function-declaration]
 >> 143 |         ssl_err_code = ERR_peek_error_line_data(&file, &line, &data, &flags);
 >> |                        ^~~~~~~~~~~~~~~~~~~~~~~~
 >> |                        wolfSSL_ERR_get_error_line_data
 >> 
 >> Fixes:
 >> - http://autobuild.buildroot.org/results/9db9f1dcc6760de4b78771bb79f109c4efd06c36
 >> - http://autobuild.buildroot.org/results/16422af9469de114e552124542508c3b18ea8f19
 >> 
 >> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 >> ---
 >> package/rtty/Config.in | 2 ++
 >> package/rtty/rtty.mk   | 2 +-
 >> 2 files changed, 3 insertions(+), 1 deletion(-)
 >> 
 >> diff --git a/package/rtty/Config.in b/package/rtty/Config.in
 >> index 198d465713..434c5d6ae7 100644
 >> --- a/package/rtty/Config.in
 >> +++ b/package/rtty/Config.in
 >> @@ -2,6 +2,8 @@ config BR2_PACKAGE_RTTY
 >> bool "rtty"
 >> depends on BR2_USE_MMU # fork()
 >> select BR2_PACKAGE_LIBEV
 >> +	select BR2_PACKAGE_WOLFSSL_ALL if BR2_PACKAGE_WOLFSSL && \
 >> +		!BR2_STATIC_LIBS

 > That's not nice, as that forces wolfssl-all even in the case that it is
 > not used by rtty, i.e. when either mbedtls or openssl are enabled.

 > So, the full condition should be something like:

 >     select BR2_PACKAGE_WOLFSSL_ALL if BR2_PACKAGE_WOLFSSL && \
 >         !BR2_STATIC_LIBS && !BR2_PACKAGE_MBEDTLS && !BR2_PACKAGE_OPENSSL

 > But that becomes a bit too much.

 > I think the simplest solution is to just carry the .mk hunk of this
 > patch for now.

 > Eventually, I think it would be bettter to have a choice for the crypto
 > backend, like we have elsewhere, rather than rely on ordering of the
 > conditional blocks to defone what gets used, especially since that:

 >   - it does not match the ordering that upstream uses to find the
 >     backend (prefers openssl, then wolfssl, then mnedtls);

 >   - the ordering does not match the other places (e.g. libuhttpd [0] and
 >     libwebsockets have the same set of crypto backends, but each in yet
 >     a different order);

 >   - ordering is subject to being, well, reordered, and people would get
 >     confused when they update their buildroot to see their rtty change
 >     its crypto backend...

 > [0] libuhttpd suffers from the same issue in its Config.in, that this
 > patch would introduce: wolfssl-all os forced even if wolfssl will not be
 > used.

 > Applied to master, just the .mk hunk, thanks.

Committed to 2023.02.x and 2023.08.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2023-12-01 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-30 22:49 [Buildroot] [PATCH 1/1] package/rtty: fix wolfssl build Fabrice Fontaine
2023-12-01 12:24 ` Yann E. MORIN
2023-12-01 20:12   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox