Subject: [bug#73793] [PATCH] gnu: gcc-9: Fix name conflict for newer glibc versions

From: Ludovic Courtès <[email-masked]>
Date: Mon, 14 Oct 2024 13:52:48 +0200

Rutherther <[email-masked]> skribis:

> Note: not tested yet, I am currently building it locally.
>
> Since newer glibc version there is a conflict in names.
> This uses a patch that was used upstream in llvm to bypass it.
>
> * gnu/packages/patches/gcc-9-glibc-name-conflict.patch: Add gcc 9 glibc patch.
> * gnu/local.mk: Register it.
> * gnu/packages/gcc.scm (gcc-9)[source]: Use it.
>
> Change-Id: Ibb8446b7bba52f72d82fcf69804cae09215daeed

[...]

> +++ b/gnu/packages/patches/gcc-9-glibc-name-conflict.patch
> @@ -0,0 +1,54 @@
> +From b379129c4beb3f26223288627a1291739f33af02 Mon Sep 17 00:00:00 2001
> +From: Fangrui Song <[email-masked]>
> +Date: Mon, 11 Jul 2022 11:38:28 -0700
> +Subject: [PATCH] [sanitizer] Remove #include <linux/fs.h> to resolve
> + fsconfig_command/mount_attr conflict with glibc 2.36
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +It is generally not a good idea to mix usage of glibc headers and Linux UAPI
> +headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
> +since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
> +defines `fsconfig_command` which conflicts with linux/mount.h:
> +
> +    .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’

Instead of this new patch, could you check whether
‘gcc-7-libsanitizer-fsconfig-command.patch’ applies?

If not, could you make sure the new patch has a name similar to the
other ones in this area and a similar header?

Thanks in advance,
Ludo’.