This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] adjust platform_limits_linux.cc #include of posix_types
ClosedPublic

Authored by hainque on May 2 2016, 2:52 AM.

Details

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

Diff Detail

Event Timeline

hainque updated this revision to Diff 55794.May 2 2016, 2:52 AM
hainque retitled this revision from to [compiler-rt] adjust platform_limits_linux.cc #include of posix_types.
hainque updated this object.
hainque added a reviewer: llvm-commits.
kcc accepted this revision.May 2 2016, 12:15 PM
kcc added a reviewer: kcc.
kcc added a subscriber: kcc.

LGTM, let me commit this. Thanks!

This revision is now accepted and ready to land.May 2 2016, 12:15 PM
kcc closed this revision.May 2 2016, 12:16 PM

Great!

Thanks for your prompt review :-)