Skip to content

Commit

Permalink
Fix sanitizer-common build with glibc 2.31 (#47)
Browse files Browse the repository at this point in the history
The type of ipc_perm mode field used by sanitizers is inconsistent with one
found in glibc 2.31, resulting in a test failure during build.

The sanitizers don't actually use the field directly and only care about the
size and alignment of the whole structure.

Disable the field check until the upgrade to LLVM 10 which addresses the issue
in more comprehensive way.

Co-authored-by: Tomasz Miąsko <[email protected]>
  • Loading branch information
Tomasz Miąsko and tmiasko authored Apr 7, 2020
1 parent 027e428 commit 9f9da27
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1127,10 +1127,11 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
#endif
// This patch is no longer necessary on LLVM 10.
// #if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
// /* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
// CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
// #endif

CHECK_TYPE_SIZE(shmid_ds);
CHECK_SIZE_AND_OFFSET(shmid_ds, shm_perm);
Expand Down

0 comments on commit 9f9da27

Please sign in to comment.