llvm-project/compiler-rt/lib
Kostya Serebryany 9d91336a83 [compiler-rt] adjust platform_limits_linux.cc #include of posix_types
Summary:
Hello,

Building a recent gcc on a powerpc-linux system advertsing:

 Red Hat Enterprise Linux Server release 5.10 (Tikanga)

we stumbled on a compilation error on a file originating
from compiler-rt/lib/sanitizer-common.

sanitizer_platform_limits_linux.cc #includes asm/posix_types.h,
which, on our system, uses __kernel_fd_set and associated macros.
These aren't defined at the point of their use, and the compilation
fails with symptoms like:

  In file included from ../../../../src/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc:29:0:
  /usr/include/asm/posix_types.h:72:51: error: '__kernel_fd_set' has not been declared
  static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
  ...

The attached patch is a suggestion to fix this, by including linux/posix_types.h
instead of asm/posix_types.h. linux/posix_types defines the necessary types and
macros, then #includes asm/posix_types.h.

We have been using it locally for gcc without problems for a couple of years
on powerpc, x86 and x86_64-linux platforms. It is still needed for gcc-6 on
our powerpc host and applies cleanly on the compiler-rt trunk.

Comments ?

Thanks much in advance for your feedback,

With Kind Regards,

Olivier


Reviewers: llvm-commits, kcc

Subscribers: kcc, kubabrecka

Differential Revision: http://reviews.llvm.org/D19799

llvm-svn: 268283
2016-05-02 19:10:48 +00:00
..
BlocksRuntime Move tests for BlocksRuntime and builtins to corresponding directories under test/ 2014-02-14 09:47:31 +00:00
asan [scan-build] fix logic error warning emitted on compiler-rt code base 2016-05-02 19:07:20 +00:00
builtins builtins: fix -Werror,-Wunused-variable warning 2016-04-20 17:43:43 +00:00
cfi [sancov] common flags initialization. 2016-03-18 19:28:07 +00:00
dfsan [sanitizer] [SystemZ] Abort if the kernel might be vulnerable to CVE-2016-2143. 2016-04-27 17:42:00 +00:00
esan [sanitizers] Get the proper symbol version when long double transition is involved. 2016-04-27 21:24:21 +00:00
interception [asan] Intercept all Heap* related imports from ucrtbase.dll 2016-03-24 20:19:48 +00:00
lsan [sanitizer] [SystemZ] Abort if the kernel might be vulnerable to CVE-2016-2143. 2016-04-27 17:42:00 +00:00
msan [msan] Tests for vector compare intrinsics. 2016-04-29 01:20:05 +00:00
profile sync up with master copy 2016-04-06 22:30:14 +00:00
safestack [compiler-rt] [safestack] Enable for aarch64 2015-12-11 17:38:38 +00:00
sanitizer_common [compiler-rt] adjust platform_limits_linux.cc #include of posix_types 2016-05-02 19:10:48 +00:00
stats [Sanitizer] Introduce ListOfModules object and use it to replace GetListOfModules(). 2016-02-22 18:52:51 +00:00
tsan [tsan] Return 0 from malloc_size for non-malloc'd pointers 2016-04-30 07:14:41 +00:00
ubsan [sanitizer] [SystemZ] Enable UBSan. 2016-04-15 22:25:04 +00:00
CMakeLists.txt [esan] EfficiencySanitizer base runtime library 2016-04-21 21:32:25 +00:00
Makefile.mk Remove autoconf support for building runtime libraries. 2016-01-26 21:31:12 +00:00