This revision was automatically updated to reflect the committed changes. Closed by commit rC350664: Android is not GNU, so don't claim that it is. (authored by danalbert, committed by ).
Changed prior to commit: https://reviews.llvm.org/D55953?vs=179140&id=180741#toc Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55953/new/ https://reviews.llvm.org/D55953 Files: lib/Basic/Targets/OSTargets.h test/Preprocessor/init.c Index: lib/Basic/Targets/OSTargets.h =================================================================== --- lib/Basic/Targets/OSTargets.h +++ lib/Basic/Targets/OSTargets.h @@ -345,7 +345,6 @@ // Linux defines; list based off of gcc output DefineStd(Builder, "unix", Opts); DefineStd(Builder, "linux", Opts); - Builder.defineMacro("__gnu_linux__"); Builder.defineMacro("__ELF__"); if (Triple.isAndroid()) { Builder.defineMacro("__ANDROID__", "1"); @@ -355,6 +354,8 @@ this->PlatformMinVersion = VersionTuple(Maj, Min, Rev); if (Maj) Builder.defineMacro("__ANDROID_API__", Twine(Maj)); + } else { + Builder.defineMacro("__gnu_linux__"); } if (Opts.POSIXThreads) Builder.defineMacro("_REENTRANT"); Index: test/Preprocessor/init.c =================================================================== --- test/Preprocessor/init.c +++ test/Preprocessor/init.c @@ -9057,6 +9057,7 @@ // RUN: %clang_cc1 -triple arm-linux-androideabi -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix ANDROID %s // ANDROID-NOT:#define __ANDROID_API__ // ANDROID:#define __ANDROID__ 1 +// ANDROID-NOT:#define __gnu_linux__ // // RUN: %clang_cc1 -x c++ -triple i686-linux-android -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix I386-ANDROID-CXX %s // I386-ANDROID-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8U @@ -9067,6 +9068,7 @@ // RUN: %clang_cc1 -triple arm-linux-androideabi20 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix ANDROID20 %s // ANDROID20:#define __ANDROID_API__ 20 // ANDROID20:#define __ANDROID__ 1 +// ANDROID-NOT:#define __gnu_linux__ // // RUN: %clang_cc1 -triple lanai-unknown-unknown -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix LANAI %s // LANAI: #define __lanai__ 1
Index: lib/Basic/Targets/OSTargets.h =================================================================== --- lib/Basic/Targets/OSTargets.h +++ lib/Basic/Targets/OSTargets.h @@ -345,7 +345,6 @@ // Linux defines; list based off of gcc output DefineStd(Builder, "unix", Opts); DefineStd(Builder, "linux", Opts); - Builder.defineMacro("__gnu_linux__"); Builder.defineMacro("__ELF__"); if (Triple.isAndroid()) { Builder.defineMacro("__ANDROID__", "1"); @@ -355,6 +354,8 @@ this->PlatformMinVersion = VersionTuple(Maj, Min, Rev); if (Maj) Builder.defineMacro("__ANDROID_API__", Twine(Maj)); + } else { + Builder.defineMacro("__gnu_linux__"); } if (Opts.POSIXThreads) Builder.defineMacro("_REENTRANT"); Index: test/Preprocessor/init.c =================================================================== --- test/Preprocessor/init.c +++ test/Preprocessor/init.c @@ -9057,6 +9057,7 @@ // RUN: %clang_cc1 -triple arm-linux-androideabi -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix ANDROID %s // ANDROID-NOT:#define __ANDROID_API__ // ANDROID:#define __ANDROID__ 1 +// ANDROID-NOT:#define __gnu_linux__ // // RUN: %clang_cc1 -x c++ -triple i686-linux-android -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix I386-ANDROID-CXX %s // I386-ANDROID-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8U @@ -9067,6 +9068,7 @@ // RUN: %clang_cc1 -triple arm-linux-androideabi20 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix ANDROID20 %s // ANDROID20:#define __ANDROID_API__ 20 // ANDROID20:#define __ANDROID__ 1 +// ANDROID-NOT:#define __gnu_linux__ // // RUN: %clang_cc1 -triple lanai-unknown-unknown -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix LANAI %s // LANAI: #define __lanai__ 1
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits