From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Date: Wed, 25 Jul 2018 18:09:11 +0200 Subject: [Buildroot] [PATCH 2/2] package/lvm2: Fix runtime crash when using uclibc In-Reply-To: <20180725123703.12826-2-m.niestroj@grinn-global.com> References: <20180725123703.12826-1-m.niestroj@grinn-global.com> <20180725123703.12826-2-m.niestroj@grinn-global.com> Message-ID: <20180725180911.5952264a@windsurf> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net 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 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 > +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