Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] parted: properly link with libiconv
@ 2017-10-07 23:06 Arnout Vandecappelle
  2017-10-08 13:30 ` Thomas Petazzoni
  2017-10-08 21:09 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2017-10-07 23:06 UTC (permalink / raw)
  To: buildroot

parted uses libiconv but doesn't link with it. All the checks are there
in configure, but the Makefile.am doesn't add it to the link. Add a
patch to fix this.

Also add an optional dependency on libiconv, so it is reproducible.

While we're at it, regenerate the existing patches on top of v3.2, and
make patch 0003 a properly git formatted one.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: srg.venema at gmail.com
---
 ...rch-linux.c-Compile-without-ENABLE_DEVICE.patch |  8 ++---
 .../0002-configure.ac-uclinux-is-also-linux.patch  |  4 +--
 ...Include-fcntl.h-to-get-loff_t-definition.patch} | 19 ++++++++----
 ...arted-labels-link-with-libiconv-if-needed.patch | 34 ++++++++++++++++++++++
 package/parted/parted.mk                           |  7 ++++-
 5 files changed, 60 insertions(+), 12 deletions(-)
 rename package/parted/{0003-fix-includes-for-musl.patch => 0003-Include-fcntl.h-to-get-loff_t-definition.patch} (36%)
 create mode 100644 package/parted/0004-libparted-labels-link-with-libiconv-if-needed.patch

diff --git a/package/parted/0001-libparted-arch-linux.c-Compile-without-ENABLE_DEVICE.patch b/package/parted/0001-libparted-arch-linux.c-Compile-without-ENABLE_DEVICE.patch
index 5adc9beb12..1cf699bb12 100644
--- a/package/parted/0001-libparted-arch-linux.c-Compile-without-ENABLE_DEVICE.patch
+++ b/package/parted/0001-libparted-arch-linux.c-Compile-without-ENABLE_DEVICE.patch
@@ -1,4 +1,4 @@
-From 7e87ca3c531228d35e13e802d2622006138b104c Mon Sep 17 00:00:00 2001
+From 141c4309d7164dcd4e09d137fc075c1726fd8dbb Mon Sep 17 00:00:00 2001
 From: Felix Janda <felix.janda@posteo.de>
 Date: Sun, 3 May 2015 10:33:15 +0200
 Subject: [PATCH] libparted/arch/linux.c: Compile without ENABLE_DEVICE_MAPPER
@@ -10,7 +10,7 @@ Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  1 file changed, 17 insertions(+), 4 deletions(-)
 
 diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
-index 90ab21d..f6141e4 100644
+index 0f18904..cf38c6f 100644
 --- a/libparted/arch/linux.c
 +++ b/libparted/arch/linux.c
 @@ -2304,6 +2304,7 @@ zasprintf (const char *format, ...)
@@ -57,7 +57,7 @@ index 90ab21d..f6141e4 100644
          return result;
  }
  
-@@ -2958,12 +2968,15 @@ _disk_sync_part_table (PedDisk* disk)
+@@ -2945,12 +2955,15 @@ _disk_sync_part_table (PedDisk* disk)
                                                 unsigned long long *length);
  
  
@@ -75,5 +75,5 @@ index 90ab21d..f6141e4 100644
                  remove_partition = _blkpg_remove_partition;
  #ifdef BLKPG_RESIZE_PARTITION
 -- 
-2.1.4
+2.14.2
 
diff --git a/package/parted/0002-configure.ac-uclinux-is-also-linux.patch b/package/parted/0002-configure.ac-uclinux-is-also-linux.patch
index b2119bcdd7..5a264ced80 100644
--- a/package/parted/0002-configure.ac-uclinux-is-also-linux.patch
+++ b/package/parted/0002-configure.ac-uclinux-is-also-linux.patch
@@ -1,4 +1,4 @@
-From b3958317c5ee2940e7024bec2e7f288b5a6a26c3 Mon Sep 17 00:00:00 2001
+From 7697d9c54e489b32b82c01f17db04f8b51857e51 Mon Sep 17 00:00:00 2001
 From: Gustavo Zacarias <gustavo@zacarias.com.ar>
 Date: Mon, 30 Jun 2014 10:09:04 -0300
 Subject: [PATCH] configure.ac: uclinux is also linux
@@ -29,5 +29,5 @@ index 436d0e2..50ad478 100644
  AC_SUBST([OS])
  
 -- 
-1.8.5.5
+2.14.2
 
diff --git a/package/parted/0003-fix-includes-for-musl.patch b/package/parted/0003-Include-fcntl.h-to-get-loff_t-definition.patch
similarity index 36%
rename from package/parted/0003-fix-includes-for-musl.patch
rename to package/parted/0003-Include-fcntl.h-to-get-loff_t-definition.patch
index 28c94ace7c..ca82174a55 100644
--- a/package/parted/0003-fix-includes-for-musl.patch
+++ b/package/parted/0003-Include-fcntl.h-to-get-loff_t-definition.patch
@@ -1,13 +1,19 @@
-Include <fcntl.h> to get loff_t definition
+From 2078c07d38ee7841b89ac8d81afc5e8bfcd4f703 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sun, 8 Oct 2017 00:58:58 +0200
+Subject: [PATCH] Include <fcntl.h> to get loff_t definition
 
 Patch borrowed from Alpine Linux at
 http://git.alpinelinux.org/cgit/aports/plain/main/parted/fix-includes.patch. Solves
 build with musl.
+---
+ libparted/fs/xfs/platform_defs.h | 1 +
+ 1 file changed, 1 insertion(+)
 
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-
---- parted-3.1.orig/libparted/fs/xfs/platform_defs.h
-+++ parted-3.1/libparted/fs/xfs/platform_defs.h
+diff --git a/libparted/fs/xfs/platform_defs.h b/libparted/fs/xfs/platform_defs.h
+index 2b55752..17023dc 100644
+--- a/libparted/fs/xfs/platform_defs.h
++++ b/libparted/fs/xfs/platform_defs.h
 @@ -35,6 +35,7 @@
  #define __XFS_PLATFORM_DEFS_H__
  
@@ -16,3 +22,6 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  #include <stdarg.h>
  #include <assert.h>
  #include <endian.h>
+-- 
+2.14.2
+
diff --git a/package/parted/0004-libparted-labels-link-with-libiconv-if-needed.patch b/package/parted/0004-libparted-labels-link-with-libiconv-if-needed.patch
new file mode 100644
index 0000000000..9cabdeed89
--- /dev/null
+++ b/package/parted/0004-libparted-labels-link-with-libiconv-if-needed.patch
@@ -0,0 +1,34 @@
+From 1084b0255c42fc86adb0a2c7614e341ac530db65 Mon Sep 17 00:00:00 2001
+From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
+Date: Sun, 8 Oct 2017 00:53:31 +0200
+Subject: [PATCH] libparted/labels: link with libiconv if needed
+
+gpt.c uses iconv so it should link with it. Otherwise, on platforms
+where libiconv is a separate library, we get a link failure of parted:
+
+    CCLD     parted
+  ../libparted/.libs/libparted.so: undefined reference to `libiconv'
+  ../libparted/.libs/libparted.so: undefined reference to `libiconv_open'
+  ../libparted/.libs/libparted.so: undefined reference to `libiconv_close'
+
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
+---
+ libparted/labels/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libparted/labels/Makefile.am b/libparted/labels/Makefile.am
+index c996f81..b204379 100644
+--- a/libparted/labels/Makefile.am
++++ b/libparted/labels/Makefile.am
+@@ -35,7 +35,7 @@ liblabels_la_SOURCES = \
+   rdb.c		\
+   sun.c
+ 
+-liblabels_la_LIBADD = $(OS_LIBS) $(INTLLIBS)
++liblabels_la_LIBADD = $(OS_LIBS) $(INTLLIBS) $(LIBICONV)
+ 
+ AM_CPPFLAGS = $(partedincludedir) $(INTLINCS)
+ 
+-- 
+2.14.2
+
diff --git a/package/parted/parted.mk b/package/parted/parted.mk
index 35d152b469..1f0428a55b 100644
--- a/package/parted/parted.mk
+++ b/package/parted/parted.mk
@@ -9,7 +9,8 @@ PARTED_SOURCE = parted-$(PARTED_VERSION).tar.xz
 PARTED_SITE = $(BR2_GNU_MIRROR)/parted
 PARTED_DEPENDENCIES = host-pkgconf util-linux
 PARTED_INSTALL_STAGING = YES
