Re: [uclibc-ng-devel] [PATCH] package/util-linux: Fix libmount build under uClibc

Hi Waldemar, On Mon, 2016-05-30 at 14:12 +0300, Alexey Brodkin wrote:
Hello,
On Thu, 2016-05-26 at 14:55 +0300, Alexey Brodkin wrote:
Hello,
On Mon, 2016-05-23 at 17:46 +0300, Alexey Brodkin wrote:
This fixes util-linux building with uClibc. Patch is taken as it is from Buildroot: https://git.busybox.net/buildroot/plain/package/util-linux/0001-Fix-libmount... 6f ea bf114623866568121f49712f5df
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> --- .../004-Fix-libmount-build-under-uClibc.patch | 153 +++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 package/utils/util-linux/patches/004-Fix-libmount-build-under-uClibc.patch
We are discussing one issue with "util-linux" package building. The problem is in "util-linux" wants to use alloc modifier (either "%as" or "%ms") in scanf(). Looks like uClibc still doesn't support neither "%ms" nor "%as" (this one is obsolete glibc-specific so let's not bother with it anyways). Now to work-around this missing requirement we used to use an off-the-tree patch like this one in Buildroot: https://git.busybox.net/buildroot/tree/package/util-linux/0001-Fix-libmount-... OpenWRT: https://git.lede-project.org/?p=source.git;a=blob;f=package/utils/util-linux... 959bf0c8ce269e8039d4d05ef58e1d527;hb=8a7b28071fba84e297796c46d46e12b0967804e8 Gentoo: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/util-linux... ch?revision=1.2 The question to you is where do you think we should fix mentioned problem: 1) In uClibc-ng with addition of "%ms" support in scanf or 2) Try to upstream mentioned patch in "util-linux"? Regards, Alexey

Hi Alexey, Alexey Brodkin wrote,
Hi Waldemar,
On Mon, 2016-05-30 at 14:12 +0300, Alexey Brodkin wrote:
Hello,
On Thu, 2016-05-26 at 14:55 +0300, Alexey Brodkin wrote:
Hello,
On Mon, 2016-05-23 at 17:46 +0300, Alexey Brodkin wrote:
This fixes util-linux building with uClibc. Patch is taken as it is from Buildroot: https://git.busybox.net/buildroot/plain/package/util-linux/0001-Fix-libmount... 6f ea bf114623866568121f49712f5df
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> --- .../004-Fix-libmount-build-under-uClibc.patch | 153 +++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 package/utils/util-linux/patches/004-Fix-libmount-build-under-uClibc.patch
We are discussing one issue with "util-linux" package building. The problem is in "util-linux" wants to use alloc modifier (either "%as" or "%ms") in scanf().
Looks like uClibc still doesn't support neither "%ms" nor "%as" (this one is obsolete glibc-specific so let's not bother with it anyways).
Now to work-around this missing requirement we used to use an off-the-tree patch like this one in Buildroot: https://git.busybox.net/buildroot/tree/package/util-linux/0001-Fix-libmount-...
OpenWRT: https://git.lede-project.org/?p=source.git;a=blob;f=package/utils/util-linux... 959bf0c8ce269e8039d4d05ef58e1d527;hb=8a7b28071fba84e297796c46d46e12b0967804e8
Gentoo: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/util-linux... ch?revision=1.2
The question to you is where do you think we should fix mentioned problem: 1) In uClibc-ng with addition of "%ms" support in scanf or
I would prefer this solution. I have started reading the code, but I can't give you any guarantee when I can work on this. Do you have free resources to cook up a patch? :)
2) Try to upstream mentioned patch in "util-linux"?
best regards Waldemar

On 01/06/2016 19:28, Waldemar Brodkorb wrote:
The question to you is where do you think we should fix mentioned problem:
1) In uClibc-ng with addition of "%ms" support in scanf or I would prefer this solution. I have started reading the code, but I can't give you any guarantee when I can work on this. Do you have free resources to cook up a patch? :)
I agree that this needs to be fixed in uclibc John

