[patch][compiler-rt] adjust sanitizer_platform_limits_linux.cc #include of posix_types

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 10:44:31 PDT 2016


On Fri, Apr 29, 2016 at 5:49 AM, Olivier Hainque via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Hello,
>
> (First time I'm sending a patch, hope I have the format and destination
> list etc right :)
>

Nope. :)
Please use llvm.org/docs/Phabricator.html



>
> 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. linux/posix_types.h 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
>
> --
>
>         * lib/sanitizer_common/sanitizer_platform_limits_linux.cc:
>         #include <linux/posix_types.h> instead of asm/posix_types.h.
>
>
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160429/5bc7e5e6/attachment.html>


More information about the llvm-commits mailing list