-# For uclinux patch
+# 0002-configure.ac-uclinux-is-also-linux.patch
+# 0004-libparted-labels-link-with-libiconv-if-needed.patch
 PARTED_AUTORECONF = YES
 PARTED_GETTEXTIZE = YES
 PARTED_LICENSE = GPL-3.0+
@@ -29,6 +30,10 @@ else
 PARTED_CONF_OPTS += --disable-device-mapper
 endif
 
+ifeq ($(BR2_PACKAGE_LIBICONV),y)
+PARTED_DEPENDENCIES += libiconv
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 PARTED_CONF_OPTS += --disable-dynamic-loading
 endif
-- 
2.14.2

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

* [Buildroot] [PATCH] parted: properly link with libiconv
  2017-10-07 23:06 [Buildroot] [PATCH] parted: properly link with libiconv Arnout Vandecappelle
@ 2017-10-08 13:30 ` Thomas Petazzoni
  2017-10-08 21:09 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-10-08 13:30 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 8 Oct 2017 01:06:11 +0200, Arnout Vandecappelle
(Essensium/Mind) wrote:
> parted uses libiconv but doesn't link with it. All the checks are there
> in configure, but the Makefile.am doesn't add it to the link. Add a
> patch to fix this.
> 
> Also add an optional dependency on libiconv, so it is reproducible.
> 
> While we're at it, regenerate the existing patches on top of v3.2, and
> make patch 0003 a properly git formatted one.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: srg.venema at gmail.com
> ---
>  ...rch-linux.c-Compile-without-ENABLE_DEVICE.patch |  8 ++---
>  .../0002-configure.ac-uclinux-is-also-linux.patch  |  4 +--
>  ...Include-fcntl.h-to-get-loff_t-definition.patch} | 19 ++++++++----
>  ...arted-labels-link-with-libiconv-if-needed.patch | 34 ++++++++++++++++++++++
>  package/parted/parted.mk                           |  7 ++++-
>  5 files changed, 60 insertions(+), 12 deletions(-)
>  rename package/parted/{0003-fix-includes-for-musl.patch => 0003-Include-fcntl.h-to-get-loff_t-definition.patch} (36%)
>  create mode 100644 package/parted/0004-libparted-labels-link-with-libiconv-if-needed.patch

Applied to master, thanks. Don't forget to send the patch upstream.
Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] parted: properly link with libiconv
  2017-10-07 23:06 [Buildroot] [PATCH] parted: properly link with libiconv Arnout Vandecappelle
  2017-10-08 13:30 ` Thomas Petazzoni
