Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2 v2] parted: fix static link (branch yem/for-release)
@ 2014-11-30 22:31 Yann E. MORIN
  2014-11-30 22:31 ` [Buildroot] [PATCH 1/2 v2] package/util-linux: libuuid needs -lintl Yann E. MORIN
  2014-11-30 22:31 ` [Buildroot] [PATCH 2/2 v2] package/parted: fix static link Yann E. MORIN
  0 siblings, 2 replies; 5+ messages in thread
From: Yann E. MORIN @ 2014-11-30 22:31 UTC (permalink / raw)
  To: buildroot

Hello All!

This series fixes static linking in parted.

It needs fixes in two packages:
  - util-linux, so libuuid properly sets its .pc file;
  - parted itself to use pkg-config to find libuuid instead of
    AC_CHECK_LIB.


Changes v1 -> v2:
  - add description to parted patch  (Peter)
  - misc typoes  (Baruch, Peter)


Regards,
Yann E. MORIN.


The following changes since commit b68b6eca4c7c7895cd9d1a17761fdc3a835a6be7:

  package/libwebsockets: fix static build (2014-11-30 12:43:33 +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 fa1b00debbe3293a7617c2c7829e9acead92dc19:

  package/parted: fix static link (2014-11-30 14:59:24 +0100)

----------------------------------------------------------------
Yann E. MORIN (2):
      package/util-linux: libuuid needs -lintl
      package/parted: fix static link

 .../parted/parted-003-fix-static-link-uuid.patch   | 48 ++++++++++++++++++++++
 package/util-linux/util-linux.mk                   |  8 ++++
 2 files changed, 56 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] 5+ messages in thread

* [Buildroot] [PATCH 1/2 v2] package/util-linux: libuuid needs -lintl
  2014-11-30 22:31 [Buildroot] [PATCH 0/2 v2] parted: fix static link (branch yem/for-release) Yann E. MORIN
@ 2014-11-30 22:31 ` Yann E. MORIN
  2014-11-30 23:19   ` Peter Korsgaard
  2014-11-30 22:31 ` [Buildroot] [PATCH 2/2 v2] package/parted: fix static link Yann E. MORIN
  1 sibling, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2014-11-30 22:31 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 uuid.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>
Cc: Baruch Siach <baruch@tkos.co.il>

---
Changes v1 -> v2:
  - typo  (Baruch)
---
 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] 5+ messages in thread

* [Buildroot] [PATCH 2/2 v2] package/parted: fix static link
  2014-11-30 22:31 [Buildroot] [PATCH 0/2 v2] parted: fix static link (branch yem/for-release) Yann E. MORIN
  2014-11-30 22:31 ` [Buildroot] [PATCH 1/2 v2] package/util-linux: libuuid needs -lintl Yann E. MORIN
@ 2014-11-30 22:31 ` Yann E. MORIN
  2014-11-30 23:20   ` Peter Korsgaard
  1 sibling, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2014-11-30 22:31 UTC (permalink / raw)
  To: buildroot

libuuid needs to be linked with -lintl when gettext is needed (with
locales).

For a shared 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>
Cc: Peter Korsgaard <jacmet@uclibc.org>

---
Changes v1 -> v2:
  - typoes  (Peter)
---
 .../parted/parted-003-fix-static-link-uuid.patch   | 48 ++++++++++++++++++++++
 1 file changed, 48 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..d6ec2cf
--- /dev/null
+++ b/package/parted/parted-003-fix-static-link-uuid.patch
@@ -0,0 +1,48 @@
+configure: use pkg-config to find libuuid
+
+In some conditions, libuuid may be linked with -lintl. This can be the
+case on uClibc when locales are enabled.
+
+When doing a shared link, this dependency is automatically pulled in via
+a DT_NEEDED ELF tag
+
+For a static link, there is no such mechanism to pull in dependent
+libraries.
+
+Currently, the check for libuuid is done with AC_CHECK_LIB, but this
+does not handle dependencies, and thus a stattic build fails.
+
+Use pkg-config to find libuuid, that automatically pulls in the
+dependencies of libuuid, if any.
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+---
+Note: of course, that relies on the fact that libuuid installs a proper
+.pc file; a patch will be submitted upstream shortly.
+
+But even considering the current situation, where libuuid does not
+provide a proper .pc file (yet), this patch does not change the
+behaviour we've had so far; it is a bet on the future! ;-)
+
+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] 5+ messages in thread

* [Buildroot] [PATCH 1/2 v2] package/util-linux: libuuid needs -lintl
  2014-11-30 22:31 ` [Buildroot] [PATCH 1/2 v2] package/util-linux: libuuid needs -lintl Yann E. MORIN
@ 2014-11-30 23:19   ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2014-11-30 23:19 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > 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 uuid.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>
 > Cc: Baruch Siach <baruch@tkos.co.il>

 > ---
 > Changes v1 -> v2:
 >   - typo  (Baruch)
 > ---
 >  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

As discussed on IRC, I don't think the SED line is needed - But lets
leave it here to be on the safe side.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2 v2] package/parted: fix static link
  2014-11-30 22:31 ` [Buildroot] [PATCH 2/2 v2] package/parted: fix static link Yann E. MORIN
@ 2014-11-30 23:20   ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2014-11-30 23:20 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 shared 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>
 > Cc: Peter Korsgaard <jacmet@uclibc.org>

 > ---
 > Changes v1 -> v2:
 >   - typoes  (Peter)

You forgot to add host-pkgconf to the _DEPENDENCIES lines
(target/host). Committed with that fixed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-30 23:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-30 22:31 [Buildroot] [PATCH 0/2 v2] parted: fix static link (branch yem/for-release) Yann E. MORIN
2014-11-30 22:31 ` [Buildroot] [PATCH 1/2 v2] package/util-linux: libuuid needs -lintl Yann E. MORIN
2014-11-30 23:19   ` Peter Korsgaard
2014-11-30 22:31 ` [Buildroot] [PATCH 2/2 v2] package/parted: fix static link Yann E. MORIN
2014-11-30 23:20   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox