diff mbox series

[RFC,2/3] kbd: Disable 64 bit time with 32 bit glibc

Message ID 20221108000828.42824-2-niko.mauno@vaisala.com
State New
Headers show
Series [RFC,1/3] Try to ensure 64 bit time on 32 bit glibcful hosts | expand

Commit Message

Niko Mauno Nov. 8, 2022, 12:08 a.m. UTC
For now add exemption in order to avoid following failure during
do_compile()

  | .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2: syntax error in VERSION script
  | collect2: error: ld returned 1 exit status

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 meta/recipes-core/kbd/kbd_2.5.1.bb | 3 +++
 1 file changed, 3 insertions(+)

Comments

Alexander Kanavin Nov. 8, 2022, 9:14 a.m. UTC | #1
We do build for 32 bit arm targets, so is this seen only in specific
circumstances? What are they?

Alex

On Tue, 8 Nov 2022 at 01:09, Niko Mauno via lists.openembedded.org
<niko.mauno=vaisala.com@lists.openembedded.org> wrote:
>
> For now add exemption in order to avoid following failure during
> do_compile()
>
>   | .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2: syntax error in VERSION script
>   | collect2: error: ld returned 1 exit status
>
> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
> ---
>  meta/recipes-core/kbd/kbd_2.5.1.bb | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb b/meta/recipes-core/kbd/kbd_2.5.1.bb
> index aa3ab6e121..b623aecd36 100644
> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
> @@ -18,6 +18,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
>
>  SRC_URI[sha256sum] = "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
>
> +# Compiling 64 bit time for 32 bit host is broken
> +GLIBC_64BIT_TIME_CPPFLAGS = ""
> +
>  PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
>                    "
>
> --
> 2.36.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#172940): https://lists.openembedded.org/g/openembedded-core/message/172940
> Mute This Topic: https://lists.openembedded.org/mt/94880633/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Niko Mauno Nov. 8, 2022, 11:48 a.m. UTC | #2
I have not studied the issue, but in order to reproduce this error I add 
'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against 
current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64 
-D_FILE_OFFSET_BITS=64".

-Niko

On 8.11.2022 11.14, Alexander Kanavin wrote:
> We do build for 32 bit arm targets, so is this seen only in specific
> circumstances? What are they?
> 
> Alex
> 
> On Tue, 8 Nov 2022 at 01:09, Niko Mauno via lists.openembedded.org
> <niko.mauno=vaisala.com@lists.openembedded.org> wrote:
>>
>> For now add exemption in order to avoid following failure during
>> do_compile()
>>
>>    | .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2: syntax error in VERSION script
>>    | collect2: error: ld returned 1 exit status
>>
>> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
>> ---
>>   meta/recipes-core/kbd/kbd_2.5.1.bb | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb b/meta/recipes-core/kbd/kbd_2.5.1.bb
>> index aa3ab6e121..b623aecd36 100644
>> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
>> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
>> @@ -18,6 +18,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
>>
>>   SRC_URI[sha256sum] = "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
>>
>> +# Compiling 64 bit time for 32 bit host is broken
>> +GLIBC_64BIT_TIME_CPPFLAGS = ""
>> +
>>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
>>                     "
>>
>> --
>> 2.36.1
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#172940): https://lists.openembedded.org/g/openembedded-core/message/172940
>> Mute This Topic: https://lists.openembedded.org/mt/94880633/1686489
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
Alexander Kanavin Nov. 8, 2022, 11:50 a.m. UTC | #3
So you need to set -D_TIME_BITS=64
-D_FILE_OFFSET_BITS=64 to get some error? But why set that, shouldn’t the
defaults work?

Alex

On Tue 8. Nov 2022 at 12.48, Niko Mauno <niko.mauno@vaisala.com> wrote:

> I have not studied the issue, but in order to reproduce this error I add
> 'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against
> current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64
> -D_FILE_OFFSET_BITS=64".
>
> -Niko
>
> On 8.11.2022 11.14, Alexander Kanavin wrote:
> > We do build for 32 bit arm targets, so is this seen only in specific
> > circumstances? What are they?
> >
> > Alex
> >
> > On Tue, 8 Nov 2022 at 01:09, Niko Mauno via lists.openembedded.org
> > <niko.mauno=vaisala.com@lists.openembedded.org> wrote:
> >>
> >> For now add exemption in order to avoid following failure during
> >> do_compile()
> >>
> >>    |
> .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2:
> syntax error in VERSION script
> >>    | collect2: error: ld returned 1 exit status
> >>
> >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
> >> ---
> >>   meta/recipes-core/kbd/kbd_2.5.1.bb | 3 +++
> >>   1 file changed, 3 insertions(+)
> >>
> >> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb
> b/meta/recipes-core/kbd/kbd_2.5.1.bb
> >> index aa3ab6e121..b623aecd36 100644
> >> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
> >> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
> >> @@ -18,6 +18,9 @@ SRC_URI =
> "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
> >>
> >>   SRC_URI[sha256sum] =
> "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
> >>
> >> +# Compiling 64 bit time for 32 bit host is broken
> >> +GLIBC_64BIT_TIME_CPPFLAGS = ""
> >> +
> >>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
> >>                     "
> >>
> >> --
> >> 2.36.1
> >>
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#172940):
> https://lists.openembedded.org/g/openembedded-core/message/172940
> >> Mute This Topic: https://lists.openembedded.org/mt/94880633/1686489
> >> Group Owner: openembedded-core+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
>
Niko Mauno Nov. 8, 2022, 12:04 p.m. UTC | #4
My understanding wrt. Y2038 and 32-bit glibc hosts was such that it 
makes sense to set said compiler flags globally to ensure user space 
wide Y2038 compliance. So I encountered this compiler error while 
building poky reference images with additional effective

   TARGET_CPPFLAGS += "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"

declaration in meta/conf/distro/include/tclibc-glibc.inc.

-Niko

On 8.11.2022 13.50, Alexander Kanavin wrote:
> So you need to set -D_TIME_BITS=64
> -D_FILE_OFFSET_BITS=64 to get some error? But why set that, shouldn’t 
> the defaults work?
> 
> Alex
> 
> On Tue 8. Nov 2022 at 12.48, Niko Mauno <niko.mauno@vaisala.com 
> <mailto:niko.mauno@vaisala.com>> wrote:
> 
>     I have not studied the issue, but in order to reproduce this error I
>     add
>     'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against
>     current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64
>     -D_FILE_OFFSET_BITS=64".
> 
>     -Niko
> 
>     On 8.11.2022 11.14, Alexander Kanavin wrote:
>      > We do build for 32 bit arm targets, so is this seen only in specific
>      > circumstances? What are they?
>      >
>      > Alex
>      >
>      > On Tue, 8 Nov 2022 at 01:09, Niko Mauno via
>     lists.openembedded.org
>     <http://lists.openembedded.org/
>      > <niko.mauno=vaisala.com@lists.openembedded.org
>     <mailto:vaisala.com@lists.openembedded.org>> wrote:
>      >>
>      >> For now add exemption in order to avoid following failure during
>      >> do_compile()
>      >>
>      >>    |
>     .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2: syntax error in VERSION script
>      >>    | collect2: error: ld returned 1 exit status
>      >>
>      >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com
>     <mailto:niko.mauno@vaisala.com>>
>      >> ---
>      >>   meta/recipes-core/kbd/kbd_2.5.1.bb
>     <http://kbd_2.5.1.bb/
>      >>   1 file changed, 3 insertions(+)
>      >>
>      >> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb
>     <http://kbd_2.5.1.bb/
>      >> index aa3ab6e121..b623aecd36 100644
>      >> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
>     <http://kbd_2.5.1.bb/
>      >> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
>     <http://kbd_2.5.1.bb/
>      >> @@ -18,6 +18,9 @@ SRC_URI =
>     "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
>      >>
>      >>   SRC_URI[sha256sum] =
>     "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
>      >>
>      >> +# Compiling 64 bit time for 32 bit host is broken
>      >> +GLIBC_64BIT_TIME_CPPFLAGS = ""
>      >> +
>      >>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam',
>     d)} \
>      >>                     "
>      >>
>      >> --
>      >> 2.36.1
>      >>
>      >>
>      >> -=-=-=-=-=-=-=-=-=-=-=-
>      >> Links: You receive all messages sent to this group.
>      >> View/Reply Online (#172940):
>     https://lists.openembedded.org/g/openembedded-core/message/172940
>     <https://lists.openembedded.org/g/openembedded-core/message/172940
>      >> Mute This Topic:
>     https://lists.openembedded.org/mt/94880633/1686489
>     <https://lists.openembedded.org/mt/94880633/1686489
>      >> Group Owner: openembedded-core+owner@lists.openembedded.org
>     <mailto:openembedded-core%2Bowner@lists.openembedded.org>
>      >> Unsubscribe:
>     https://lists.openembedded.org/g/openembedded-core/unsub
>     <https://lists.openembedded.org/g/openembedded-core/unsub
>      >> -=-=-=-=-=-=-=-=-=-=-=-
>      >>
>
Alexander Kanavin Nov. 8, 2022, 12:18 p.m. UTC | #5
Is this a recommendation somewhere official?

Alex

On Tue 8. Nov 2022 at 13.04, Niko Mauno <niko.mauno@vaisala.com> wrote:

> My understanding wrt. Y2038 and 32-bit glibc hosts was such that it
> makes sense to set said compiler flags globally to ensure user space
> wide Y2038 compliance. So I encountered this compiler error while
> building poky reference images with additional effective
>
>    TARGET_CPPFLAGS += "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
>
> declaration in meta/conf/distro/include/tclibc-glibc.inc.
>
> -Niko
>
> On 8.11.2022 13.50, Alexander Kanavin wrote:
> > So you need to set -D_TIME_BITS=64
> > -D_FILE_OFFSET_BITS=64 to get some error? But why set that, shouldn’t
> > the defaults work?
> >
> > Alex
> >
> > On Tue 8. Nov 2022 at 12.48, Niko Mauno <niko.mauno@vaisala.com
> > <mailto:niko.mauno@vaisala.com>> wrote:
> >
> >     I have not studied the issue, but in order to reproduce this error I
> >     add
> >     'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against
> >     current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64
> >     -D_FILE_OFFSET_BITS=64".
> >
> >     -Niko
> >
> >     On 8.11.2022 11.14, Alexander Kanavin wrote:
> >      > We do build for 32 bit arm targets, so is this seen only in
> specific
> >      > circumstances? What are they?
> >      >
> >      > Alex
> >      >
> >      > On Tue, 8 Nov 2022 at 01:09, Niko Mauno via
> >     lists.openembedded.org
> >     <http://lists.openembedded.org/
> >      > <niko.mauno=vaisala.com@lists.openembedded.org
> >     <mailto:vaisala.com@lists.openembedded.org>> wrote:
> >      >>
> >      >> For now add exemption in order to avoid following failure during
> >      >> do_compile()
> >      >>
> >      >>    |
> >
>  .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2:
> syntax error in VERSION script
> >      >>    | collect2: error: ld returned 1 exit status
> >      >>
> >      >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com
> >     <mailto:niko.mauno@vaisala.com>>
> >      >> ---
> >      >>   meta/recipes-core/kbd/kbd_2.5.1.bb
> >     <http://kbd_2.5.1.bb/
> >      >>   1 file changed, 3 insertions(+)
> >      >>
> >      >> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb
> >     <http://kbd_2.5.1.bb/
> >      >> index aa3ab6e121..b623aecd36 100644
> >      >> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
> >     <http://kbd_2.5.1.bb/
> >      >> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
> >     <http://kbd_2.5.1.bb/
> >      >> @@ -18,6 +18,9 @@ SRC_URI =
> >     "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
> >      >>
> >      >>   SRC_URI[sha256sum] =
> >     "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
> >      >>
> >      >> +# Compiling 64 bit time for 32 bit host is broken
> >      >> +GLIBC_64BIT_TIME_CPPFLAGS = ""
> >      >> +
> >      >>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam',
> >     d)} \
> >      >>                     "
> >      >>
> >      >> --
> >      >> 2.36.1
> >      >>
> >      >>
> >      >> -=-=-=-=-=-=-=-=-=-=-=-
> >      >> Links: You receive all messages sent to this group.
> >      >> View/Reply Online (#172940):
> >     https://lists.openembedded.org/g/openembedded-core/message/172940
> >     <https://lists.openembedded.org/g/openembedded-core/message/172940
> >      >> Mute This Topic:
> >     https://lists.openembedded.org/mt/94880633/1686489
> >     <https://lists.openembedded.org/mt/94880633/1686489
> >      >> Group Owner: openembedded-core+owner@lists.openembedded.org
> >     <mailto:openembedded-core%2Bowner@lists.openembedded.org>
> >      >> Unsubscribe:
> >     https://lists.openembedded.org/g/openembedded-core/unsub
> >     <https://lists.openembedded.org/g/openembedded-core/unsub
> >      >> -=-=-=-=-=-=-=-=-=-=-=-
> >      >>
> >
>
Alexander Kanavin Nov. 8, 2022, 12:57 p.m. UTC | #6
I suppose what I want to say is - perhaps this should be discussed
with upstreams first? Things should 'just work' without having to set
some magic flags in an external configuration.

Alex

On Tue, 8 Nov 2022 at 13:18, Alexander Kanavin via
lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
wrote:
>
> Is this a recommendation somewhere official?
>
> Alex
>
> On Tue 8. Nov 2022 at 13.04, Niko Mauno <niko.mauno@vaisala.com> wrote:
>>
>> My understanding wrt. Y2038 and 32-bit glibc hosts was such that it
>> makes sense to set said compiler flags globally to ensure user space
>> wide Y2038 compliance. So I encountered this compiler error while
>> building poky reference images with additional effective
>>
>>    TARGET_CPPFLAGS += "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
>>
>> declaration in meta/conf/distro/include/tclibc-glibc.inc.
>>
>> -Niko
>>
>> On 8.11.2022 13.50, Alexander Kanavin wrote:
>> > So you need to set -D_TIME_BITS=64
>> > -D_FILE_OFFSET_BITS=64 to get some error? But why set that, shouldn’t
>> > the defaults work?
>> >
>> > Alex
>> >
>> > On Tue 8. Nov 2022 at 12.48, Niko Mauno <niko.mauno@vaisala.com
>> > <mailto:niko.mauno@vaisala.com>> wrote:
>> >
>> >     I have not studied the issue, but in order to reproduce this error I
>> >     add
>> >     'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against
>> >     current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64
>> >     -D_FILE_OFFSET_BITS=64".
>> >
>> >     -Niko
>> >
>> >     On 8.11.2022 11.14, Alexander Kanavin wrote:
>> >      > We do build for 32 bit arm targets, so is this seen only in specific
>> >      > circumstances? What are they?
>> >      >
>> >      > Alex
>> >      >
>> >      > On Tue, 8 Nov 2022 at 01:09, Niko Mauno via
>> >     lists.openembedded.org
>> >     <http://lists.openembedded.org/
>> >      > <niko.mauno=vaisala.com@lists.openembedded.org
>> >     <mailto:vaisala.com@lists.openembedded.org>> wrote:
>> >      >>
>> >      >> For now add exemption in order to avoid following failure during
>> >      >> do_compile()
>> >      >>
>> >      >>    |
>> >     .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2: syntax error in VERSION script
>> >      >>    | collect2: error: ld returned 1 exit status
>> >      >>
>> >      >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com
>> >     <mailto:niko.mauno@vaisala.com>>
>> >      >> ---
>> >      >>   meta/recipes-core/kbd/kbd_2.5.1.bb
>> >     <http://kbd_2.5.1.bb/
>> >      >>   1 file changed, 3 insertions(+)
>> >      >>
>> >      >> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb
>> >     <http://kbd_2.5.1.bb/
>> >      >> index aa3ab6e121..b623aecd36 100644
>> >      >> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
>> >     <http://kbd_2.5.1.bb/
>> >      >> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
>> >     <http://kbd_2.5.1.bb/
>> >      >> @@ -18,6 +18,9 @@ SRC_URI =
>> >     "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
>> >      >>
>> >      >>   SRC_URI[sha256sum] =
>> >     "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
>> >      >>
>> >      >> +# Compiling 64 bit time for 32 bit host is broken
>> >      >> +GLIBC_64BIT_TIME_CPPFLAGS = ""
>> >      >> +
>> >      >>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam',
>> >     d)} \
>> >      >>                     "
>> >      >>
>> >      >> --
>> >      >> 2.36.1
>> >      >>
>> >      >>
>> >      >>
>> >      >>
>> >
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#172964): https://lists.openembedded.org/g/openembedded-core/message/172964
> Mute This Topic: https://lists.openembedded.org/mt/94880633/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Ola x Nilsson Nov. 8, 2022, 2:56 p.m. UTC | #7
As far as I can tell from glibc's documentation, this is how you are
supposed to do it.  glibc chose to always support both 32 and 64 bit
APIs for time and file offset and make the normal int size the default.
musl chose to switch to 64bit altogether. 

