Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: Matt Weber <matthew.weber@collins.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/libopenssl: fix BR2_OPTIMIZE_FAST build
Date: Wed, 13 Apr 2022 23:39:26 +0200	[thread overview]
Message-ID: <20220413213926.GA2730@scaer> (raw)
In-Reply-To: <20220410200209.865391-1-fontaine.fabrice@gmail.com>

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

      reply	other threads:[~2022-04-13 21:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220413213926.GA2730@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    --cc=matthew.weber@collins.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox