[PATCH v1 00/35] Require GNU C --at least GCC 5 or Clang 4-- in headers
Alejandro Colomar
alx@kernel.org
Mon Nov 10 00:09:50 GMT 2025
Hi Bruno,
On Mon, Nov 10, 2025 at 01:03:06AM +0100, Bruno Haible wrote:
> There are three kinds of files in glibc, and accordingly three different
> requirements w.r.t. the C compiler:
>
> A) Header files that are installed as part of glibc under /usr/include.
> The file glibc/INSTALL says about these:
>
> You can use whatever compiler you like to compile programs that use
> the GNU C Library.
>
> "Whatever compiler" means any old version of GCC, any old version
> of clang, Intel icc, Tiny C, and many others. (Oracle Studio C does
> not work, but I blame it on that C compiler, not on glibc.)
>
> B) Source code of glibc itself, that is installed as binary code under
> /usr.
>
> The file glibc/INSTALL says about these:
>
> GCC 12.1 or higher is required.
>
> C) Source code that is shared with other GNU packages, most importantly
> GNU gnulib and GNU gettext.
>
> For GNU gnulib, the compiler requirements are described at
> https://www.gnu.org/software/gnulib/manual/html_node/Portability-guidelines.html
>
> For GNU gettext, any compiler from ca. 2005 or newer should be supported.
>
> Here's a table of distros and which GCC and clang versions they use.
> Just to give you an idea of the landscape.
>
> GCC
>
> 3.3.2 Fedora1
> 3.3.3 FreeBSD 5.2.1
> 4.1.2 CentOS 5
> 4.1.3 NetBSD 5
> 4.2.1 OpenBSD 6.0..6.9
> 4.4.7 CentOS 6
> 4.5.2 Slackware 13.37
> 4.6.2 openSUSE 12.1
> 4.7.1 Slackware 14
> 4.7.2 kFreeBSD 7
> 4.8.2 Ubuntu 14.04
> 4.8.5 CentOS 7, NetBSD 7
> 5.4.0 Ubuntu 16.04
> 5.5.0 NetBSD 8
> 6.3.0 Debian 9
> 7.3.0 ElementaryOS 5.0, Solaris 11.4
> 7.3.1 Fedora 27
> 7.4.0 NetBSD 9
> 7.5.0 Ubuntu 18.04
> 8.2.1 CentOS 8
> 8.3.0 Debian 10, Guix 1.0
> 8.5.0 CentOS 8 Stream
> 9.0.1 Fedora 30
> 9.2.0 Arch 19.11
> 9.2.1 Fedora 31
> 9.3.0 Guix 1.1
> 9.4.0 Ubuntu 20.04
> 10.2.1 Debian 11, Fedora 32, openSUSE 15.2
> 10.5.0 NetBSD 10
> 11.2.0 Slackware 15
> 11.4.0 Ubuntu 22.04
> 11.5.0 AlmaLinux 9, CentOS 9
> 12.2.0 Guix 1.4, Debian 12
> 12.2.1 openSUSE 15.5
> 12.3.1 Fedora 37
> 13.2.0 Ubuntu 24.04
> 13.2.1 Arch 24.04, Manjaro 23
> 14.0.1 Fedora 40
> 14.2.1 Fedora 41
> 15.0.1 Fedora 42
>
> clang
>
> 3.8.0 FreeBSD 11
> 4.0.0 OpenBSD 6.2
> 5.0.1 OpenBSD 6.3
> 6.0.1 FreeBSD 12
> 7.0.1 OpenBSD 6.5
> 8.0.1 OpenBSD 6.6, 6.7
> 10.0.1 OpenBSD 6.8, 6.9
> 11.0.1 FreeBSD 13
> 11.1.0 OpenBSD 7.0
> 13.0.0 OpenBSD 7.2..7.4
> 16.0.6 FreeBSD 14, OpenBSD 7.5..7.6
>
> Let me try to classify the source files that your patches touch.
>
> Category A:
> assert/assert.h
> bits/byteswap.h
> bits/socket.h
> bits/stdlib-bsearch.h
> ctype/ctype.h
> dlfcn/dlfcn.h
> inet/netinet/in.h
> libio/bits/stdio.h
> libio/stdio.h
> malloc/obstack.h
> math/complex.h
> math/math.h
> math/tgmath.h
> misc/sys/cdefs.h
> misc/sys/param.h
> misc/sys/select.h
> posix/bits/cpu-set.h
> posix/sys/types.h
> signal/signal.h
> socket/sys/socket.h
> stdlib/alloca.h
> stdlib/stdbit.h
> string/bits/string_fortified.h
> string/string.h
> string/strings.h
> sysdeps/alpha/bits/mathdef.h
> sysdeps/htl/pthread.h
> sysdeps/mach/hurd/bits/socket.h
> sysdeps/mach/hurd/x86/sys/io.h
> sysdeps/nptl/pthread.h
> sysdeps/powerpc/sys/platform/ppc.h
> sysdeps/sh/fpu_control.h
> sysdeps/unix/sysv/linux/bits/socket.h
> sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h
> sysdeps/unix/sysv/linux/s390/bits/typesizes.h
> sysdeps/unix/sysv/linux/sys/inotify.h
> sysdeps/unix/sysv/linux/x86/sys/io.h
> sysdeps/x86/bits/floatn.h
> sysdeps/x86/bits/link.h
> wcsmbs/wchar.h
>
> Category B:
> assert/tst-assert-c++.cc
> ctype/test_ctype.c
> elf/tst-stringtable.c
> include/alloca.h
> include/features.h
> include/intprops.h
> include/libc-symbols.h
> include/limits.h
> io/ftw.c
> io/tst-utimensat-skeleton.c
> libio/oldstdfiles.c
> libio/tst-freopen.c
> libio/tst-wmemstream1.c
> libio/tst-wmemstream5.c
> locale/localeinfo.h
> locale/programs/charmap-kw.h
> locale/programs/locfile-kw.h
> misc/tst-fd_to_filename.c
> nss/getaddrinfo.c
> nss/tst-rfc3484-2.c
> nss/tst-rfc3484-3.c
> nss/tst-rfc3484.c
> signal/tst-minsigstksz-1.c
> soft-fp/op-2.h
> soft-fp/op-common.h
> soft-fp/soft-fp.h
> stdio-common/vfscanf-internal.c
> stdlib/gmp-impl.h
> stdlib/gmp.h
> stdlib/longlong.h
> stdlib/putenv.c
> stdlib/setenv.c
> stdlib/tst-realpath.c
> string/tester.c
> sysdeps/generic/machine-gmon.h
> sysdeps/generic/unwind-dw2-fde.h
> sysdeps/mips/__longjmp.c
> sysdeps/mips/mips64/__longjmp.c
> sysdeps/unix/sysv/linux/tst-getdents64.c
> sysdeps/x86/tst-cpu-features-supports.c
> time/strftime_l.c
> time/strptime_l.c
> time/tst-ctime.c
> time/tst-difftime.c
> time/tst-mktime4.c
> timezone/private.h
> timezone/zdump.c
>
> Category C:
> argp/argp-help.c
> intl/dcigettext.c
> intl/gettextP.h
> intl/localealias.c
> intl/plural-exp.c
> intl/plural.y
> posix/regcomp.c
> posix/regex.c
> posix/regex_internal.h
>
> Category A and C:
> posix/regex.h
>
> So, in my opinion, it would be best if you split the patch series into
> three patch series, one for category A, one for category B, one for
> category C, making sure to preserve the compiler guarantees of each
> category.
>
> Because your patch series is not fixing any bugzilla bug. You don't want
> your patch series to introduce bugs (for files in category A and B) that
> people will report in bugzilla, right?
>
> For the files in category C: Please co-ordinate with bug-gettext for
> the files under intl/ and with bug-gnulib for the other ones. Thanks.
Thank you very much! This was very useful. I'll certainly split the
patch set into three series. I'll have a look at that tomorrow.
Have a lovely night!
Alex
--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20251110/18041df7/attachment.sig>
More information about the Libc-alpha
mailing list