From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] package/sngrep: fix static build with gnutls
Date: Wed, 24 May 2017 08:47:33 +0200 [thread overview]
Message-ID: <20170524084733.37fd3ca1@free-electrons.com> (raw)
In-Reply-To: <9efd1b94-8830-15b9-8d17-608ce8eace50@gmail.com>
Hello,
On Tue, 23 May 2017 23:20:14 +0200, Romain Naour wrote:
> I think this patch is not necessary anymore since gnutls shouldn't be linked
> statically, see [1].
>
> The code use __attribute__((constructor)) and __attribute__((destructor)) to
> call constructor/desctructor when a shared library is loaded.
> Constructor/desctructor are not used when a static library is used (except when
> if -Wl,--whole-archive -lgnutls -Wno-whole-archive is used, not tested).
>
> Even if gnutls initialization (_gnutls_global_init()) may be called manually,
> the maintainer said it's not supported.
>
> So we should add !BR2_STATIC_LIBS for gnutls package ?
> Doing so, it will avoid all static linking issues with gnutls (taskd, ffmpeg,
> sngrep...)
Yes, I believe we should add !BR2_STATIC_LIBS, of course propagated to
all reverse dependencies (but there are not too many of them).
A side question is: is there a way to detect/error out when some code
is using this constructor/destructor mechanism in a way that doesn't
work for static linking? It would be useful to check if other packages
are affected.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2017-05-24 6:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-20 16:27 [Buildroot] [PATCH 1/2] package/sngrep: add libgcrypt missing dependencies Romain Naour
2017-05-20 16:27 ` [Buildroot] [PATCH 2/2] package/sngrep: fix static build with gnutls Romain Naour
2017-05-23 14:27 ` Thomas Petazzoni
2017-05-23 21:20 ` Romain Naour
2017-05-24 6:47 ` Thomas Petazzoni [this message]
2017-05-24 21:54 ` Romain Naour
2017-05-25 9:02 ` Bernd Kuhls
2017-05-25 16:32 ` Romain Naour
2017-05-23 14:19 ` [Buildroot] [PATCH 1/2] package/sngrep: add libgcrypt missing dependencies Thomas Petazzoni
2017-05-23 21:09 ` Romain Naour
2017-05-24 6:44 ` Thomas Petazzoni
2017-05-24 19:41 ` Romain Naour
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=20170524084733.37fd3ca1@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/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