All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libopenssl: fix BR2_OPTIMIZE_FAST build
@ 2022-04-10 20:02 Fabrice Fontaine
  2022-04-13 21:39 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2022-04-10 20:02 UTC (permalink / raw)
  To: buildroot; +Cc: Matt Weber, Fabrice Fontaine

Fix the following build failure with BR2_OPTIMIZE_FAST:

In file included from crypto/async/arch/../async_local.h:30,
                 from crypto/async/arch/async_null.c:11:
crypto/async/arch/../arch/async_posix.h:32:5: error: unknown type name 'ucontext_t'
   32 |     ucontext_t fibre;
      |     ^~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/3ce202f11a821940ff55eafa1dc7cea54b8c0da2

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/libopenssl/libopenssl.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/libopenssl/libopenssl.mk b/package/libopenssl/libopenssl.mk
index a22f2714f2..824b10bbb6 100644
--- a/package/libopenssl/libopenssl.mk
+++ b/package/libopenssl/libopenssl.mk
@@ -63,7 +63,7 @@ define HOST_LIBOPENSSL_CONFIGURE_CMDS
 		shared \
 		zlib-dynamic \
 	)
-	$(SED) "s#-O[0-9sg]#$(HOST_CFLAGS)#" $(@D)/Makefile
+	$(SED) "s#-O[0-9sg]\|-Ofast#$(HOST_CFLAGS)#" $(@D)/Makefile
 endef
 
 define LIBOPENSSL_CONFIGURE_CMDS
@@ -111,7 +111,7 @@ define LIBOPENSSL_CONFIGURE_CMDS
 			$(if $(BR2_STATIC_LIBS),no-dso) \
 	)
 	$(SED) "s#-march=[-a-z0-9] ##" -e "s#-mcpu=[-a-z0-9] ##g" $(@D)/Makefile
-	$(SED) "s#-O[0-9sg]#$(LIBOPENSSL_CFLAGS)#" $(@D)/Makefile
+	$(SED) "s#-O[0-9sg]\|-Ofast#$(LIBOPENSSL_CFLAGS)#" $(@D)/Makefile
 	$(SED) "s# build_tests##" $(@D)/Makefile
 endef
 
-- 
2.35.1

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

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

* Re: [Buildroot] [PATCH 1/1] package/libopenssl: fix BR2_OPTIMIZE_FAST build
  2022-04-10 20:02 [Buildroot] [PATCH 1/1] package/libopenssl: fix BR2_OPTIMIZE_FAST build Fabrice Fontaine
@ 2022-04-13 21:39 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2022-04-13 21:39 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Matt Weber, buildroot

Fabrice, All,

On 2022-04-10 22:02 +0200, Fabrice Fontaine spake thusly:
> Fix the following build failure with BR2_OPTIMIZE_FAST:
> 
> In file included from crypto/async/arch/../async_local.h:30,
>                  from crypto/async/arch/async_null.c:11:
> crypto/async/arch/../arch/async_posix.h:32:5: error: unknown type name 'ucontext_t'
>    32 |     ucontext_t fibre;
>       |     ^~~~~~~~~~
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/3ce202f11a821940ff55eafa1dc7cea54b8c0da2
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/libopenssl/libopenssl.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/libopenssl/libopenssl.mk b/package/libopenssl/libopenssl.mk
> index a22f2714f2..824b10bbb6 100644
> --- a/package/libopenssl/libopenssl.mk
> +++ b/package/libopenssl/libopenssl.mk
> @@ -63,7 +63,7 @@ define HOST_LIBOPENSSL_CONFIGURE_CMDS
>  		shared \
>  		zlib-dynamic \
>  	)
> -	$(SED) "s#-O[0-9sg]#$(HOST_CFLAGS)#" $(@D)/Makefile
> +	$(SED) "s#-O[0-9sg]\|-Ofast#$(HOST_CFLAGS)#" $(@D)/Makefile

This is legacy code, and this is no longer needed.

