forked from cloudera/native-toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added patch for missing sys/ustat.h header file
in llvm-5.0.1 build. Fix for cloudera#59
- Loading branch information
1 parent
503859f
commit 4d1efae
Showing
2 changed files
with
33 additions
and
2 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
31 changes: 31 additions & 0 deletions
31
source/llvm/llvm-5.0.1-patches/0002-PATCH-Fix-for-missing-sys-ustat.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,31 @@ | ||
--- llvm-5.0.1.src-p1.orig/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc 2019-12-18 09:07:53.847300486 -0600 | ||
+++ llvm-5.0.1.src-p1/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc 2019-12-18 09:12:02.778397695 -0600 | ||
@@ -159,7 +159,6 @@ typedef struct user_fpregs elf_fpregset_ | ||
# include <sys/procfs.h> | ||
#endif | ||
#include <sys/user.h> | ||
-#include <sys/ustat.h> | ||
#include <linux/cyclades.h> | ||
#include <linux/if_eql.h> | ||
#include <linux/if_plip.h> | ||
@@ -252,7 +251,19 @@ namespace __sanitizer { | ||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD | ||
|
||
#if SANITIZER_LINUX && !SANITIZER_ANDROID | ||
- unsigned struct_ustat_sz = sizeof(struct ustat); | ||
+// Use pre-computed size of struct ustat to avoid <sys/ustat.h> which | ||
+// has been removed from glibc 2.28. | ||
+#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \ | ||
+ || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \ | ||
+ || defined(__x86_64__) | ||
+#define SIZEOF_STRUCT_USTAT 32 | ||
+#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \ | ||
+ || defined(__powerpc__) || defined(__s390__) | ||
+#define SIZEOF_STRUCT_USTAT 20 | ||
+#else | ||
+#error Unknown size of struct ustat | ||
+#endif | ||
+ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT; | ||
unsigned struct_rlimit64_sz = sizeof(struct rlimit64); | ||
unsigned struct_statvfs64_sz = sizeof(struct statvfs64); | ||
#endif // SANITIZER_LINUX && !SANITIZER_ANDROID |