This is an archive of the discontinued LLVM Phabricator instance.

[Compiler-rt] Use __gnu_linux__ instead of __linux__ to detect Linux OS
AbandonedPublic

Authored by mohit.bhakkad on Mar 4 2016, 2:26 AM.

Details

Reviewers
kcc
Summary

linux is defined for linux kernel.
gnu_linux is defined for linux os.

linux will be present in android also making SANITIZER_LINUX true for android.
So, I suggest we use gnu_linux instead of linux.

Diff Detail

Repository
rL LLVM

Event Timeline

mohit.bhakkad retitled this revision from to [Compiler-rt] Use __gnu_linux__ instead of __linux__ to detect Linux OS.
mohit.bhakkad updated this object.
mohit.bhakkad added a reviewer: kcc.
mohit.bhakkad set the repository for this revision to rL LLVM.
ygribov added a subscriber: ygribov.Mar 4 2016, 2:31 AM

linux will be present in android also making SANITIZER_LINUX true for android.

Isn't this intended? In (few) places where libsanitizer needs to distinguish between Linux and Android it explicitly checks for

#if (SANITIZER_LINUX && !SANITIZER_ANDROID)
mohit.bhakkad abandoned this revision.Mar 4 2016, 3:56 AM

Thanks, I will abandon this patch.