It was added in 93951c8f24f, 8 years ago, but Thomas reported a
successful build without this sed hack, and the proper host CFLAGS were
present in the Makefile.

>  endef
>  
>  define LIBOPENSSL_CONFIGURE_CMDS
> @@ -111,7 +111,7 @@ define LIBOPENSSL_CONFIGURE_CMDS
>  			$(if $(BR2_STATIC_LIBS),no-dso) \
>  	)
>  	$(SED) "s#-march=[-a-z0-9] ##" -e "s#-mcpu=[-a-z0-9] ##g" $(@D)/Makefile
> -	$(SED) "s#-O[0-9sg]#$(LIBOPENSSL_CFLAGS)#" $(@D)/Makefile
> +	$(SED) "s#-O[0-9sg]\|-Ofast#$(LIBOPENSSL_CFLAGS)#" $(@D)/Makefile

Those two are also legacy, but they were needed because we did not
explcitly pass the LIBOPENSSL_CFLAGS. We only passed
TARGET_CONFIGURE_ARGS and TARGET_CONFIGURE_OPTS, which only defined our
standard CFLAGS.

So, here what's Thomas tested:

    diff --git a/package/libopenssl/libopenssl.mk b/package/libopenssl/libopenssl.mk
    index ae6658ed40..5b99c47c05 100644
    --- a/package/libopenssl/libopenssl.mk
    +++ b/package/libopenssl/libopenssl.mk
    @@ -63,13 +63,13 @@ define HOST_LIBOPENSSL_CONFIGURE_CMDS
     		shared \
     		zlib-dynamic \
     	)
    -	$(SED) "s#-O[0-9sg]#$(HOST_CFLAGS)#" $(@D)/Makefile
     endef
     
     define LIBOPENSSL_CONFIGURE_CMDS
     	(cd $(@D); \
     		$(TARGET_CONFIGURE_ARGS) \
     		$(TARGET_CONFIGURE_OPTS) \
    +		CFLAGS="$(LIBOPENSSL_CFLAGS)" \
     		./Configure \
     			$(LIBOPENSSL_TARGET_ARCH) \
     			--prefix=/usr \
    @@ -109,10 +109,8 @@ define LIBOPENSSL_CONFIGURE_CMDS
     			$(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_COMP),,no-comp) \
     			$(if $(BR2_STATIC_LIBS),zlib,zlib-dynamic) \
     			$(if $(BR2_STATIC_LIBS),no-dso) \
    +		$(SED) "s# build_tests##" $(@D)/Makefile
     	)
    -	$(SED) "s#-march=[-a-z0-9] ##" -e "s#-mcpu=[-a-z0-9] ##g" $(@D)/Makefile
    -	$(SED) "s#-O[0-9sg]#$(LIBOPENSSL_CFLAGS)#" $(@D)/Makefile
    -	$(SED) "s# build_tests##" $(@D)/Makefile
     endef
     
     # libdl is not available in a static build, and this is not implied by no-dso

And similar to the host variant, he reported our target CFLAGS were
already properly accounted for in the generated Makefile.

(Note: I am not sure why the 'build_tests##' sed has to be moved,
though...)

Can you have a further look, please?

Oh, and while we are at it, there is a legacy construct that is totally
useless in a Makefile and irks me whenever I see it (but it's been here
since its inception, almost 20 years ago now):

    (cd $(@D); some-command)

there is absolutely no reason to use parentheses in that case; all it
does is spawn a useless sub-shell...

Regards,
Yann E. MORIN.

>  	$(SED) "s# build_tests##" $(@D)/Makefile
>  endef
>  
> -- 
> 2.35.1
> 
> _______________________________________________
> 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] 2+ messages in thread

end of thread, other threads:[~2022-04-13 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-10 20:02 [Buildroot] [PATCH 1/1] package/libopenssl: fix BR2_OPTIMIZE_FAST build Fabrice Fontaine
2022-04-13 21:39 ` 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.