* [Buildroot] [PATCH 0/2] parted: fix static link (branch yem/for-release)
@ 2014-11-29 15:59 Yann E. MORIN
2014-11-29 15:59 ` [Buildroot] [PATCH 1/2] package/util-linux: libuuid needs -lintl Yann E. MORIN
2014-11-29 15:59 ` [Buildroot] [PATCH 2/2] package/parted: fix static link Yann E. MORIN
0 siblings, 2 replies; 8+ messages in thread
From: Yann E. MORIN @ 2014-11-29 15:59 UTC (permalink / raw)
To: buildroot
Hello All!
This seriesis an RFC to fix building parted in static links.
I have no good idea on how to properly fix the libuuid .pc file, so I
did it iwth a conditional post-install hook. I'm sure this is not the
best option, but I can't think of anything better (yet).
Of course, the parted patch is dependent on the preceding util-linux
patch, but can still be applied without it, because at worst it would
leave us in the same situation as we ar today.
Still, this is just an RFC to see what you guys think about it.
Regards,
Yann E. MORIN.
The following changes since commit fcd082a0c3f78381ecdf41d487405434fabd09b0:
package/libwebsockets: fiux static build (2014-11-29 15:47:28 +0100)
are available in the git repository at:
git://git.busybox.net/~ymorin/git/buildroot yem/for-release
for you to fetch changes up to 4431396aaa3e810c5ef599e341858e8849d530e1:
package/parted: fix static link (2014-11-29 16:57:56 +0100)
----------------------------------------------------------------
Yann E. MORIN (2):
package/util-linux: libuuid needs -lintl
package/parted: fix static link
.../parted/parted-003-fix-static-link-uuid.patch | 21 +++++++++++++++++++++
package/util-linux/util-linux.mk | 8 ++++++++
2 files changed, 29 insertions(+)
create mode 100644 package/parted/parted-003-fix-static-link-uuid.patch
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 8+ messages in thread* [Buildroot] [PATCH 1/2] package/util-linux: libuuid needs -lintl 2014-11-29 15:59 [Buildroot] [PATCH 0/2] parted: fix static link (branch yem/for-release) Yann E. MORIN @ 2014-11-29 15:59 ` Yann E. MORIN 2014-11-29 18:04 ` Baruch Siach 2014-11-30 11:57 ` Yann E. MORIN 2014-11-29 15:59 ` [Buildroot] [PATCH 2/2] package/parted: fix static link Yann E. MORIN 1 sibling, 2 replies; 8+ messages in thread From: Yann E. MORIN @ 2014-11-29 15:59 UTC (permalink / raw) To: buildroot When gettext is needed (with locales), libuuid needs to be linked against -lintl. In dynamic link, this is solved via the DT_NEEDED ELF tag, but for static links, it does not get pulled in automatically. fix that by adding a Libs.private section to uid.pc, but only if it needed. First part at fixing: http://autobuild.buildroot.net/results/c46/c467aeec258909bb82eda77123803944f97d8df8/ Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- package/util-linux/util-linux.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk index 6ecd16d..dc10193 100644 --- a/package/util-linux/util-linux.mk +++ b/package/util-linux/util-linux.mk @@ -128,6 +128,14 @@ endif UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_GETTY_SYMLINK +ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE)$(BR2_PACKAGE_UTIL_LINUX_LIBUUID),yy) +define UTIL_LINUX_TWEAK_UUID_PC + $(SED) '/Libs\.private: .*/d' $(STAGING_DIR)/usr/lib/pkgconfig/uuid.pc + printf "Libs.private: -lintl\n" >>$(STAGING_DIR)/usr/lib/pkgconfig/uuid.pc +endef +UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_TWEAK_UUID_PC +endif + $(eval $(autotools-package)) $(eval $(host-autotools-package)) -- 1.9.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/2] package/util-linux: libuuid needs -lintl 2014-11-29 15:59 ` [Buildroot] [PATCH 1/2] package/util-linux: libuuid needs -lintl Yann E. MORIN @ 2014-11-29 18:04 ` Baruch Siach 2014-11-29 18:12 ` Yann E. MORIN 2014-11-30 11:57 ` Yann E. MORIN 1 sibling, 1 reply; 8+ messages in thread From: Baruch Siach @ 2014-11-29 18:04 UTC (permalink / raw) To: buildroot Hi Yann, On Sat, Nov 29, 2014 at 04:59:57PM +0100, Yann E. MORIN wrote: > When gettext is needed (with locales), libuuid needs to be linked > against -lintl. > > In dynamic link, this is solved via the DT_NEEDED ELF tag, but for > static links, it does not get pulled in automatically. > > fix that by adding a Libs.private section to uid.pc, but only if s/uid/uuid/ baruch > it needed. > > First part at fixing: > http://autobuild.buildroot.net/results/c46/c467aeec258909bb82eda77123803944f97d8df8/ > > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> > --- > package/util-linux/util-linux.mk | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk > index 6ecd16d..dc10193 100644 > --- a/package/util-linux/util-linux.mk > +++ b/package/util-linux/util-linux.mk > @@ -128,6 +128,14 @@ endif > > UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_GETTY_SYMLINK > > +ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE)$(BR2_PACKAGE_UTIL_LINUX_LIBUUID),yy) > +define UTIL_LINUX_TWEAK_UUID_PC > + $(SED) '/Libs\.private: .*/d' $(STAGING_DIR)/usr/lib/pkgconfig/uuid.pc > + printf "Libs.private: -lintl\n" >>$(STAGING_DIR)/usr/lib/pkgconfig/uuid.pc > +endef > +UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_TWEAK_UUID_PC > +endif > + > $(eval $(autotools-package)) > $(eval $(host-autotools-package)) -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/2] package/util-linux: libuuid needs -lintl 2014-11-29 18:04 ` Baruch Siach @ 2014-11-29 18:12 ` Yann E. MORIN 0 siblings, 0 replies; 8+ messages in thread From: Yann E. MORIN @ 2014-11-29 18:12 UTC (permalink / raw) To: buildroot Baruch, All, On 2014-11-29 20:04 +0200, Baruch Siach spake thusly: > On Sat, Nov 29, 2014 at 04:59:57PM +0100, Yann E. MORIN wrote: > > When gettext is needed (with locales), libuuid needs to be linked > > against -lintl. > > > > In dynamic link, this is solved via the DT_NEEDED ELF tag, but for > > static links, it does not get pulled in automatically. > > > > fix that by adding a Libs.private section to uid.pc, but only if > > s/uid/uuid/ Fixed, thanks! Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/2] package/util-linux: libuuid needs -lintl 2014-11-29 15:59 ` [Buildroot] [PATCH 1/2] package/util-linux: libuuid needs -lintl Yann E. MORIN 2014-11-29 18:04 ` Baruch Siach @ 2014-11-30 11:57 ` Yann E. MORIN 1 sibling, 0 replies; 8+ messages in thread From: Yann E. MORIN @ 2014-11-30 11:57 UTC (permalink / raw) To: buildroot Thomas, Peter, All, On 2014-11-29 16:59 +0100, Yann E. MORIN spake thusly: > When gettext is needed (with locales), libuuid needs to be linked > against -lintl. > > In dynamic link, this is solved via the DT_NEEDED ELF tag, but for > static links, it does not get pulled in automatically. > > fix that by adding a Libs.private section to uid.pc, but only if > it needed. > > First part at fixing: > http://autobuild.buildroot.net/results/c46/c467aeec258909bb82eda77123803944f97d8df8/ > > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> > --- > package/util-linux/util-linux.mk | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk > index 6ecd16d..dc10193 100644 > --- a/package/util-linux/util-linux.mk > +++ b/package/util-linux/util-linux.mk > @@ -128,6 +128,14 @@ endif > > UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_GETTY_SYMLINK > > +ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE)$(BR2_PACKAGE_UTIL_LINUX_LIBUUID),yy) > +define UTIL_LINUX_TWEAK_UUID_PC > + $(SED) '/Libs\.private: .*/d' $(STAGING_DIR)/usr/lib/pkgconfig/uuid.pc > + printf "Libs.private: -lintl\n" >>$(STAGING_DIR)/usr/lib/pkgconfig/uuid.pc > +endef > +UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_TWEAK_UUID_PC > +endif We've been discussing this on IRC, that we should come up with a patch that could be upstreamable. Unfortunately, I have no idea on how to do that... It all boils down to util-linux not using the standard expansion mechanism of autoconf (i.e. to replace @VARIABLE@ in .in files with the value detected by ./configure). Also, the way they are checking for gettext is way beyond my understanding (well, I think I grasped most of it), and they have no variable that expressly states whether -lintl is needed, just a LIBINTL variable that contains whatever must be used to link with the gettext-providing library. The amount of work to fix that is way above the time left before our release, so I believe we should go with that patch for now, and revisit it later when we have some more time. Opinions? > $(eval $(autotools-package)) > $(eval $(host-autotools-package)) > > -- > 1.9.1 > -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 2/2] package/parted: fix static link 2014-11-29 15:59 [Buildroot] [PATCH 0/2] parted: fix static link (branch yem/for-release) Yann E. MORIN 2014-11-29 15:59 ` [Buildroot] [PATCH 1/2] package/util-linux: libuuid needs -lintl Yann E. MORIN @ 2014-11-29 15:59 ` Yann E. MORIN 2014-11-29 16:56 ` Peter Korsgaard 1 sibling, 1 reply; 8+ messages in thread From: Yann E. MORIN @ 2014-11-29 15:59 UTC (permalink / raw) To: buildroot libuuid needs to be linked with -lintl when gettext is needed (with locales). For a static build, this is solved with the DT_NEEDED ELF tags, but for a static link, it is not pulled in automatically. Use pkg-config to find libuuid, instead of AC_CHECK_LIB(). Second part at fixing: http://autobuild.buildroot.net/results/c46/c467aeec258909bb82eda77123803944f97d8df8/ Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- .../parted/parted-003-fix-static-link-uuid.patch | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 package/parted/parted-003-fix-static-link-uuid.patch diff --git a/package/parted/parted-003-fix-static-link-uuid.patch b/package/parted/parted-003-fix-static-link-uuid.patch new file mode 100644 index 0000000..e281b6f --- /dev/null +++ b/package/parted/parted-003-fix-static-link-uuid.patch @@ -0,0 +1,21 @@ +diff -durN parted-3.1.orig/configure.ac parted-3.1/configure.ac +--- parted-3.1.orig/configure.ac 2014-11-29 16:27:49.520560137 +0100 ++++ parted-3.1/configure.ac 2014-11-29 16:32:50.799702049 +0100 +@@ -313,16 +313,7 @@ + AC_SUBST([DL_LIBS]) + + dnl Check for libuuid +-UUID_LIBS="" +-AC_CHECK_LIB([uuid], [uuid_generate], [UUID_LIBS="-luuid"], +- [AC_MSG_ERROR(dnl +-[GNU Parted requires libuuid - a part of the util-linux-ng package (but +-usually distributed separately in libuuid-devel, uuid-dev or similar) +-This can probably be found on your distribution's CD or FTP site or at: +- http://userweb.kernel.org/~kzak/util-linux-ng/ +-Note: originally, libuuid was part of the e2fsprogs package. Later, it +-moved to util-linux-ng-2.16, and that package is now the preferred source.])]) +-AC_SUBST([UUID_LIBS]) ++PKG_CHECK_MODULES([UUID],[uuid]) + + dnl Check for libdevmapper + DM_LIBS= -- 1.9.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 2/2] package/parted: fix static link 2014-11-29 15:59 ` [Buildroot] [PATCH 2/2] package/parted: fix static link Yann E. MORIN @ 2014-11-29 16:56 ` Peter Korsgaard 2014-11-29 18:14 ` Yann E. MORIN 0 siblings, 1 reply; 8+ messages in thread From: Peter Korsgaard @ 2014-11-29 16:56 UTC (permalink / raw) To: buildroot >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes: > libuuid needs to be linked with -lintl when gettext is needed (with > locales). > For a static build, this is solved with the DT_NEEDED ELF tags, but for s/static/shared/ > a static link, it is not pulled in automatically. > Use pkg-config to find libuuid, instead of AC_CHECK_LIB(). > Second part at fixing: > http://autobuild.buildroot.net/results/c46/c467aeec258909bb82eda77123803944f97d8df8/ > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> > --- > .../parted/parted-003-fix-static-link-uuid.patch | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > create mode 100644 package/parted/parted-003-fix-static-link-uuid.patch > diff --git a/package/parted/parted-003-fix-static-link-uuid.patch b/package/parted/parted-003-fix-static-link-uuid.patch > new file mode 100644 > index 0000000..e281b6f > --- /dev/null > +++ b/package/parted/parted-003-fix-static-link-uuid.patch > @@ -0,0 +1,21 @@ You forgot the patch description + signed-off-by. Otherwise it looks good. Please don't forget to send it upstream. -- Bye, Peter Korsgaard ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 2/2] package/parted: fix static link 2014-11-29 16:56 ` Peter Korsgaard @ 2014-11-29 18:14 ` Yann E. MORIN 0 siblings, 0 replies; 8+ messages in thread From: Yann E. MORIN @ 2014-11-29 18:14 UTC (permalink / raw) To: buildroot Peter, All, On 2014-11-29 17:56 +0100, Peter Korsgaard spake thusly: > >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes: > > > libuuid needs to be linked with -lintl when gettext is needed (with > > locales). > > > For a static build, this is solved with the DT_NEEDED ELF tags, but for > > s/static/shared/ Yup, onviously. Fixed, thanks. > > a static link, it is not pulled in automatically. > > > Use pkg-config to find libuuid, instead of AC_CHECK_LIB(). > > > Second part at fixing: > > http://autobuild.buildroot.net/results/c46/c467aeec258909bb82eda77123803944f97d8df8/ > > > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> > > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> > > --- > > .../parted/parted-003-fix-static-link-uuid.patch | 21 +++++++++++++++++++++ > > 1 file changed, 21 insertions(+) > > create mode 100644 package/parted/parted-003-fix-static-link-uuid.patch > > > diff --git a/package/parted/parted-003-fix-static-link-uuid.patch b/package/parted/parted-003-fix-static-link-uuid.patch > > new file mode 100644 > > index 0000000..e281b6f > > --- /dev/null > > +++ b/package/parted/parted-003-fix-static-link-uuid.patch > > @@ -0,0 +1,21 @@ > > You forgot the patch description + signed-off-by. Damn, I knew something was amiss in that submission. If all that is incorrect is the patch description and a missing SoB, then that's cool. I was expecting that series to be more controversial. I'll respin those two a bit later. Thanks! :-) > Otherwise it looks good. Please don't forget to send it upstream. Yep, I'm actively pushing things upstream when it makes sense. ;-) Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-11-30 11:57 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-11-29 15:59 [Buildroot] [PATCH 0/2] parted: fix static link (branch yem/for-release) Yann E. MORIN 2014-11-29 15:59 ` [Buildroot] [PATCH 1/2] package/util-linux: libuuid needs -lintl Yann E. MORIN 2014-11-29 18:04 ` Baruch Siach 2014-11-29 18:12 ` Yann E. MORIN 2014-11-30 11:57 ` Yann E. MORIN 2014-11-29 15:59 ` [Buildroot] [PATCH 2/2] package/parted: fix static link Yann E. MORIN 2014-11-29 16:56 ` Peter Korsgaard 2014-11-29 18:14 ` Yann E. MORIN
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox