On Mon, May 16, 2011 at 12:55:18PM -0400, Jon Ringle wrote:
> Added these patches that fix problems when building with uclibc toolchain:
> 0002-__progname-redefinition-fix.patch
> 0003-_s-undeclared-fix.patch
> 0004-replace-index-with-strchr.patch
> 0005-libmount-replace-mkostmps-with-more-portable-mkstemp.patch
> 0006-partx-lsblk-fix-gettext-calls.patch
> 
> Signed-off-by: Jon Ringle <[email protected]>
> ---
>  ...d-fallbacks-for-old-systems-without-umoun.patch |    6 +-
>  .../0002-__progname-redefinition-fix.patch         |   62 +++++++++++++++++++
>  .../util-linux-2.19/0003-_s-undeclared-fix.patch   |   33 ++++++++++
>  .../0004-replace-index-with-strchr.patch           |   34 ++++++++++
>  ...place-mkostmps-with-more-portable-mkstemp.patch |   64 
> ++++++++++++++++++++
>  .../0006-partx-lsblk-fix-gettext-calls.patch       |   41 +++++++++++++
>  patches/util-linux-2.19/series                     |    5 ++
>  7 files changed, 242 insertions(+), 3 deletions(-)
>  create mode 100644 
> patches/util-linux-2.19/0002-__progname-redefinition-fix.patch
>  create mode 100644 patches/util-linux-2.19/0003-_s-undeclared-fix.patch
>  create mode 100644 
> patches/util-linux-2.19/0004-replace-index-with-strchr.patch
>  create mode 100644 
> patches/util-linux-2.19/0005-libmount-replace-mkostmps-with-more-portable-mkstemp.patch
>  create mode 100644 
> patches/util-linux-2.19/0006-partx-lsblk-fix-gettext-calls.patch
> 
> diff --git 
> a/patches/util-linux-2.19/0001-libmount-add-fallbacks-for-old-systems-without-umoun.patch
>  
> b/patches/util-linux-2.19/0001-libmount-add-fallbacks-for-old-systems-without-umoun.patch
> index c7299f3..b940aa1 100644
> --- 
> a/patches/util-linux-2.19/0001-libmount-add-fallbacks-for-old-systems-without-umoun.patch
> +++ 
> b/patches/util-linux-2.19/0001-libmount-add-fallbacks-for-old-systems-without-umoun.patch
> @@ -1,7 +1,7 @@
> -From db9bd703a9a696bd73cb7d41e98c66854a604477 Mon Sep 17 00:00:00 2001
> +From 1f2c7532788626e668f02a5783388839e1ea97d6 Mon Sep 17 00:00:00 2001
>  From: Karel Zak <[email protected]>
>  Date: Fri, 11 Feb 2011 10:45:09 +0100
> -Subject: [PATCH] libmount: add fallbacks for old systems without umount2() 
> syscall
> +Subject: [PATCH 1/5] libmount: add fallbacks for old systems without 
> umount2() syscall
>  

Don't change this patch. And use 'git format-patch -N' to avoid x/y in the
subject. It doesn't match anyways.

>  Reported-by: Peter Breitenlohner <[email protected]>
>  Signed-off-by: Karel Zak <[email protected]>
> @@ -49,5 +49,5 @@ index bd9be69..1187a87 100644
>   {
>       int rc;
>  -- 
> -1.7.2.3
> +1.7.0.4
>  
> diff --git a/patches/util-linux-2.19/0002-__progname-redefinition-fix.patch 
> b/patches/util-linux-2.19/0002-__progname-redefinition-fix.patch
> new file mode 100644
> index 0000000..a7d94ca
> --- /dev/null
> +++ b/patches/util-linux-2.19/0002-__progname-redefinition-fix.patch
> @@ -0,0 +1,62 @@
> +From 21cabd759536fedbaaa30325413d1207a5b3c5bc Mon Sep 17 00:00:00 2001
> +From: Jon Ringle <[email protected]>
> +Date: Thu, 21 Apr 2011 17:08:15 -0400
> +Subject: [PATCH 2/5] __progname redefinition fix
> +
> +Problem occurs with uclibc errno.h header
> +
> +In file included from ../include/writeall.h:7,
> +                 from swaplabel.c:35:
> +/opt/crosstool-ng-1.9.0/arm-1136j-linux-uclibcgnueabi/gcc-4.4.5-uClibc-0.9.30.2-binutils-2.20.1-kernel-2.6.32.25-sanitized/arm-1136j-linux-uclibcgnueabi//sys-root/usr/include/errno.h:55:
>  error: conflicting types for '__progname'
> +../include/c.h:118: note: previous declaration of '__progname' was here
> +
> +Signed-off-by: Jon Ringle <[email protected]>
> +---
> + disk-utils/swaplabel.c   |    2 +-
> + lib/tt.c                 |    1 +
> + shlibs/mount/src/cache.c |    2 +-
> + 3 files changed, 3 insertions(+), 2 deletions(-)
> +
> +diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c
> +index 9dc20b4..28990a7 100644
> +--- a/disk-utils/swaplabel.c
> ++++ b/disk-utils/swaplabel.c
> +@@ -30,8 +30,8 @@
> + # endif
> + #endif
> + 
> +-#include "c.h"
> + #include "writeall.h"
> ++#include "c.h"
> + #include "swapheader.h"
> + #include "strutils.h"
> + #include "nls.h"
> +diff --git a/lib/tt.c b/lib/tt.c
> +index 3bcdea9..198210c 100644
> +--- a/lib/tt.c
> ++++ b/lib/tt.c
> +@@ -15,6 +15,7 @@
> + #include <unistd.h>
> + #include <string.h>
> + #include <termios.h>
> ++#include <errno.h>
> + #ifdef HAVE_SYS_IOCTL_H
> + #include <sys/ioctl.h>
> + #endif
> +diff --git a/shlibs/mount/src/cache.c b/shlibs/mount/src/cache.c
> +index e0641c1..40613e2 100644
> +--- a/shlibs/mount/src/cache.c
> ++++ b/shlibs/mount/src/cache.c
> +@@ -25,8 +25,8 @@
> + #include <fcntl.h>
> + #include <blkid.h>
> + 
> +-#include "canonicalize.h"
> + #include "mountP.h"
> ++#include "canonicalize.h"
> + 
> + /*
> +  * Canonicalized (resolved) paths & tags cache
> +-- 
> +1.7.0.4
> +
> diff --git a/patches/util-linux-2.19/0003-_s-undeclared-fix.patch 
> b/patches/util-linux-2.19/0003-_s-undeclared-fix.patch
> new file mode 100644
> index 0000000..be2107f
> --- /dev/null
> +++ b/patches/util-linux-2.19/0003-_s-undeclared-fix.patch
> @@ -0,0 +1,33 @@
> +From 23991bdda679b9b19d15d174cfd8b9380e7bfadc Mon Sep 17 00:00:00 2001
> +From: Jon Ringle <[email protected]>
> +Date: Thu, 21 Apr 2011 17:44:28 -0400
> +Subject: [PATCH 3/5] _s undeclared fix
> +
> +tt.c: In function 'recount_widths':
> +tt.c:398: error: '_s' undeclared (first use in this function)
> +tt.c:398: error: (Each undeclared identifier is reported only once
> +tt.c:398: error: for each function it appears in.)
> +tt.c: In function 'print_data':
> +tt.c:508: error: '_s' undeclared (first use in this function)
> +
> +Signed-off-by: Jon Ringle <[email protected]>
> +---
> + lib/tt.c |    2 +-
> + 1 files changed, 1 insertions(+), 1 deletions(-)
> +
> +diff --git a/lib/tt.c b/lib/tt.c
> +index 198210c..328b9d7 100644
> +--- a/lib/tt.c
> ++++ b/lib/tt.c
> +@@ -52,7 +52,7 @@ static const struct tt_symbols utf8_tt_symbols = {
> + };
> + 
> + #else /* !HAVE_WIDECHAR */
> +-# define mbs_width       strlen(_s)
> ++# define mbs_width(_s)       strlen(_s)
> + #endif /* !HAVE_WIDECHAR */
> + 
> + #define is_last_column(_tb, _cl) \
> +-- 
> +1.7.0.4
> +
> diff --git a/patches/util-linux-2.19/0004-replace-index-with-strchr.patch 
> b/patches/util-linux-2.19/0004-replace-index-with-strchr.patch
> new file mode 100644
> index 0000000..cf99e38
> --- /dev/null
> +++ b/patches/util-linux-2.19/0004-replace-index-with-strchr.patch
> @@ -0,0 +1,34 @@
> +From 8ef75a689d2e260788ebc5f63cf0fb966aae4ec9 Mon Sep 17 00:00:00 2001
> +From: Jon Ringle <[email protected]>
> +Date: Tue, 26 Apr 2011 02:15:50 -0400
> +Subject: [PATCH 4/5] replace index with strchr
> +

add a comment (see my other mails).

> +Signed-off-by: Jon Ringle <[email protected]>
> +---
> + shlibs/mount/src/tab_parse.c |    4 ++--
> + 1 files changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/shlibs/mount/src/tab_parse.c b/shlibs/mount/src/tab_parse.c
> +index 4eb32eb..a2cd30f 100644
> +--- a/shlibs/mount/src/tab_parse.c
> ++++ b/shlibs/mount/src/tab_parse.c
> +@@ -272,14 +272,14 @@ static int mnt_table_parse_next(struct libmnt_table 
> *tb, FILE *f, struct libmnt_
> +             if (fgets(buf, sizeof(buf), f) == NULL)
> +                     return -EINVAL;
> +             ++*nlines;
> +-            s = index (buf, '\n');
> ++            s = strchr (buf, '\n');
> +             if (!s) {
> +                     /* Missing final newline?  Otherwise extremely */
> +                     /* long line - assume file was corrupted */
> +                     if (feof(f)) {
> +                             DBG(TAB, mnt_debug_h(tb,
> +                                     "%s: no final newline", filename));
> +-                            s = index (buf, '\0');
> ++                            s = strchr (buf, '\0');
> +                     } else {
> +                             DBG(TAB, mnt_debug_h(tb,
> +                                     "%s:%d: missing newline at line",
> +-- 
> +1.7.0.4
> +
> diff --git 
> a/patches/util-linux-2.19/0005-libmount-replace-mkostmps-with-more-portable-mkstemp.patch
>  
> b/patches/util-linux-2.19/0005-libmount-replace-mkostmps-with-more-portable-mkstemp.patch
> new file mode 100644
> index 0000000..ae669bf
> --- /dev/null
> +++ 
> b/patches/util-linux-2.19/0005-libmount-replace-mkostmps-with-more-portable-mkstemp.patch
> @@ -0,0 +1,64 @@
> +From 4b6cf4859a0798eef6f59933101f08f950a0aa9b Mon Sep 17 00:00:00 2001
> +From: Karel Zak <[email protected]>
> +Date: Fri, 11 Feb 2011 10:18:00 +0100
> +Subject: [PATCH] libmount: replace mkostmps() with more portable mkstemp()
> +
> +Reported-by: Peter Breitenlohner <[email protected]>
> +Signed-off-by: Karel Zak <[email protected]>
> +---
> + shlibs/mount/src/mountP.h     |    2 +-
> + shlibs/mount/src/tab_update.c |    2 +-
> + shlibs/mount/src/utils.c      |    4 ++--
> + 3 files changed, 4 insertions(+), 4 deletions(-)
> +
> +diff --git a/shlibs/mount/src/mountP.h b/shlibs/mount/src/mountP.h
> +index aeceb7f..71314a5 100644
> +--- a/shlibs/mount/src/mountP.h
> ++++ b/shlibs/mount/src/mountP.h
> +@@ -118,7 +118,7 @@ extern int mnt_in_group(gid_t gid);
> + 
> + extern char *mnt_get_mountpoint(const char *path);
> + extern char *mnt_get_fs_root(const char *path, const char *mountpoint);
> +-extern int mnt_open_uniq_filename(const char *filename, char **name, int 
> flags);
> ++extern int mnt_open_uniq_filename(const char *filename, char **name);
> + extern int mnt_has_regular_utab(const char **utab, int *writable);
> + extern const char *mnt_get_utab_path(void);
> + 
> +diff --git a/shlibs/mount/src/tab_update.c b/shlibs/mount/src/tab_update.c
> +index a0f99f1..6b7b4be 100644
> +--- a/shlibs/mount/src/tab_update.c
> ++++ b/shlibs/mount/src/tab_update.c
> +@@ -561,7 +561,7 @@ static int update_table(struct libmnt_update *upd, 
> struct libmnt_table *tb)
> + 
> +     DBG(UPDATE, mnt_debug_h(upd, "%s: updating", upd->filename));
> + 
> +-    fd = mnt_open_uniq_filename(upd->filename, &uq, O_WRONLY);
> ++    fd = mnt_open_uniq_filename(upd->filename, &uq);
> +     if (fd < 0)
> +             return fd;      /* error */
> + 
> +diff --git a/shlibs/mount/src/utils.c b/shlibs/mount/src/utils.c
> +index cb0ed1c..b02b6fe 100644
> +--- a/shlibs/mount/src/utils.c
> ++++ b/shlibs/mount/src/utils.c
> +@@ -642,7 +642,7 @@ const char *mnt_get_utab_path(void)
> + 
> + /* returns file descriptor or -errno, @name returns uniques filename
> +  */
> +-int mnt_open_uniq_filename(const char *filename, char **name, int flags)
> ++int mnt_open_uniq_filename(const char *filename, char **name)
> + {
> +     int rc, fd;
> +     char *n;
> +@@ -656,7 +656,7 @@ int mnt_open_uniq_filename(const char *filename, char 
> **name, int flags)
> +     if (rc <= 0)
> +             return -errno;
> + 
> +-    fd = mkostemp(n, flags | O_EXCL);
> ++    fd = mkstemp(n);

I'm not sure what the consequences of this are. Please keep the function
parameters, and maybe do something like this:

#ifdef <this-is-glibc>
        fd = mkostemp(n, flags | O_EXCL);
#else
        fd = mkstemp(n);
#endif

not sure what the correct macro would be.

> +     if (fd >= 0 && name)
> +             *name = n;
> +     else
> +-- 
> +1.7.0.4
> +
> diff --git a/patches/util-linux-2.19/0006-partx-lsblk-fix-gettext-calls.patch 
> b/patches/util-linux-2.19/0006-partx-lsblk-fix-gettext-calls.patch
> new file mode 100644
> index 0000000..2a86a48
> --- /dev/null
> +++ b/patches/util-linux-2.19/0006-partx-lsblk-fix-gettext-calls.patch
> @@ -0,0 +1,41 @@
> +From 0198bb456b9a35a8b973f2978883cadc443499a3 Mon Sep 17 00:00:00 2001
> +From: Karel Zak <[email protected]>
> +Date: Fri, 11 Feb 2011 09:06:27 +0100
> +Subject: [PATCH] partx, lsblk: fix gettext calls
> +

this is from upstream, right?

Michael

> +Reported-by: Peter Breitenlohner <[email protected]>
> +Signed-off-by: Karel Zak <[email protected]>
> +---
> + misc-utils/lsblk.c |    2 +-
> + partx/partx.c      |    2 +-
> + 2 files changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
> +index 44358fd..b07bfb4 100644
> +--- a/misc-utils/lsblk.c
> ++++ b/misc-utils/lsblk.c
> +@@ -871,7 +871,7 @@ static void __attribute__((__noreturn__)) help(FILE *out)
> +     fprintf(out, _("\nAvailable columns:\n"));
> + 
> +     for (i = 0; i < __NCOLUMNS; i++)
> +-            fprintf(out, " %10s  %s\n", infos[i].name, 
> gettext(infos[i].help));
> ++            fprintf(out, " %10s  %s\n", infos[i].name, _(infos[i].help));
> + 
> +     fprintf(out, _("\nFor more information see lsblk(8).\n"));
> + 
> +diff --git a/partx/partx.c b/partx/partx.c
> +index efb627f..a65586f 100644
> +--- a/partx/partx.c
> ++++ b/partx/partx.c
> +@@ -615,7 +615,7 @@ static void __attribute__((__noreturn__)) usage(FILE 
> *out)
> +     fprintf(out, _("\nAvailable columns (for --show):\n"));
> + 
> +     for (i = 0; i < __NCOLUMNS; i++)
> +-            fprintf(out, " %10s  %s\n", infos[i].name, 
> gettext(infos[i].help));
> ++            fprintf(out, " %10s  %s\n", infos[i].name, _(infos[i].help));
> + 
> +     fprintf(out, _("\nFor more information see partx(8).\n"));
> + 
> +-- 
> +1.7.0.4
> +
> diff --git a/patches/util-linux-2.19/series b/patches/util-linux-2.19/series
> index 7a6959d..157263d 100644
> --- a/patches/util-linux-2.19/series
> +++ b/patches/util-linux-2.19/series
> @@ -1 +1,6 @@
>  0001-libmount-add-fallbacks-for-old-systems-without-umoun.patch
> +0002-__progname-redefinition-fix.patch
> +0003-_s-undeclared-fix.patch
> +0004-replace-index-with-strchr.patch
> +0005-libmount-replace-mkostmps-with-more-portable-mkstemp.patch
> +0006-partx-lsblk-fix-gettext-calls.patch
> -- 
> 1.7.0.4
> 
> 
> -- 
> ptxdist mailing list
> [email protected]
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
[email protected]

Reply via email to