Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli via buildroot <buildroot@buildroot.org>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Bernd Kuhls <bernd@kuhls.net>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] package/exim: fix build with libexecinfo
Date: Tue, 2 Jan 2024 08:13:11 +0100	[thread overview]
Message-ID: <20240102081311.2aa8f0b2@booty> (raw)
In-Reply-To: <ZY9AigY5WWfIPT-m@landeda>

Hi Yann,

On Fri, 29 Dec 2023 22:56:26 +0100
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Bernd, Luca, All,
> 
> On 2023-12-28 09:51 +0100, Luca Ceresoli via buildroot spake thusly:
> > On Wed, 27 Dec 2023 19:17:55 +0100
> > Bernd Kuhls <bernd@kuhls.net> wrote:  
> > > Upstream added optional support for execinfo  
> [--SNIP--]
> > > @@ -126,6 +127,15 @@ ifeq ($(BR2_STATIC_LIBS),y)
> > >  EXIM_STATIC_FLAGS = LFLAGS="-pthread --static"
> > >  endif
> > >  
> > > +ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
> > > +EXIM_DEPENDENCIES += libexecinfo
> > > +define EXIM_EXTRALIBS
> > > +$(call exim-config-add,EXTRALIBS,-lexecinfo)
> > > +endef
> > > +else
> > > +EXIM_C_FLAGS = -DNO_EXECINFO
> > > +endif  
> > 
> > I think this logic is not entirely correct. As I read it:
> > 
> >  * on non-glibc systems it automatically enables the new exim
> >    stack dump feature if libexecinfo is enabled
> >  * on glibc systems, which always have the backtrace() and related
> >    functions without additional libraries, we never enable this feature
> > 
> > For consistency, the else branch should just be removed to avoid
> > setting NO_EXECINFO, thus enabling the stack dump feature whenever it
> > is possible.  
> 
> If I understand correctly, your proposal would not work either: for a
> non-glibc config that does not have libexecinfo eabled, we do want to
> define NO_EXECINFO.

Exactly!

> Instead, the logic should be somthong like:
> 
>     if glibc:
>         do nothing, execinfo is available
>     elif libexecinfo enabled:
>         add dependency and extra-lib
>     else:
>         define NO_EXECINFO
> 
> Since libexecinfo embedds the fact that it is also non-glibc, we can
> rewrite the condition as:
> 
>     if libexecinfo:
>         add dependency and extra-lib
>     elif non-glibc;
>         define NO_EXECINFO
> 
> So, the 'else' clause only needs to be changed into:
>     else ifneq ($(BR2_TOOLCHAIN_USES_GLIBC),y)

Correct, thanks for suggesting this fix.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2024-01-02  7:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-27 18:17 [Buildroot] [PATCH 1/2] package/exim: fix build with libexecinfo Bernd Kuhls
2023-12-27 18:17 ` [Buildroot] [PATCH 2/2] package/exim: do not build perl-based utilities Bernd Kuhls
2023-12-28  9:02   ` Luca Ceresoli via buildroot
2023-12-28  8:51 ` [Buildroot] [PATCH 1/2] package/exim: fix build with libexecinfo Luca Ceresoli via buildroot
2023-12-29 21:56   ` Yann E. MORIN
2024-01-02  7:13     ` Luca Ceresoli via buildroot [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=20240102081311.2aa8f0b2@booty \
    --to=buildroot@buildroot.org \
    --cc=bernd@kuhls.net \
    --cc=luca.ceresoli@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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