Hi Waldemar, On Wed, 2016-06-01 at 19:28 +0200, Waldemar Brodkorb wrote:
Hi Alexey,
Alexey Brodkin wrote,
Hi Waldemar,
On Mon, 2016-05-30 at 14:12 +0300, Alexey Brodkin wrote:
Hello,
On Thu, 2016-05-26 at 14:55 +0300, Alexey Brodkin wrote:
Hello,
On Mon, 2016-05-23 at 17:46 +0300, Alexey Brodkin wrote:
This fixes util-linux building with uClibc. Patch is taken as it is from Buildroot: https://git.busybox.net/buildroot/plain/package/util-linux/0001-Fix-libmount... 506a 6f ea bf114623866568121f49712f5df
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> --- .../004-Fix-libmount-build-under-uClibc.patch | 153 +++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 package/utils/util-linux/patches/004-Fix-libmount-build-under-uClibc.patch
We are discussing one issue with "util-linux" package building. The problem is in "util-linux" wants to use alloc modifier (either "%as" or "%ms") in scanf().
Looks like uClibc still doesn't support neither "%ms" nor "%as" (this one is obsolete glibc-specific so let's not bother with it anyways).
Now to work-around this missing requirement we used to use an off-the-tree patch like this one in Buildroot: https://git.busybox.net/buildroot/tree/package/util-linux/0001-Fix-libmount-...
OpenWRT: https://git.lede-project.org/?p=source.git;a=blob;f=package/utils/util-linux... eef0 959bf0c8ce269e8039d4d05ef58e1d527;hb=8a7b28071fba84e297796c46d46e12b0967804e8
Gentoo: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/util-linux... .pat ch?revision=1.2
The question to you is where do you think we should fix mentioned problem: 1) In uClibc-ng with addition of "%ms" support in scanf or
I would prefer this solution. I have started reading the code, but I can't give you any guarantee when I can work on this. Do you have free resources to cook up a patch? :)
You mean if I'm up to implement this missing feature in uClibc? Well I'd like to but as well not sure if and when I have time for that :) For now we have a work-around with mentioned patches. So that's not a showstopper. -Alexey

On 02/06/2016 13:00, Alexey Brodkin wrote:
Hi Waldemar,
On Wed, 2016-06-01 at 19:28 +0200, Waldemar Brodkorb wrote:
Hi Alexey,
Alexey Brodkin wrote,
Hi Waldemar,
On Mon, 2016-05-30 at 14:12 +0300, Alexey Brodkin wrote:
Hello,
On Thu, 2016-05-26 at 14:55 +0300, Alexey Brodkin wrote:
Hello,
On Mon, 2016-05-23 at 17:46 +0300, Alexey Brodkin wrote:
This fixes util-linux building with uClibc. Patch is taken as it is from Buildroot: https://git.busybox.net/buildroot/plain/package/util-linux/0001-Fix-libmount... 506a 6f ea bf114623866568121f49712f5df
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> --- .../004-Fix-libmount-build-under-uClibc.patch | 153 +++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 package/utils/util-linux/patches/004-Fix-libmount-build-under-uClibc.patch
We are discussing one issue with "util-linux" package building. The problem is in "util-linux" wants to use alloc modifier (either "%as" or "%ms") in scanf().
Looks like uClibc still doesn't support neither "%ms" nor "%as" (this one is obsolete glibc-specific so let's not bother with it anyways).
Now to work-around this missing requirement we used to use an off-the-tree patch like this one in Buildroot: https://git.busybox.net/buildroot/tree/package/util-linux/0001-Fix-libmount-...
OpenWRT: https://git.lede-project.org/?p=source.git;a=blob;f=package/utils/util-linux... eef0 959bf0c8ce269e8039d4d05ef58e1d527;hb=8a7b28071fba84e297796c46d46e12b0967804e8
Gentoo: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/util-linux... .pat ch?revision=1.2
The question to you is where do you think we should fix mentioned problem: 1) In uClibc-ng with addition of "%ms" support in scanf or
I would prefer this solution. I have started reading the code, but I can't give you any guarantee when I can work on this. Do you have free resources to cook up a patch? :)
You mean if I'm up to implement this missing feature in uClibc? Well I'd like to but as well not sure if and when I have time for that :)
For now we have a work-around with mentioned patches. So that's not a showstopper.
-Alexey
well,t he requirement for keeping uclibc support in the tree is that people fix uclibc issues. so someone has to fix it. waldemar promised to address uclibc issues if we use his ng tree. John

Hi Alexey, On Wed, Jun 1, 2016 at 10:56 AM, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
We are discussing one issue with "util-linux" package building. The problem is in "util-linux" wants to use alloc modifier (either "%as" or "%ms") in scanf().
Looks like uClibc still doesn't support neither "%ms" nor "%as" (this one is obsolete glibc-specific so let's not bother with it anyways).
a while ago I touched %m support for %c and %[...] in uclibc (b2d27c71bd13820a4263fa7ebda4c1a4a95b501c), I've got an impression that %ms was working. I've expanded test/stdio/scanf_m.c a bit (attached) and it appears to work. So I'm curious, how the issue manifests itself. -- Thanks. -- Max

