Bug 12711 - host-localedef 2.30-20 fails to compile on fedora 32 (gcc 10.0.1)
Summary: host-localedef 2.30-20 fails to compile on fedora 32 (gcc 10.0.1)
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2020.02
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-27 13:56 UTC by Dr I J Ormshaw
Modified: 2020-03-29 14:21 UTC (History)
2 users (show)

See Also:
Host: x86_64
Target: x86_64
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dr I J Ormshaw 2020-03-27 13:56:46 UTC
host-localedef 2.30-20 fails to compile on fedora 32 (gcc 10.0.1)

/home/ian/build/hiwire-linux-c38cdaa1-x86_64/buildroot/host/bin/ccache /usr/lib64/ccache/gcc programs/ld-ctype.c -c -std=gnu11 -fgnu89-inline  -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -Wstrict-prototypes -Wold-style-definition -fmath-errno          -I/home/ian/build/hiwire-linux-c38cdaa1-x86_64/buildroot/host/include -DCOMPLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"' -Iprograms -I../include -I/home/ian/build/hiwire-linux-c38cdaa1-x86_64/buildroot/build/host-localedef-2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/build/locale  -I/home/ian/build/hiwire-linux-c38cdaa1-x86_64/buildroot/build/host-localedef-2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/build  -I../sysdeps/unix/sysv/linux/x86_64/64  -I../sysdeps/unix/sysv/linux/x86_64  -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86  -I../sysdeps/x86/nptl  -I../sysdeps/unix/sysv/linux/wordsize-64  -I../sysdeps/x86_64/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/x86_64  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/x86_64/64  -I../sysdeps/x86_64/fpu/multiarch  -I../sysdeps/x86_64/fpu  -I../sysdeps/x86/fpu/include -I../sysdeps/x86/fpu  -I../sysdeps/x86_64/multiarch  -I../sysdeps/x86_64  -I../sysdeps/x86  -I../sysdeps/ieee754/float128  -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64/wordsize-64  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/wordsize-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.   -D_LIBC_REENTRANT -include /home/ian/build/hiwire-linux-c38cdaa1-x86_64/buildroot/build/host-localedef-2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/build/libc-modules.h -DMODULE_NAME=locale_programs -include ../include/libc-symbols.h   -DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"' -DCHARMAP_PATH='"/usr/share/i18n/charmaps"' -DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"' -DLOCSRCDIR='"/usr/share/i18n/locales"'    -DTOP_NAMESPACE=glibc -o /home/ian/build/hiwire-linux-c38cdaa1-x86_64/buildroot/build/host-localedef-2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/build/locale/ld-ctype.o -MD -MP -MF /home/ian/build/hiwire-linux-c38cdaa1-x86_64/buildroot/build/host-localedef-2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/build/locale/ld-ctype.o.dt -MT /home/ian/build/hiwire-linux-c38cdaa1-x86_64/buildroot/build/host-localedef-2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/build/locale/ld-ctype.o
programs/ld-ctype.c: In function ‘ctype_finish’:
programs/ld-ctype.c:855:18: error: array subscript 0 is outside the bounds of an interior zero-length array ‘unsigned char[0]’ [-Werror=zero-length-bounds]
  855 |  replace[0].bytes[0] = '?';
      |  ~~~~~~~~~~~~~~~~^~~
In file included from programs/repertoire.h:24,
                 from programs/localedef.h:32,
                 from programs/ld-ctype.c:35:
programs/charmap.h:63:17: note: while referencing ‘bytes’
   63 |   unsigned char bytes[0];
      |                 ^~~~~
programs/ld-ctype.c:856:18: error: array subscript 1 is outside the bounds of an interior zero-length array ‘unsigned char[0]’ [-Werror=zero-length-bounds]
  856 |  replace[0].bytes[1] = '\0';
      |  ~~~~~~~~~~~~~~~~^~~
In file included from programs/repertoire.h:24,
                 from programs/localedef.h:32,
                 from programs/ld-ctype.c:35:
programs/charmap.h:63:17: note: while referencing ‘bytes’
   63 |   unsigned char bytes[0];
      |                 ^~~~~
cc1: all warnings being treated as errors
Comment 1 Yann E. MORIN 2020-03-28 08:56:21 UTC
Ian, All,

You may want to backport this upstream commit:
https://sourceware.org/git/?p=glibc.git;a=commit;h=1471fa556afb428c4a4c46cf5543a4101d5bcf91

Care to test on your side, and then send us a patch?

Regards,
Yann E, MORIN.
Comment 2 Peter Seiderer 2020-03-28 22:09:36 UTC
Suggested patch available [1]...

[1] https://patchwork.ozlabs.org/patch/1263328
Comment 3 Yann E. MORIN 2020-03-29 14:21:06 UTC
Fixed with commit 13cc36dcfe from Peter, thanks.