https://www.gnu.org/software/libc/manual/html_node/64_002dbit-time-symbol-handling.html

/Ola

On Tue, Nov 08 2022, Alexander Kanavin wrote:

> I suppose what I want to say is - perhaps this should be discussed
> with upstreams first? Things should 'just work' without having to set
> some magic flags in an external configuration.
>
> Alex
>
> On Tue, 8 Nov 2022 at 13:18, Alexander Kanavin via
> lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
> wrote:
>>
>> Is this a recommendation somewhere official?
>>
>> Alex
>>
>> On Tue 8. Nov 2022 at 13.04, Niko Mauno <niko.mauno@vaisala.com> wrote:
>>>
>>> My understanding wrt. Y2038 and 32-bit glibc hosts was such that it
>>> makes sense to set said compiler flags globally to ensure user space
>>> wide Y2038 compliance. So I encountered this compiler error while
>>> building poky reference images with additional effective
>>>
>>>    TARGET_CPPFLAGS += "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
>>>
>>> declaration in meta/conf/distro/include/tclibc-glibc.inc.
>>>
>>> -Niko
>>>
>>> On 8.11.2022 13.50, Alexander Kanavin wrote:
>>> > So you need to set -D_TIME_BITS=64
>>> > -D_FILE_OFFSET_BITS=64 to get some error? But why set that, shouldn’t
>>> > the defaults work?
>>> >
>>> > Alex
>>> >
>>> > On Tue 8. Nov 2022 at 12.48, Niko Mauno <niko.mauno@vaisala.com
>>> > <mailto:niko.mauno@vaisala.com>> wrote:
>>> >
>>> >     I have not studied the issue, but in order to reproduce this error I
>>> >     add
>>> >     'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against
>>> >     current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64
>>> >     -D_FILE_OFFSET_BITS=64".
>>> >
>>> >     -Niko
>>> >
>>> >     On 8.11.2022 11.14, Alexander Kanavin wrote:
>>> >      > We do build for 32 bit arm targets, so is this seen only in specific
>>> >      > circumstances? What are they?
>>> >      >
>>> >      > Alex
>>> >      >
>>> >      > On Tue, 8 Nov 2022 at 01:09, Niko Mauno via
>>> >     lists.openembedded.org
>>> >     <http://lists.openembedded.org/
>>> >      > <niko.mauno=vaisala.com@lists.openembedded.org
>>> >     <mailto:vaisala.com@lists.openembedded.org>> wrote:
>>> >      >>
>>> >      >> For now add exemption in order to avoid following failure during
>>> >      >> do_compile()
>>> >      >>
>>> >      >>    |
>>> >     .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2:
>>> > syntax error in VERSION script
>>> >      >>    | collect2: error: ld returned 1 exit status
>>> >      >>
>>> >      >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com
>>> >     <mailto:niko.mauno@vaisala.com>>
>>> >      >> ---
>>> >      >>   meta/recipes-core/kbd/kbd_2.5.1.bb
>>> >     <http://kbd_2.5.1.bb/
>>> >      >>   1 file changed, 3 insertions(+)
>>> >      >>
>>> >      >> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb
>>> >     <http://kbd_2.5.1.bb/
>>> >      >> index aa3ab6e121..b623aecd36 100644
>>> >      >> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
>>> >     <http://kbd_2.5.1.bb/
>>> >      >> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
>>> >     <http://kbd_2.5.1.bb/
>>> >      >> @@ -18,6 +18,9 @@ SRC_URI =
>>> >     "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
>>> >      >>
>>> >      >>   SRC_URI[sha256sum] =
>>> >     "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
>>> >      >>
>>> >      >> +# Compiling 64 bit time for 32 bit host is broken
>>> >      >> +GLIBC_64BIT_TIME_CPPFLAGS = ""
>>> >      >> +
>>> >      >>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam',
>>> >     d)} \
>>> >      >>                     "
>>> >      >>
>>> >      >> --
>>> >      >> 2.36.1
>>> >      >>
>>> >      >>
>>> >      >>
>>> >      >>
>>> >
>>
>>
>> 
>>
> [4. ATT00001.txt --- text/plain; ATT00001.txt]...
Ola x Nilsson Nov. 8, 2022, 3 p.m. UTC | #8
Sorry, that link did not explain the -D_USE_TIME_BITS=64 flag.

