From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] package/lvm2: Fix runtime crash when using uclibc
Date: Wed, 25 Jul 2018 18:09:11 +0200 [thread overview]
Message-ID: <20180725180911.5952264a@windsurf> (raw)
In-Reply-To: <20180725123703.12826-2-m.niestroj@grinn-global.com>
Hello Marcin,
On Wed, 25 Jul 2018 14:37:03 +0200, Marcin Niestroj wrote:
> When using uclibc libdevmapper.so was calling dm_task_get_info_base()
> function recursively, leading to segmentation fault. This was
> happening because uclibc linker loader just takes first existing
> 'dm_task_get_info' (which is 'dm_task_get_info_base') symbol in elf
> binary, instead of default version.
>
> Add upstreamable lvm2 patch [1], which introduces
> --enable-symvers[=STYLE] switch. Use that switch to disable symbol
> versions, as we do not plan to support binaries compiled against
> old libdevmapper library.
>
> [1] https://www.redhat.com/archives/dm-devel/2018-July/msg00187.html
>
> Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Is this needed only with the lvm2 bump to 2.02.180 ? Or is it needed
even with the current version of lvm2 we have packaged in Buildroot ?
> ---
> ...gure-Introduce-enable-symvers-option.patch | 288 ++++++++++++++++++
> package/lvm2/lvm2.mk | 3 +-
> 2 files changed, 290 insertions(+), 1 deletion(-)
> create mode 100644 package/lvm2/0001-configure-Introduce-enable-symvers-option.patch
>
> diff --git a/package/lvm2/0001-configure-Introduce-enable-symvers-option.patch b/package/lvm2/0001-configure-Introduce-enable-symvers-option.patch
> new file mode 100644
> index 0000000000..757305a86d
> --- /dev/null
> +++ b/package/lvm2/0001-configure-Introduce-enable-symvers-option.patch
> @@ -0,0 +1,288 @@
> +From f4fb05978de506c6941c80493c4f3b77f0509913 Mon Sep 17 00:00:00 2001
> +From: Marcin Niestroj <m.niestroj@grinn-global.com>
> +Date: Fri, 20 Jul 2018 14:26:44 +0200
> +Subject: [PATCH] configure: Introduce --enable-symvers option
> +
> +Only few libc (e.g. glibc) libraries support full symbol version
> +resolution in runtime. There are lot of standard libraries that do not
> +support that, such as dietlibc, musl and uclibc. Hence there is no
> +reason to generate symbol versions when compiling against them.
> +
> +Additionally libdevmapper.so was broken when compiled against
> +uclibc. Runtime linker loader caused calling dm_task_get_info_base()
> +function recursively, leading to segmentation fault.
> +
> +Introduce --enable-symvers[=STYLE] option, which allows to choose
> +between gnu and disabled symbol versioning. By default gnu symbol
> +versioning is used to provide backward compatibility.
> +__GNUC__ check is replaced now with GNU_SYMVER, which is generated by
> +configure script. Additionally ld version script is included only in
> +case of gnu option, which slightly reduces output size.
> +
> +Providing --disable-symvers to configure script when building against
> +uclibc library fixes segmentation fault error described above, due to
> +lack of several versions of the same symbol in libdevmapper.so
> +library.
Could you add your SoB to the patch itself ?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-07-25 16:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-25 12:37 [Buildroot] [PATCH 1/2] package/lvm2: bump version to 2.02.180 Marcin Niestroj
2018-07-25 12:37 ` [Buildroot] [PATCH 2/2] package/lvm2: Fix runtime crash when using uclibc Marcin Niestroj
2018-07-25 16:09 ` Thomas Petazzoni [this message]
2018-07-25 16:18 ` Marcin Niestroj
2018-07-25 16:25 ` Thomas Petazzoni
2018-07-25 16:37 ` Marcin Niestroj
2018-07-26 11:13 ` Marcin Niestroj
2018-07-26 12:23 ` Thomas Petazzoni
2018-07-25 14:46 ` [Buildroot] [PATCH 1/2] package/lvm2: bump version to 2.02.180 Baruch Siach
2018-07-25 16:16 ` Marcin Niestroj
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=20180725180911.5952264a@windsurf \
--to=thomas.petazzoni@bootlin.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