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

Max Filippov jcmvbkbc at gmail.com
Thu Jun 2 13:50:16 PDT 2016


On Thu, Jun 2, 2016 at 7:46 PM, Waldemar Brodkorb <wbx at uclibc-ng.org> wrote:
> Hi,
> Max Filippov wrote,
>
>> Hi Alexey,
>>
>> On Wed, Jun 1, 2016 at 10:56 AM, Alexey Brodkin
>> <Alexey.Brodkin at 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



More information about the Lede-dev mailing list