I was sure I had read official docs of this somewhere but now I can only
find https://sourceware.org/glibc/wiki/Y2038ProofnessDesign#Detailed_implementation

/Ola

On Tue, Nov 08 2022, Ola x Nilsson wrote:

> As far as I can tell from glibc's documentation, this is how you are
> supposed to do it.  glibc chose to always support both 32 and 64 bit
> APIs for time and file offset and make the normal int size the default.
> musl chose to switch to 64bit altogether. 
>
> https://www.gnu.org/software/libc/manual/html_node/64_002dbit-time-symbol-handling.html
>
> /Ola
>
> On Tue, Nov 08 2022, Alexander Kanavin wrote:
>
>> I suppose what I want to say is - perhaps this should be discussed
>> with upstreams first? Things should 'just work' without having to set
>> some magic flags in an external configuration.
>>
>> Alex
>>
>> On Tue, 8 Nov 2022 at 13:18, Alexander Kanavin via
>> lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
>> wrote:
>>>
>>> Is this a recommendation somewhere official?
>>>
>>> Alex
>>>
>>> On Tue 8. Nov 2022 at 13.04, Niko Mauno <niko.mauno@vaisala.com> wrote:
>>>>
>>>> My understanding wrt. Y2038 and 32-bit glibc hosts was such that it
>>>> makes sense to set said compiler flags globally to ensure user space
>>>> wide Y2038 compliance. So I encountered this compiler error while
>>>> building poky reference images with additional effective
>>>>
>>>>    TARGET_CPPFLAGS += "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
>>>>
>>>> declaration in meta/conf/distro/include/tclibc-glibc.inc.
>>>>
>>>> -Niko
>>>>
>>>> On 8.11.2022 13.50, Alexander Kanavin wrote:
>>>> > So you need to set -D_TIME_BITS=64
>>>> > -D_FILE_OFFSET_BITS=64 to get some error? But why set that, shouldn’t
>>>> > the defaults work?
>>>> >
>>>> > Alex
>>>> >
>>>> > On Tue 8. Nov 2022 at 12.48, Niko Mauno <niko.mauno@vaisala.com
>>>> > <mailto:niko.mauno@vaisala.com>> wrote:
>>>> >
>>>> >     I have not studied the issue, but in order to reproduce this error I
>>>> >     add
>>>> >     'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against
>>>> >     current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64
>>>> >     -D_FILE_OFFSET_BITS=64".
>>>> >
>>>> >     -Niko
>>>> >
>>>> >     On 8.11.2022 11.14, Alexander Kanavin wrote:
>>>> >      > We do build for 32 bit arm targets, so is this seen only in specific
>>>> >      > circumstances? What are they?
>>>> >      >
>>>> >      > Alex
>>>> >      >
>>>> >      > On Tue, 8 Nov 2022 at 01:09, Niko Mauno via
>>>> >     lists.openembedded.org
>>>> >     <http://lists.openembedded.org/
>>>> >      > <niko.mauno=vaisala.com@lists.openembedded.org
>>>> >     <mailto:vaisala.com@lists.openembedded.org>> wrote:
>>>> >      >>
>>>> >      >> For now add exemption in order to avoid following failure during
>>>> >      >> do_compile()
>>>> >      >>
>>>> >      >>    |
>>>> >     .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2:
>>>> > syntax error in VERSION script
>>>> >      >>    | collect2: error: ld returned 1 exit status
>>>> >      >>
>>>> >      >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com
>>>> >     <mailto:niko.mauno@vaisala.com>>
>>>> >      >> ---
>>>> >      >>   meta/recipes-core/kbd/kbd_2.5.1.bb
>>>> >     <http://kbd_2.5.1.bb/
>>>> >      >>   1 file changed, 3 insertions(+)
>>>> >      >>
>>>> >      >> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb
>>>> >     <http://kbd_2.5.1.bb/
>>>> >      >> index aa3ab6e121..b623aecd36 100644
>>>> >      >> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
>>>> >     <http://kbd_2.5.1.bb/
>>>> >      >> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
>>>> >     <http://kbd_2.5.1.bb/
>>>> >      >> @@ -18,6 +18,9 @@ SRC_URI =
>>>> >     "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
>>>> >      >>
>>>> >      >>   SRC_URI[sha256sum] =
>>>> >     "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
>>>> >      >>
>>>> >      >> +# Compiling 64 bit time for 32 bit host is broken
>>>> >      >> +GLIBC_64BIT_TIME_CPPFLAGS = ""
>>>> >      >> +
>>>> >      >>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam',
>>>> >     d)} \
>>>> >      >>                     "
>>>> >      >>
>>>> >      >> --
>>>> >      >> 2.36.1
>>>> >      >>
>>>> >      >>
>>>> >      >>
>>>> >      >>
>>>> >
>>>
>>>
>>> 
>>>
>> [4. ATT00001.txt --- text/plain; ATT00001.txt]...
Khem Raj Nov. 8, 2022, 4:40 p.m. UTC | #9
On Tue, Nov 8, 2022 at 1:14 AM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> We do build for 32 bit arm targets, so is this seen only in specific
> circumstances? What are they?

