From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] yajl: fix static linking in a parallel build
Date: Sun, 10 Apr 2016 20:39:43 +0200 [thread overview]
Message-ID: <570A9DEF.4030707@mind.be> (raw)
In-Reply-To: <1460240125-2981-1-git-send-email-joerg.krause@embedded.rocks>
On 04/10/16 00:15, J?rg Krause wrote:
> The yajl build system contains a race condition, which gets triggered by
> high BR2_JLEVEL settings - It tries to link the executable gen-extra-close
> against the shared libyajl before it is created:
>
> [ 21%] Linking C executable gen-extra-close
> [ 26%] Building C object src/CMakeFiles/yajl_s.dir/yajl_buf.c.o
> /home/test/autobuild/instance-3/output/host/opt/ext-toolchain/bfin-uclinux/bfin-uclinux/bin/ld.real: cannot find -lyajl
>
> Fix this issue by linking gen-extra-close against the shared library in a shared
> build and the static library otherwise.
> Apply this to all other build targets from yail who are linking against the
^^^^yajl
> library, too.
>
> Fixes:
> http://autobuild.buildroot.net/results/a9b/a9b5209377acb51e69f376e0c008ee71fe00397a/
> http://autobuild.buildroot.net/results/55f/55fe22463d49addb42b635d10be5176522f4a561/
> http://autobuild.buildroot.net/results/808/808acca0cfed93465845c2aa055a7a4fc56a8a17/
> http://autobuild.buildroot.net/results/b92/b92a9c84b71a8a2d022d307245ca6be36a000e6c/
> http://autobuild.buildroot.net/results/55d/55df698ab53f7d94235166e8576eb681ed68668e/
> .. and more.
>
> Upstream status: Pending
> https://github.com/lloyd/yajl/pull/187
>
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Regards,
Arnout
> ---
> Changes v1 -> v2:
> - conditionally link gen-extra-close against the shared libyajl in a shared
> build and against the static libyajl otherwise (Samuel Martin)
> - apply this to all other build targets linking against yajl
>
> ---
> ...ink-with-shared-libyajl-in-a-shared-build.patch | 125 +++++++++++++++++++++
> 1 file changed, 125 insertions(+)
> create mode 100644 package/yajl/0003-Link-with-shared-libyajl-in-a-shared-build.patch
>
> diff --git a/package/yajl/0003-Link-with-shared-libyajl-in-a-shared-build.patch b/package/yajl/0003-Link-with-shared-libyajl-in-a-shared-build.patch
> new file mode 100644
> index 0000000..6a6e5e3
> --- /dev/null
> +++ b/package/yajl/0003-Link-with-shared-libyajl-in-a-shared-build.patch
> @@ -0,0 +1,125 @@
> +From 3e4c0ce8c2b4c9dad6b7ce11f017f3f639fdab27 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
> +Date: Sat, 9 Apr 2016 23:24:27 +0200
> +Subject: [PATCH] Link with shared libyajl in a shared build
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Building yajl in a static context fails in a parallel build:
> +
> +[ 21%] Linking C executable gen-extra-close
> +[ 26%] Building C object src/CMakeFiles/yajl_s.dir/yajl_buf.c.o
> +/home/test/autobuild/instance-3/output/host/opt/ext-toolchain/bfin-uclinux/bfin-uclinux/bin/ld.real: cannot find -lyajl
> +
> +Fix this issue by linking against the shared libyail in a shared build. Apply
> +this fix also to all other build targets who are linking against the library.
> +
> +Upstream status: Pending
> +https://github.com/lloyd/yajl/pull/187
> +
> +Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> +---
> + example/CMakeLists.txt | 7 ++++++-
> + perf/CMakeLists.txt | 6 +++++-
> + reformatter/CMakeLists.txt | 6 +++++-
> + test/api/CMakeLists.txt | 6 +++++-
> + test/parsing/CMakeLists.txt | 6 +++++-
> + verify/CMakeLists.txt | 6 +++++-
> + 6 files changed, 31 insertions(+), 6 deletions(-)
[snip]
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
next prev parent reply other threads:[~2016-04-10 18:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-09 22:15 [Buildroot] [PATCH v2] yajl: fix static linking in a parallel build Jörg Krause
2016-04-10 18:39 ` Arnout Vandecappelle [this message]
2016-04-15 18:27 ` 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=570A9DEF.4030707@mind.be \
--to=arnout@mind.be \
--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