[compiler-rt] da59c2e - [GWP-ASan] Change sys/cdefs.h to features.h

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 20:03:25 PST 2021


Author: Fangrui Song
Date: 2021-02-17T20:03:16-08:00
New Revision: da59c2e4dc1c7b502cc2098247b2ee38ac297e0c

URL: https://github.com/llvm/llvm-project/commit/da59c2e4dc1c7b502cc2098247b2ee38ac297e0c
DIFF: https://github.com/llvm/llvm-project/commit/da59c2e4dc1c7b502cc2098247b2ee38ac297e0c.diff

LOG: [GWP-ASan] Change sys/cdefs.h to features.h

sys/cdefs.h is a glibc internal header which is not supposed to be included by applications.
(Some libc implementations provide this file for compatibility.)
Android features.h includes sys/cdefs.h, so we can include features.h instead.

This change makes `ninja gwp_asan` build on musl.

Added: 
    

Modified: 
    compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp b/compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp
index 338b5311c0e9..735796305509 100644
--- a/compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp
+++ b/compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <sys/cdefs.h> // IWYU pragma: keep (for __BIONIC__ macro)
+#include <features.h> // IWYU pragma: keep (for __BIONIC__ macro)
 
 #ifdef __BIONIC__
 #include "gwp_asan/definitions.h"


        


More information about the llvm-commits mailing list