From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] netsnmp: improve linking avoiding useless -lz listing in shared build
Date: Sat, 20 Oct 2018 00:14:04 +0200 [thread overview]
Message-ID: <87sh11eg9f.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20181015215955.51023-1-giulio.benetti@micronovasrl.com> (Giulio Benetti's message of "Mon, 15 Oct 2018 23:59:55 +0200")
>>>>> "Giulio" == Giulio Benetti <giulio.benetti@micronovasrl.com> writes:
> In commit:
> https://git.buildroot.net/buildroot/commit/?id=13722d58f77d0e9fea9eefc50bf083d19f835433
> Patch "0003-configure-Invert-AC_CHECK_LIB-EVP_md5-.-without-lz-w.patch"
> was intended to fix AC_CHECK_FUNCS() failure on openssl functions. This
> was due to missing -lz during static linking.
> But the patch is wrong and results in explicitly linking against -lz in
> both shared and static build.
> This makes no sense, since shared linking has transitive dependency so
> it doesn't need to list -lz after -lssl, -lssl is enough.
> Differently static linking needs -lz to be listed after -lssl.
> So the real cause of previous build failure:
> http://autobuild.buildroot.net/results/881/881139fb049738b16609d39ad5a49bd77ff6b4aa/
> is that when AC_CHECK_FUNCS(), $LIBS variable is overwritten with
> $LIBCRYPTO without taking into accout previous $LIBS content(i.e. where
> -lz is present). This results in AC_CHEC_FUNCS() to fail while trying to
> statically link without listing -lz.
> Then:
> - Remove current "0003-configure-Invert-AC_CHECK_LIB-EVP_md5-.-without-lz-w.patch"
> - Add patch "0003-configure-fix-AC_CHECK_FUNCS-EVP_sha224-EVP_sha384-..patch"
> where add $LIBS content to tail of new $LIBS variable like this:
> LIBS="$LIBCRYPTO $LIBS"
> NOTE: $LIBS is at the end to ensure static linking to work correctly.
> - Add patch 0004-configure-fix-AC_CHECK_FUNCS-TLS_method-TLSv1_method.patch
> where add $LIBS content to tail of new $LIBS variable like this:
> LIBS="-lssl $LIBCRYPTO $LIBS"
> NOTE: $LIBS is at the end to ensure static linking to work correctly.
> This way AC_CHECK_FUNCS(), when static linking, try to link with -lz too
> appending it at the end of linking library list.
> And after every AC_CHECK_FUNCS(), previously saved $LIBS variable gets
> back to its original value(i.e. containing -lz if present) resulting in
> having or not -lz appended to library list according to static or
> shared build.
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Committed, thanks.
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2018-10-19 22:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 20:26 [Buildroot] [git commit] netsnmp: fix static build failure due to missing -lssl and -lz Peter Korsgaard
2018-10-12 20:08 ` Thomas Petazzoni
2018-10-12 21:00 ` Giulio Benetti
2018-10-15 21:59 ` [Buildroot] [PATCH] netsnmp: improve linking avoiding useless -lz listing in shared build Giulio Benetti
2018-10-19 22:14 ` Peter Korsgaard [this message]
2018-10-20 17:00 ` Peter Korsgaard
2018-10-20 16:59 ` [Buildroot] [git commit] netsnmp: fix static build failure due to missing -lssl and -lz Peter Korsgaard
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=87sh11eg9f.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.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