Its when 64bit time_t is used with glibc on 32bit architectures. So
far we do not do that explicitly, with musl time_t is always 64bit

>
> Alex
>
> On Tue, 8 Nov 2022 at 01:09, Niko Mauno via lists.openembedded.org
> <niko.mauno=vaisala.com@lists.openembedded.org> wrote:
> >
> > For now add exemption in order to avoid following failure during
> > do_compile()
> >
> >   | .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2: syntax error in VERSION script
> >   | collect2: error: ld returned 1 exit status
> >
> > Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
> > ---
> >  meta/recipes-core/kbd/kbd_2.5.1.bb | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb b/meta/recipes-core/kbd/kbd_2.5.1.bb
> > index aa3ab6e121..b623aecd36 100644
> > --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
> > +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
> > @@ -18,6 +18,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
> >
> >  SRC_URI[sha256sum] = "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
> >
> > +# Compiling 64 bit time for 32 bit host is broken
> > +GLIBC_64BIT_TIME_CPPFLAGS = ""
> > +
> >  PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
> >                    "
> >
> > --
> > 2.36.1
> >
> >
> >
> >
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#172955): https://lists.openembedded.org/g/openembedded-core/message/172955
> Mute This Topic: https://lists.openembedded.org/mt/94880633/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alexander Kanavin Nov. 8, 2022, 4:45 p.m. UTC | #10
On Tue, 8 Nov 2022 at 17:40, Khem Raj <raj.khem@gmail.com> wrote:
>
> On Tue, Nov 8, 2022 at 1:14 AM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
> >
> > We do build for 32 bit arm targets, so is this seen only in specific
> > circumstances? What are they?
>
> Its when 64bit time_t is used with glibc on 32bit architectures. So
> far we do not do that explicitly, with musl time_t is always 64bit

But why do we even need to worry about this, and not just let glibc
sort it out and make the right default choices?

I also haven't yet seen the official guideline from upstream, just 'I
think this flag is the correct one to use' kind of reasoning.

Alex
Ola x Nilsson Nov. 8, 2022, 5:56 p.m. UTC | #11
And here is a link to the documentation for the _TIME_BITS Feature Test
Macro
https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#index-_005fTIME_005fBITS

The docs for _FILE_OFFSET_BITS is just above.

/Ola

On Tue, Nov 08 2022, Ola x Nilsson wrote:

> Sorry, that link did not explain the -D_USE_TIME_BITS=64 flag.
>
> I was sure I had read official docs of this somewhere but now I can only
> find https://sourceware.org/glibc/wiki/Y2038ProofnessDesign#Detailed_implementation
>
> /Ola
>
> On Tue, Nov 08 2022, Ola x Nilsson wrote:
>
>> As far as I can tell from glibc's documentation, this is how you are
>> supposed to do it.  glibc chose to always support both 32 and 64 bit
>> APIs for time and file offset and make the normal int size the default.
>> musl chose to switch to 64bit altogether. 
>>
>> https://www.gnu.org/software/libc/manual/html_node/64_002dbit-time-symbol-handling.html
>>
>> /Ola
>>
>> On Tue, Nov 08 2022, Alexander Kanavin wrote:
>>
>>> I suppose what I want to say is - perhaps this should be discussed
>>> with upstreams first? Things should 'just work' without having to set
>>> some magic flags in an external configuration.
>>>
>>> Alex
>>>
>>> On Tue, 8 Nov 2022 at 13:18, Alexander Kanavin via
>>> lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
>>> wrote:
>>>>
>>>> Is this a recommendation somewhere official?
>>>>
>>>> Alex
>>>>
>>>> On Tue 8. Nov 2022 at 13.04, Niko Mauno <niko.mauno@vaisala.com> wrote:
>>>>>
>>>>> My understanding wrt. Y2038 and 32-bit glibc hosts was such that it
>>>>> makes sense to set said compiler flags globally to ensure user space
>>>>> wide Y2038 compliance. So I encountered this compiler error while
>>>>> building poky reference images with additional effective
>>>>>
>>>>>    TARGET_CPPFLAGS += "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
>>>>>
>>>>> declaration in meta/conf/distro/include/tclibc-glibc.inc.
>>>>>
>>>>> -Niko
>>>>>
>>>>> On 8.11.2022 13.50, Alexander Kanavin wrote:
>>>>> > So you need to set -D_TIME_BITS=64
>>>>> > -D_FILE_OFFSET_BITS=64 to get some error? But why set that, shouldn’t
>>>>> > the defaults work?
>>>>> >
>>>>> > Alex
>>>>> >
>>>>> > On Tue 8. Nov 2022 at 12.48, Niko Mauno <niko.mauno@vaisala.com
>>>>> > <mailto:niko.mauno@vaisala.com>> wrote:
>>>>> >
>>>>> >     I have not studied the issue, but in order to reproduce this error I
>>>>> >     add
>>>>> >     'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against
>>>>> >     current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64
>>>>> >     -D_FILE_OFFSET_BITS=64".
>>>>> >
>>>>> >     -Niko
>>>>> >
>>>>> >     On 8.11.2022 11.14, Alexander Kanavin wrote:
>>>>> >      > We do build for 32 bit arm targets, so is this seen only in specific
>>>>> >      > circumstances? What are they?
>>>>> >      >
>>>>> >      > Alex
>>>>> >      >
>>>>> >      > On Tue, 8 Nov 2022 at 01:09, Niko Mauno via
>>>>> >     lists.openembedded.org
>>>>> >     <http://lists.openembedded.org/
>>>>> >      > <niko.mauno=vaisala.com@lists.openembedded.org
>>>>> >     <mailto:vaisala.com@lists.openembedded.org>> wrote:
>>>>> >      >>
>>>>> >      >> For now add exemption in order to avoid following failure during
>>>>> >      >> do_compile()
>>>>> >      >>
>>>>> >      >>    |
>>>>> >     .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2:
>>>>> > syntax error in VERSION script
>>>>> >      >>    | collect2: error: ld returned 1 exit status
>>>>> >      >>
>>>>> >      >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com
>>>>> >     <mailto:niko.mauno@vaisala.com>>
>>>>> >      >> ---
>>>>> >      >>   meta/recipes-core/kbd/kbd_2.5.1.bb
>>>>> >     <http://kbd_2.5.1.bb/
>>>>> >      >>   1 file changed, 3 insertions(+)
>>>>> >      >>
>>>>> >      >> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb
>>>>> >     <http://kbd_2.5.1.bb/
>>>>> >      >> index aa3ab6e121..b623aecd36 100644
>>>>> >      >> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
>>>>> >     <http://kbd_2.5.1.bb/
>>>>> >      >> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
>>>>> >     <http://kbd_2.5.1.bb/
>>>>> >      >> @@ -18,6 +18,9 @@ SRC_URI =
>>>>> >     "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
>>>>> >      >>
>>>>> >      >>   SRC_URI[sha256sum] =
>>>>> >     "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
>>>>> >      >>
>>>>> >      >> +# Compiling 64 bit time for 32 bit host is broken
>>>>> >      >> +GLIBC_64BIT_TIME_CPPFLAGS = ""
>>>>> >      >> +
>>>>> >      >>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam',
>>>>> >     d)} \
>>>>> >      >>                     "
>>>>> >      >>
>>>>> >      >> --
>>>>> >      >> 2.36.1
>>>>> >      >>
>>>>> >      >>
>>>>> >      >>
>>>>> >      >>
>>>>> >
>>>>
>>>>
>>>> 
>>>>
>>> [4. ATT00001.txt --- text/plain; ATT00001.txt]...
>
> [4. ATT00001.txt --- text/plain; ATT00001.txt]...
Alexander Kanavin Nov. 8, 2022, 6:38 p.m. UTC | #12
Thanks. But: face, meet palm.

"If _TIME_BITS is undefined, the bit size of time_t is architecture
dependent. Currently it defaults to 64 bits on most architectures.
Although it defaults to 32 bits on some traditional architectures
(i686, ARM), this is planned to change and applications should not
rely on this. "

No one needs to know or care about this, they should just set it to 64
for all targets, break all the badly written userspace and move on.

Anyway, rather than add exceptions all over the core layers, I'd
suggest that you set it to 64, 'bitbake world' with all of meta-oe,
then send fixes upstream for everything that breaks. Rinse, repeat.
Then when the 'planned to change' actually happens we should be ready
for it.

Alex




On Tue, 8 Nov 2022 at 18:58, Ola x Nilsson <ola.x.nilsson@axis.com> wrote:
>
>
> And here is a link to the documentation for the _TIME_BITS Feature Test
> Macro
> https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#index-_005fTIME_005fBITS
>
> The docs for _FILE_OFFSET_BITS is just above.
>
> /Ola
>
> On Tue, Nov 08 2022, Ola x Nilsson wrote:
>
> > Sorry, that link did not explain the -D_USE_TIME_BITS=64 flag.
> >
> > I was sure I had read official docs of this somewhere but now I can only
> > find https://sourceware.org/glibc/wiki/Y2038ProofnessDesign#Detailed_implementation
> >
> > /Ola
> >
> > On Tue, Nov 08 2022, Ola x Nilsson wrote:
> >
> >> As far as I can tell from glibc's documentation, this is how you are
> >> supposed to do it.  glibc chose to always support both 32 and 64 bit
> >> APIs for time and file offset and make the normal int size the default.
> >> musl chose to switch to 64bit altogether.
> >>
> >> https://www.gnu.org/software/libc/manual/html_node/64_002dbit-time-symbol-handling.html
> >>
> >> /Ola
> >>
> >> On Tue, Nov 08 2022, Alexander Kanavin wrote:
> >>
> >>> I suppose what I want to say is - perhaps this should be discussed
> >>> with upstreams first? Things should 'just work' without having to set
> >>> some magic flags in an external configuration.
> >>>
> >>> Alex
> >>>
> >>> On Tue, 8 Nov 2022 at 13:18, Alexander Kanavin via
> >>> lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
> >>> wrote:
> >>>>
> >>>> Is this a recommendation somewhere official?
> >>>>
> >>>> Alex
> >>>>
> >>>> On Tue 8. Nov 2022 at 13.04, Niko Mauno <niko.mauno@vaisala.com> wrote:
> >>>>>
> >>>>> My understanding wrt. Y2038 and 32-bit glibc hosts was such that it
> >>>>> makes sense to set said compiler flags globally to ensure user space
> >>>>> wide Y2038 compliance. So I encountered this compiler error while
> >>>>> building poky reference images with additional effective
> >>>>>
> >>>>>    TARGET_CPPFLAGS += "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
> >>>>>
> >>>>> declaration in meta/conf/distro/include/tclibc-glibc.inc.
> >>>>>
> >>>>> -Niko
> >>>>>
> >>>>> On 8.11.2022 13.50, Alexander Kanavin wrote:
> >>>>> > So you need to set -D_TIME_BITS=64
> >>>>> > -D_FILE_OFFSET_BITS=64 to get some error? But why set that, shouldn’t
> >>>>> > the defaults work?
> >>>>> >
> >>>>> > Alex
> >>>>> >
> >>>>> > On Tue 8. Nov 2022 at 12.48, Niko Mauno <niko.mauno@vaisala.com
> >>>>> > <mailto:niko.mauno@vaisala.com>> wrote:
> >>>>> >
> >>>>> >     I have not studied the issue, but in order to reproduce this error I
> >>>>> >     add
> >>>>> >     'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against
> >>>>> >     current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64
> >>>>> >     -D_FILE_OFFSET_BITS=64".
> >>>>> >
> >>>>> >     -Niko
> >>>>> >
> >>>>> >     On 8.11.2022 11.14, Alexander Kanavin wrote:
> >>>>> >      > We do build for 32 bit arm targets, so is this seen only in specific
> >>>>> >      > circumstances? What are they?
> >>>>> >      >
> >>>>> >      > Alex
> >>>>> >      >
> >>>>> >      > On Tue, 8 Nov 2022 at 01:09, Niko Mauno via
> >>>>> >     lists.openembedded.org
> >>>>> >     <http://lists.openembedded.org/
> >>>>> >      > <niko.mauno=vaisala.com@lists.openembedded.org
> >>>>> >     <mailto:vaisala.com@lists.openembedded.org>> wrote:
> >>>>> >      >>
> >>>>> >      >> For now add exemption in order to avoid following failure during
> >>>>> >      >> do_compile()
> >>>>> >      >>
> >>>>> >      >>    |
> >>>>> >     .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2:
> >>>>> > syntax error in VERSION script
> >>>>> >      >>    | collect2: error: ld returned 1 exit status
> >>>>> >      >>
> >>>>> >      >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com
> >>>>> >     <mailto:niko.mauno@vaisala.com>>
> >>>>> >      >> ---
> >>>>> >      >>   meta/recipes-core/kbd/kbd_2.5.1.bb
> >>>>> >     <http://kbd_2.5.1.bb/
> >>>>> >      >>   1 file changed, 3 insertions(+)
> >>>>> >      >>
> >>>>> >      >> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb
> >>>>> >     <http://kbd_2.5.1.bb/
> >>>>> >      >> index aa3ab6e121..b623aecd36 100644
> >>>>> >      >> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
> >>>>> >     <http://kbd_2.5.1.bb/
> >>>>> >      >> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
> >>>>> >     <http://kbd_2.5.1.bb/
> >>>>> >      >> @@ -18,6 +18,9 @@ SRC_URI =
> >>>>> >     "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
> >>>>> >      >>
> >>>>> >      >>   SRC_URI[sha256sum] =
> >>>>> >     "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
> >>>>> >      >>
> >>>>> >      >> +# Compiling 64 bit time for 32 bit host is broken
> >>>>> >      >> +GLIBC_64BIT_TIME_CPPFLAGS = ""
> >>>>> >      >> +
> >>>>> >      >>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam',
> >>>>> >     d)} \
> >>>>> >      >>                     "
> >>>>> >      >>
> >>>>> >      >> --
> >>>>> >      >> 2.36.1
> >>>>> >      >>
> >>>>> >      >>
> >>>>> >      >>
> >>>>> >      >>
> >>>>> >
> >>>>
> >>>>
> >>>>
> >>>>
> >>> [4. ATT00001.txt --- text/plain; ATT00001.txt]...
> >
> > [4. ATT00001.txt --- text/plain; ATT00001.txt]...
>
Ola x Nilsson Nov. 9, 2022, 7:44 a.m. UTC | #13
Doing the rince and repeat thing, yes.

