-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix libsanitizer for older GCC in newer machines.
When compiling older GCC versions in newer machines, libsanitizer does not compile, showing a error: `multiple definition of 'enum fsconfig_command'` (e.g. llvm/llvm-project#56421). This is because starting from Glibc 2.36, it is not possible to include both "linux/fs.h" and "sys/mount.h". We can apply a patch, similar to the one in https://reviews.llvm.org/D129471 , but with the extension and lines changed to match the file. This is also similar to the upstream fix.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
component/gcc/gcc-libsanitizer-multiple-definition-fsconfig_command.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc | ||
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc | ||
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc | ||
@@ -65,7 +65,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> | ||
@@ -855,10 +854,10 @@ | ||
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; | ||
|
||
|