Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1464747 > unrolled thread

Re: [PATCH tip/timers/core] uapi glibc compat: make linux/time.h compile after libc time.h files

Started byJohn Stultz <john.stultz@linaro.org>
First post2016-08-17 21:40 +0200
Last post2016-08-19 21:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH tip/timers/core] uapi glibc compat: make linux/time.h  compile after libc time.h files John Stultz <john.stultz@linaro.org> - 2016-08-17 21:40 +0200
    Re: [PATCH tip/timers/core] uapi glibc compat: make linux/time.h  compile after libc time.h files Willem de Bruijn <willemdebruijn.kernel@gmail.com> - 2016-08-19 21:00 +0200

#1464747 — Re: [PATCH tip/timers/core] uapi glibc compat: make linux/time.h compile after libc time.h files

FromJohn Stultz <john.stultz@linaro.org>
Date2016-08-17 21:40 +0200
SubjectRe: [PATCH tip/timers/core] uapi glibc compat: make linux/time.h compile after libc time.h files
Message-ID<s7eQV-5ow-15@gated-at.bofh.it>
On Wed, Aug 10, 2016 at 8:45 AM, Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
> From: Willem de Bruijn <willemb@google.com>
>
> Add libc-compat workaround for definitions in linux/time.h that
> duplicate those in libc time.h, sys/time.h and bits/time.h.
>
> With this change, userspace builds succeeds when linux/time.h is
> included after those libc files. The inverse requires changes to
> those userspace headers.
>
> Without this patch, when compiling the following program after
> make headers_install:
>
>   echo -e "#include <time.h>\n#include <linux/time.h>" | \
>         gcc -Wall -Werror -Iusr/include -c -xc -
>
> gcc gives these errors:
>
>   #include <time.h>
>   #include <linux/time.h>
>
>     In file included from ../test_time.c:3:0:
>     /usr/include/time.h:120:8: error: redefinition of ‘struct timespec’
>      struct timespec
>         ^
>     In file included from ../test_time.c:2:0:
>     ./usr/include/linux/time.h:9:8: note: originally defined here
>      struct timespec {
>         ^
>     In file included from ../test_time.c:3:0:
>     /usr/include/time.h:161:8: error: redefinition of ‘struct itimerspec’
>      struct itimerspec
>         ^
>     In file included from ../test_time.c:2:0:
>     ./usr/include/linux/time.h:34:8: note: originally defined here
>      struct itimerspec {
>
> and this warning by indirect inclusion of bits/time.h:
>
>     In file included from ../test_time.c:4:0:
>     ./usr/include/linux/time.h:67:0: error: "TIMER_ABSTIME" redefined [-Werror]
>      #define TIMER_ABSTIME   0x01
>      ^
>     In file included from /usr/include/time.h:41:0,
>                  from ../test_time.c:3:
>     /usr/include/x86_64-linux-gnu/bits/time.h:82:0: note: this is the location of the previous definition
>      #   define TIMER_ABSTIME  1
>      ^
>
> Ran the same program for sys/time.h and bits/time.h. The _SYS_TIME_H
> test resolves similar errors for timeval, timezone, itimerval and
> warnings for ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF.
>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
> ---
>  include/uapi/linux/libc-compat.h | 50 ++++++++++++++++++++++++++++++++++++++++
>  include/uapi/linux/time.h        | 15 ++++++++++++
>  2 files changed, 65 insertions(+)


So I don't have any objection to this. But I'm not sure if I'm the
right path for such a change to go through.

From the commit history, it seems David Miller or Andrew Morton would
be the right folks to take this.

thanks
-john

[toc] | [next] | [standalone]


#1466614

FromWillem de Bruijn <willemdebruijn.kernel@gmail.com>
Date2016-08-19 21:00 +0200
Message-ID<s7Xbj-Oz-5@gated-at.bofh.it>
In reply to#1464747
On Wed, Aug 17, 2016 at 3:33 PM, John Stultz <john.stultz@linaro.org> wrote:
> On Wed, Aug 10, 2016 at 8:45 AM, Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
>> From: Willem de Bruijn <willemb@google.com>
>>
>> Add libc-compat workaround for definitions in linux/time.h that
>> duplicate those in libc time.h, sys/time.h and bits/time.h.
>>
>> With this change, userspace builds succeeds when linux/time.h is
>> included after those libc files. The inverse requires changes to
>> those userspace headers.
>>
>> Without this patch, when compiling the following program after
>> make headers_install:
>>
>>   echo -e "#include <time.h>\n#include <linux/time.h>" | \
>>         gcc -Wall -Werror -Iusr/include -c -xc -
>>
>> gcc gives these errors:
>>
>>
>> Signed-off-by: Willem de Bruijn <willemb@google.com>
>> ---
>>  include/uapi/linux/libc-compat.h | 50 ++++++++++++++++++++++++++++++++++++++++
>>  include/uapi/linux/time.h        | 15 ++++++++++++
>>  2 files changed, 65 insertions(+)
>
>
> So I don't have any objection to this. But I'm not sure if I'm the
> right path for such a change to go through.
>
> From the commit history, it seems David Miller or Andrew Morton would
> be the right folks to take this.
>
> thanks
> -john

It is a prerequisite for including linux/time.h from
uapi/linux/errqueue.h, a network file

    https://lkml.org/lkml/2016/7/10/10

If making changes to these two files through net-next does not cause
conflicts with other branches, I can resend this patch to netdev.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web