Some of us may not have the luxury to wait for glibc to reach
'eventually'.  Whether OpenEmbedded should carry this option and how are
other discussions.  I'm open to carrying this as a plugin layer.

For what it's worth I would prefer if glibc at least had a configuration
option to force 64-bit only. 

/Ola

On Tue, Nov 08 2022, Alexander Kanavin wrote:

> Thanks. But: face, meet palm.
>
> "If _TIME_BITS is undefined, the bit size of time_t is architecture
> dependent. Currently it defaults to 64 bits on most architectures.
> Although it defaults to 32 bits on some traditional architectures
> (i686, ARM), this is planned to change and applications should not
> rely on this. "
>
> No one needs to know or care about this, they should just set it to 64
> for all targets, break all the badly written userspace and move on.
>
> Anyway, rather than add exceptions all over the core layers, I'd
> suggest that you set it to 64, 'bitbake world' with all of meta-oe,
> then send fixes upstream for everything that breaks. Rinse, repeat.
> Then when the 'planned to change' actually happens we should be ready
> for it.
>
> Alex
>
>
>
>
> On Tue, 8 Nov 2022 at 18:58, Ola x Nilsson <ola.x.nilsson@axis.com> wrote:
>>
>>
>> And here is a link to the documentation for the _TIME_BITS Feature Test
>> Macro
>> https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#index-_005fTIME_005fBITS
>>
>> The docs for _FILE_OFFSET_BITS is just above.
>>
>> /Ola
>>
>> On Tue, Nov 08 2022, Ola x Nilsson wrote:
>>
>> > Sorry, that link did not explain the -D_USE_TIME_BITS=64 flag.
>> >
>> > I was sure I had read official docs of this somewhere but now I can only
>> > find https://sourceware.org/glibc/wiki/Y2038ProofnessDesign#Detailed_implementation
>> >
>> > /Ola
>> >
>> > On Tue, Nov 08 2022, Ola x Nilsson wrote:
>> >
>> >> As far as I can tell from glibc's documentation, this is how you are
>> >> supposed to do it.  glibc chose to always support both 32 and 64 bit
>> >> APIs for time and file offset and make the normal int size the default.
>> >> musl chose to switch to 64bit altogether.
>> >>
>> >> https://www.gnu.org/software/libc/manual/html_node/64_002dbit-time-symbol-handling.html
>> >>
>> >> /Ola
>> >>
>> >> On Tue, Nov 08 2022, Alexander Kanavin wrote:
>> >>
>> >>> I suppose what I want to say is - perhaps this should be discussed
>> >>> with upstreams first? Things should 'just work' without having to set
>> >>> some magic flags in an external configuration.
>> >>>
>> >>> Alex
>> >>>
>> >>> On Tue, 8 Nov 2022 at 13:18, Alexander Kanavin via
>> >>> lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
>> >>> wrote:
>> >>>>
>> >>>> Is this a recommendation somewhere official?
>> >>>>
>> >>>> Alex
>> >>>>
>> >>>> On Tue 8. Nov 2022 at 13.04, Niko Mauno <niko.mauno@vaisala.com> wrote:
>> >>>>>
>> >>>>> My understanding wrt. Y2038 and 32-bit glibc hosts was such that it
>> >>>>> makes sense to set said compiler flags globally to ensure user space
>> >>>>> wide Y2038 compliance. So I encountered this compiler error while
>> >>>>> building poky reference images with additional effective
>> >>>>>
>> >>>>>    TARGET_CPPFLAGS += "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
>> >>>>>
>> >>>>> declaration in meta/conf/distro/include/tclibc-glibc.inc.
>> >>>>>
>> >>>>> -Niko
>> >>>>>
>> >>>>> On 8.11.2022 13.50, Alexander Kanavin wrote:
>> >>>>> > So you need to set -D_TIME_BITS=64
>> >>>>> > -D_FILE_OFFSET_BITS=64 to get some error? But why set that, shouldn’t
>> >>>>> > the defaults work?
>> >>>>> >
>> >>>>> > Alex
>> >>>>> >
>> >>>>> > On Tue 8. Nov 2022 at 12.48, Niko Mauno <niko.mauno@vaisala.com
>> >>>>> > <mailto:niko.mauno@vaisala.com>> wrote:
>> >>>>> >
>> >>>>> >     I have not studied the issue, but in order to reproduce this error I
>> >>>>> >     add
>> >>>>> >     'MACHINE = "qemuarm"' to local.conf then issue 'bitbake kbd' against
>> >>>>> >     current master while TARGET_CPPFLAGS value is set to "-D_TIME_BITS=64
>> >>>>> >     -D_FILE_OFFSET_BITS=64".
>> >>>>> >
>> >>>>> >     -Niko
>> >>>>> >
>> >>>>> >     On 8.11.2022 11.14, Alexander Kanavin wrote:
>> >>>>> >      > We do build for 32 bit arm targets, so is this seen only in specific
>> >>>>> >      > circumstances? What are they?
>> >>>>> >      >
>> >>>>> >      > Alex
>> >>>>> >      >
>> >>>>> >      > On Tue, 8 Nov 2022 at 01:09, Niko Mauno via
>> >>>>> >     lists.openembedded.org
>> >>>>> >     <http://lists.openembedded.org/
>> >>>>> >      > <niko.mauno=vaisala.com@lists.openembedded.org
>> >>>>> >     <mailto:vaisala.com@lists.openembedded.org>> wrote:
>> >>>>> >      >>
>> >>>>> >      >> For now add exemption in order to avoid following failure during
>> >>>>> >      >> do_compile()
>> >>>>> >      >>
>> >>>>> >      >>    |
>> >>>>> >     .../build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/12.2.0/ld:.libs/libtswrap.ver:2:
>> >>>>> > syntax error in VERSION script
>> >>>>> >      >>    | collect2: error: ld returned 1 exit status
>> >>>>> >      >>
>> >>>>> >      >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com
>> >>>>> >     <mailto:niko.mauno@vaisala.com>>
>> >>>>> >      >> ---
>> >>>>> >      >>   meta/recipes-core/kbd/kbd_2.5.1.bb
>> >>>>> >     <http://kbd_2.5.1.bb/
>> >>>>> >      >>   1 file changed, 3 insertions(+)
>> >>>>> >      >>
>> >>>>> >      >> diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb
>> >>>>> >     <http://kbd_2.5.1.bb/
>> >>>>> >      >> index aa3ab6e121..b623aecd36 100644
>> >>>>> >      >> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
>> >>>>> >     <http://kbd_2.5.1.bb/
>> >>>>> >      >> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
>> >>>>> >     <http://kbd_2.5.1.bb/
>> >>>>> >      >> @@ -18,6 +18,9 @@ SRC_URI =
>> >>>>> >     "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
>> >>>>> >      >>
>> >>>>> >      >>   SRC_URI[sha256sum] =
>> >>>>> >     "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
>> >>>>> >      >>
>> >>>>> >      >> +# Compiling 64 bit time for 32 bit host is broken
>> >>>>> >      >> +GLIBC_64BIT_TIME_CPPFLAGS = ""
>> >>>>> >      >> +
>> >>>>> >      >>   PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam',
>> >>>>> >     d)} \
>> >>>>> >      >>                     "
>> >>>>> >      >>
>> >>>>> >      >> --
>> >>>>> >      >> 2.36.1
>> >>>>> >      >>
>> >>>>> >      >>
>> >>>>> >      >>
>> >>>>> >      >>
>> >>>>> >
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>> [4. ATT00001.txt --- text/plain; ATT00001.txt]...
>> >
>> > [4. ATT00001.txt --- text/plain; ATT00001.txt]...
>>
Alexandre Belloni Nov. 9, 2022, 3:42 p.m. UTC | #14
On 08/11/2022 19:38:06+0100, Alexander Kanavin wrote:
> Thanks. But: face, meet palm.
> 
> "If _TIME_BITS is undefined, the bit size of time_t is architecture
> dependent. Currently it defaults to 64 bits on most architectures.
> Although it defaults to 32 bits on some traditional architectures
> (i686, ARM), this is planned to change and applications should not
> rely on this. "
> 
> No one needs to know or care about this, they should just set it to 64
> for all targets, break all the badly written userspace and move on.
> 

