ports/opt (3.7): compiler-rt: fixed build with glibc 2.36
commit d4535a8e85bacc910cee3697f561516d94f2fda6 Author: Tim Biermann <tbier@posteo.de> Date: Mon Aug 29 21:39:30 2022 +0200 compiler-rt: fixed build with glibc 2.36 diff --git a/compiler-rt/.signature b/compiler-rt/.signature index 700e235bd..af52b55e0 100644 --- a/compiler-rt/.signature +++ b/compiler-rt/.signature @@ -1,6 +1,7 @@ untrusted comment: verify with /etc/ports/opt.pub -RWSE3ohX2g5d/Wn10Bd5ZbEbYPIVv+vUm7WMbjtlhjDo7XMygjEn6IhwX6H1p9+UGSabVrkF7dNcUMUiDSfianS0BJ5X5+DaKQY= -SHA256 (Pkgfile) = ae6a0715e255e31ce2e541aa30107fea1a2bd862e17c4aeef921ccb2980a5925 +RWSE3ohX2g5d/RBIqbMellbvf3kEMZy71sCGGoRqiGTymm2tIPu5IH8fxKTiVrj940mq1ooAvZ5qeQ9dJAzZA4aVQbtDqJeHHg0= +SHA256 (Pkgfile) = 9b9e3fbb888330e82d12306dc0b518cc696873c8550d2b98e673e2bc79764b1b SHA256 (.footprint) = 2421128b93df5d76f55064359aa22646c579fab8d426d41ac5722e00335624b3 SHA256 (compiler-rt-14.0.6.src.tar.xz) = 88df303840ca8fbff944e15e61c141226fe79f5d2b8e89fb024264d77841a02e SHA256 (llvm-14.0.6.src.tar.xz) = 050922ecaaca5781fdf6631ea92bc715183f202f9d2f15147226f023414f619a +SHA256 (remove-include-linux-fs.h.patch) = 34ed866e313e4580130a50118a4410d36fa0159123982521b6ef049439fc32ad diff --git a/compiler-rt/Pkgfile b/compiler-rt/Pkgfile index 40b8dab27..19c6af8d8 100644 --- a/compiler-rt/Pkgfile +++ b/compiler-rt/Pkgfile @@ -5,13 +5,15 @@ name=compiler-rt version=14.0.6 -release=1 +release=2 source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/comp... - https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm...) - + https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm... + remove-include-linux-fs.h.patch) build() { mv llvm-$version.src llvm + patch -Np2 -d $name-$version.src -i $SRC/remove-include-linux-fs.h.patch + cmake -S $name-$version.src -B build -G Ninja \ -D CMAKE_INSTALL_PREFIX=/usr \ -D COMPILER_RT_INSTALL_PATH=/usr/lib/clang/$version \ diff --git a/compiler-rt/remove-include-linux-fs.h.patch b/compiler-rt/remove-include-linux-fs.h.patch new file mode 100644 index 000000000..bbf0d0e7c --- /dev/null +++ b/compiler-rt/remove-include-linux-fs.h.patch @@ -0,0 +1,59 @@ +From 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 Mon Sep 17 00:00:00 2001 +From: Fangrui Song <i@maskray.me> +Date: Mon, 11 Jul 2022 12:53:34 -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. +Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h. +In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp +but this commit is easy to cherry pick into older compiler-rt releases. + +Fix https://github.com/llvm/llvm-project/issues/56421 + +Reviewed By: #sanitizers, vitalybuka, zatrazz + +Differential Revision: https://reviews.llvm.org/D129471 +--- + .../sanitizer_platform_limits_posix.cpp | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 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 4bd425435d56..3a94b260686f 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,9 @@ + #include <sys/vt.h> + #include <linux/cdrom.h> + #include <linux/fd.h> ++#if SANITIZER_ANDROID + #include <linux/fs.h> ++#endif + #include <linux/hdreg.h> + #include <linux/input.h> + #include <linux/ioctl.h> +@@ -876,10 +878,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;
participants (1)
-
crux@crux.nu