unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Rutherther via Guix-patches via <guix-patches@gnu.org>
To: 73793@debbugs.gnu.org
Cc: Rutherther <rutherther@ditigal.xyz>,
	"Andreas Enge" <andreas@enge.fr>,
	"Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#73793] [PATCH] gnu: gcc-9: Fix name conflict for newer glibc versions
Date: Sun, 13 Oct 2024 17:22:36 +0200	[thread overview]
Message-ID: <f18d0454c198003e64c962d3e3b4de5ab9c930b4.1728832424.git.rutherther@ditigal.xyz> (raw)

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
---
 gnu/local.mk                                  |  1 +
 gnu/packages/gcc.scm                          |  3 +-
 .../patches/gcc-9-glibc-name-conflict.patch   | 54 +++++++++++++++++++
 3 files changed, 57 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gcc-9-glibc-name-conflict.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3a35bbca37..c1e878587a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1349,6 +1349,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-8-sort-libtool-find-output.patch	\
   %D%/packages/patches/gcc-8-strmov-store-file-names.patch	\
   %D%/packages/patches/gcc-9-asan-fix-limits-include.patch	\
+  %D%/packages/patches/gcc-9-glibc-name-conflict.patch	        \
   %D%/packages/patches/gcc-9-strmov-store-file-names.patch	\
   %D%/packages/patches/gcc-12-strmov-store-file-names.patch	\
   %D%/packages/patches/gcc-10-cross-environment-variables.patch \
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index c6c7730ad1..b014cee6c1 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -724,7 +724,8 @@ (define-public gcc-10
             (sha256
              (base32
               "1h87lcfaga0ydsf4pkhwlnjr8mky5ix8npbv6iy3jvzlzm1ra415"))
-            (patches (search-patches "gcc-9-strmov-store-file-names.patch"
+            (patches (search-patches "gcc-9-glibc-name-conflict.patch"
+                                     "gcc-9-strmov-store-file-names.patch"
                                      "gcc-5.0-libvtv-runpath.patch"
                                      "gcc-10-libsanitizer-no-crypt.patch"))
             (modules '((guix build utils)))
diff --git a/gnu/packages/patches/gcc-9-glibc-name-conflict.patch b/gnu/packages/patches/gcc-9-glibc-name-conflict.patch
new file mode 100644
index 0000000000..3796e86c52
--- /dev/null
+++ 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 <i@maskray.me>
+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’
+
+Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+
+Fix https://github.com/llvm/llvm-project/issues/56421
+
+Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+Differential Revision: https://reviews.llvm.org/D129471
+---
+ .../sanitizer_common/sanitizer_platform_limits_posix.cpp | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56d9..81740bf4ab3948 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,6 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
+-#include <linux/fs.h>
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +875,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

base-commit: 8f0d76152a4496960f4c2ec219839c5a48b0568e
-- 
2.46.0




             reply	other threads:[~2024-10-13 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-13 15:22 Rutherther via Guix-patches via [this message]
2024-10-13 17:10 ` [bug#73793] [PATCH v2 0/1] Fixes of the patch for gcc 9 Rutherther via Guix-patches via
2024-10-13 17:10 ` [bug#73793] [PATCH v2] gnu: gcc-9: Fix name conflict for newer glibc versions Rutherther via Guix-patches via
2024-10-14 11:52 ` [bug#73793] [PATCH] " Ludovic Courtès
2024-10-14 18:00 ` [bug#73793] [PATCH v3] gnu: gcc-9: Add libsanitizer fsconfig command patch Rutherther via Guix-patches via
2024-10-15 15:45   ` bug#73793: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f18d0454c198003e64c962d3e3b4de5ab9c930b4.1728832424.git.rutherther@ditigal.xyz \
    --to=guix-patches@gnu.org \
    --cc=73793@debbugs.gnu.org \
    --cc=andreas@enge.fr \
    --cc=ludo@gnu.org \
    --cc=rutherther@ditigal.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).