Note that this may build but not run properly as there is no way to know
whether userspace stores a time_t in an int at some point.

> Anyway, rather than add exceptions all over the core layers, I'd
> suggest that you set it to 64, 'bitbake world' with all of meta-oe,
> then send fixes upstream for everything that breaks. Rinse, repeat.
> Then when the 'planned to change' actually happens we should be ready
> for it.
> 

So we may not be ready unless the rinse/repeat also includes runtime
testing.

On Monday, I was suggesting to RP that we should probably have a poky
distro with _TIME_BITS set to 64 and run that on the autobuilders.
I don't think we can just add the flag and be done and this is a flag
day and may break existing users.
I'm usually getting customers to define their own distro and stop
depending on poky but it is not the case of everyone.
diff mbox series

Patch

diff --git a/meta/recipes-core/kbd/kbd_2.5.1.bb b/meta/recipes-core/kbd/kbd_2.5.1.bb
index aa3ab6e121..b623aecd36 100644
--- a/meta/recipes-core/kbd/kbd_2.5.1.bb
+++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
@@ -18,6 +18,9 @@  SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
 
 SRC_URI[sha256sum] = "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
 
+# Compiling 64 bit time for 32 bit host is broken
+GLIBC_64BIT_TIME_CPPFLAGS = ""
+
 PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
                   "