Hi, Max Filippov wrote,
Hi Alexey,
On Wed, Jun 1, 2016 at 10:56 AM, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
We are discussing one issue with "util-linux" package building. The problem is in "util-linux" wants to use alloc modifier (either "%as" or "%ms") in scanf().
Looks like uClibc still doesn't support neither "%ms" nor "%as" (this one is obsolete glibc-specific so let's not bother with it anyways).
a while ago I touched %m support for %c and %[...] in uclibc (b2d27c71bd13820a4263fa7ebda4c1a4a95b501c), I've got an impression that %ms was working. I've expanded test/stdio/scanf_m.c a bit (attached) and it appears to work. So I'm curious, how the issue manifests itself.
Thanks for the patch. Indeed I was wondering why I have no patch included in OpenADK. I am overriding the configure check: CONFIGURE_ENV+= have_scanf_alloc_modifier=yes \ scanf_cv_alloc_modifier=ms So either the autoconf check is faulty or uClibc-ng implementation is somehow not correct. We need to check the autoconf configure check. best regards Waldemar

On Thu, Jun 2, 2016 at 7:46 PM, Waldemar Brodkorb <wbx@uclibc-ng.org> wrote:
Hi, Max Filippov wrote,
Hi Alexey,
On Wed, Jun 1, 2016 at 10:56 AM, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
We are discussing one issue with "util-linux" package building. The problem is in "util-linux" wants to use alloc modifier (either "%as" or "%ms") in scanf().
Looks like uClibc still doesn't support neither "%ms" nor "%as" (this one is obsolete glibc-specific so let's not bother with it anyways).
a while ago I touched %m support for %c and %[...] in uclibc (b2d27c71bd13820a4263fa7ebda4c1a4a95b501c), I've got an impression that %ms was working. I've expanded test/stdio/scanf_m.c a bit (attached) and it appears to work. So I'm curious, how the issue manifests itself.
Thanks for the patch. Indeed I was wondering why I have no patch included in OpenADK. I am overriding the configure check: CONFIGURE_ENV+= have_scanf_alloc_modifier=yes \ scanf_cv_alloc_modifier=ms
So either the autoconf check is faulty or uClibc-ng implementation is somehow not correct.
We need to check the autoconf configure check.
The check looks like this: | #include <stdio.h> | #include <unistd.h> | | #ifdef __GLIBC__ | | #if !(__GLIBC_PREREQ(2, 7)) | #error %m is not available | #endif | | #elif defined(_POSIX_VERSION) | | #if _POSIX_VERSION < 200809L | #error %m is not available | #endif | | #else | #error Your C-library is not supported. | #endif And its result with uClibc-ng is the following: conftest.c:136:7: error: #error %m is not available #error %m is not available Because we have the following definition in features.h: /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ /* Don't do it, if you want to keep uClibc happy. */ #define __GLIBC__ 2 #define __GLIBC_MINOR__ 2 -- Thanks. -- Max

Hi Max, On Thu, 2016-06-02 at 19:31 +0300, Max Filippov wrote:
Hi Alexey,
On Wed, Jun 1, 2016 at 10:56 AM, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
We are discussing one issue with "util-linux" package building. The problem is in "util-linux" wants to use alloc modifier (either "%as" or "%ms") in scanf().
Looks like uClibc still doesn't support neither "%ms" nor "%as" (this one is obsolete glibc-specific so let's not bother with it anyways).
a while ago I touched %m support for %c and %[...] in uclibc (b2d27c71bd13820a4263fa7ebda4c1a4a95b501c), I've got an impression that %ms was working. I've expanded test/stdio/scanf_m.c a bit (attached) and it appears to work. So I'm curious, how the issue manifests itself.
During configuration of "util-linux" it tests if "%as" or "ms" could be used when compiling a simple test. If not then "libmount" gets disabled. Then in OpenWRT/Lede on installation of "util-linux" to staging folder explicit "cp" is executed for copying some of "libmount" build artifacts and since "libmount" was never built "cp" fails and so entire build stops. -Alexey

Hi Max, Max Filippov wrote,
Hi Alexey,
On Wed, Jun 1, 2016 at 10:56 AM, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
We are discussing one issue with "util-linux" package building. The problem is in "util-linux" wants to use alloc modifier (either "%as" or "%ms") in scanf().
Looks like uClibc still doesn't support neither "%ms" nor "%as" (this one is obsolete glibc-specific so let's not bother with it anyways).
a while ago I touched %m support for %c and %[...] in uclibc (b2d27c71bd13820a4263fa7ebda4c1a4a95b501c), I've got an impression that %ms was working. I've expanded test/stdio/scanf_m.c a bit (attached) and it appears to work. So I'm curious, how the issue manifests itself.
-- Thanks. -- Max
From a018296d1908ad02f942cab0559a24ed3dd261e8 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Thu, 2 Jun 2016 18:24:28 +0300 Subject: [PATCH] tests: add %ms scanf format test
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Thanks, Applied and pushed Waldemar
participants (4)
-
Alexey Brodkin
-
John Crispin
-
Max Filippov
-
Waldemar Brodkorb