@ 2017-10-08 21:09 ` Thomas Petazzoni
       [not found]   ` <CAPzckP6FYH1rQPVnaozWg167THtdhovB7nYtX=XVe5_yM7W2Gg@mail.gmail.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2017-10-08 21:09 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 8 Oct 2017 01:06:11 +0200, Arnout Vandecappelle
(Essensium/Mind) wrote:
> parted uses libiconv but doesn't link with it. All the checks are there
> in configure, but the Makefile.am doesn't add it to the link. Add a
> patch to fix this.
> 
> Also add an optional dependency on libiconv, so it is reproducible.
> 
> While we're at it, regenerate the existing patches on top of v3.2, and
> make patch 0003 a properly git formatted one.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: srg.venema at gmail.com

This seems to do more harm than good: it now tries to link with -liconv
in all cases, even when it is not needed (for example with glibc).

  http://autobuild.buildroot.net/?reason=parted-3.2

I've reverted your patch for now.

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] parted: properly link with libiconv
       [not found]   ` <CAPzckP6FYH1rQPVnaozWg167THtdhovB7nYtX=XVe5_yM7W2Gg@mail.gmail.com>
@ 2017-10-10 10:23     ` Arnout Vandecappelle
  0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2017-10-10 10:23 UTC (permalink / raw)
  To: buildroot



On 10-10-17 12:15, Sjoerd Venema wrote:
> Hi All,
> 
> Is there any way for me, a "user" to get udisks (depending on the problematic
> parted package) on my buildroot built?
> I'd be happy with a quick hack or dirty workaround for the moment. My project is
> now somewhat dead in the water...

 One quick hack should be to enable BR2_ENABLE_LOCALE=y, which will disable the
libiconv package because it will be part of uClibc.


 Regards,
 Arnout

> I'm not demanding anyone to go out of their way to support just one guy in the
> crowd, just want to know if there are any possible quick fixes... ;-)
> Much appreciated! :)

[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

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

end of thread, other threads:[~2017-10-10 10:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-07 23:06 [Buildroot] [PATCH] parted: properly link with libiconv Arnout Vandecappelle
2017-10-08 13:30 ` Thomas Petazzoni
2017-10-08 21:09 ` Thomas Petazzoni
     [not found]   ` <CAPzckP6FYH1rQPVnaozWg167THtdhovB7nYtX=XVe5_yM7W2Gg@mail.gmail.com>
2017-10-10 10:23     ` Arnout Vandecappelle

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