forked from cloudera/native-toolchain
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix for cloudera#57
- Loading branch information
1 parent
c718816
commit facc6b2
Showing
2 changed files
with
32 additions
and
1 deletion.
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
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 @@ | ||
--- gcc-4.9.2.orig/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc 2019-12-17 17:56:37.654678258 -0600 | ||
+++ gcc-4.9.2/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc 2019-12-17 17:58:23.089867685 -0600 | ||
@@ -81,7 +81,6 @@ | ||
#include <sys/statvfs.h> | ||
#include <sys/timex.h> | ||
#include <sys/user.h> | ||
-#include <sys/ustat.h> | ||
#include <linux/cyclades.h> | ||
#include <linux/if_eql.h> | ||
#include <linux/if_plip.h> | ||
@@ -163,7 +162,19 @@ namespace __sanitizer { | ||
unsigned struct_old_utsname_sz = sizeof(struct old_utsname); | ||
unsigned struct_oldold_utsname_sz = sizeof(struct oldold_utsname); | ||
unsigned struct_itimerspec_sz = sizeof(struct itimerspec); | ||
- 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; | ||
#endif // SANITIZER_LINUX | ||
|
||
#if SANITIZER_LINUX && !SANITIZER_ANDROID |