[libcxx] r324534 - Stop using __strtonum_fallback on Android.
Author: danalbert Date: Wed Feb 7 13:58:48 2018 New Revision: 324534 URL: http://llvm.org/viewvc/llvm-project?rev=324534&view=rev Log: Stop using __strtonum_fallback on Android. Fallback implementations are now provided by bionic when necessary, which these may conflict with. Modified: libcxx/trunk/include/support/android/locale_bionic.h Modified: libcxx/trunk/include/support/android/locale_bionic.h URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/support/android/locale_bionic.h?rev=324534&r1=324533&r2=324534&view=diff == --- libcxx/trunk/include/support/android/locale_bionic.h (original) +++ libcxx/trunk/include/support/android/locale_bionic.h Wed Feb 7 13:58:48 2018 @@ -25,7 +25,6 @@ extern "C" { #endif #include -#include #endif // defined(__BIONIC__) #endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r325733 - [Driver] Generate .eh_frame_hdr for static executables too.
Author: danalbert Date: Wed Feb 21 14:36:51 2018 New Revision: 325733 URL: http://llvm.org/viewvc/llvm-project?rev=325733&view=rev Log: [Driver] Generate .eh_frame_hdr for static executables too. Summary: libgcc won't unwind without an .eh_frame_hdr section. Reviewers: srhines, chandlerc Reviewed By: chandlerc Subscribers: chandlerc, cfe-commits Differential Revision: https://reviews.llvm.org/D43203 Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp cfe/trunk/test/Driver/linux-ld.c Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=325733&r1=325732&r2=325733&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Wed Feb 21 14:36:51 2018 @@ -378,9 +378,7 @@ void tools::gnutools::Linker::ConstructJ for (const auto &Opt : ToolChain.ExtraOpts) CmdArgs.push_back(Opt.c_str()); - if (!Args.hasArg(options::OPT_static)) { -CmdArgs.push_back("--eh-frame-hdr"); - } + CmdArgs.push_back("--eh-frame-hdr"); if (const char *LDMOption = getLDMOption(ToolChain.getTriple(), Args)) { CmdArgs.push_back("-m"); Modified: cfe/trunk/test/Driver/linux-ld.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=325733&r1=325732&r2=325733&view=diff == --- cfe/trunk/test/Driver/linux-ld.c (original) +++ cfe/trunk/test/Driver/linux-ld.c Wed Feb 21 14:36:51 2018 @@ -156,7 +156,7 @@ // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s // CHECK-LD-64-STATIC-NOT: warning: // CHECK-LD-64-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" -// CHECK-LD-64-STATIC-NOT: "--eh-frame-hdr" +// CHECK-LD-64-STATIC: "--eh-frame-hdr" // CHECK-LD-64-STATIC: "-m" "elf_x86_64" // CHECK-LD-64-STATIC-NOT: "-dynamic-linker" // CHECK-LD-64-STATIC: "-static" ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r322031 - Make rehash(0) work with ubsan's unsigned-integer-overflow.
Author: danalbert Date: Mon Jan 8 13:49:12 2018 New Revision: 322031 URL: http://llvm.org/viewvc/llvm-project?rev=322031&view=rev Log: Make rehash(0) work with ubsan's unsigned-integer-overflow. Reviewers: mclow.lists, EricWF Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40743 Modified: libcxx/trunk/include/__hash_table Modified: libcxx/trunk/include/__hash_table URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=322031&r1=322030&r2=322031&view=diff == --- libcxx/trunk/include/__hash_table (original) +++ libcxx/trunk/include/__hash_table Mon Jan 8 13:49:12 2018 @@ -2136,7 +2136,7 @@ template ::rehash(size_type __n) { -if (__n == 1) +if (__n < 2) __n = 2; else if (__n & (__n - 1)) __n = __next_prime(__n); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r322039 - Revert "Make rehash(0) work with ubsan's unsigned-integer-overflow."
Author: danalbert Date: Mon Jan 8 14:57:12 2018 New Revision: 322039 URL: http://llvm.org/viewvc/llvm-project?rev=322039&view=rev Log: Revert "Make rehash(0) work with ubsan's unsigned-integer-overflow." Seems to have broken some tests since I first wrote this a while back. Will reland after checking what went wrong with the tests. This reverts commit 7023194c8d11a081fd01ed25308b3d60193c6a06. Modified: libcxx/trunk/include/__hash_table Modified: libcxx/trunk/include/__hash_table URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=322039&r1=322038&r2=322039&view=diff == --- libcxx/trunk/include/__hash_table (original) +++ libcxx/trunk/include/__hash_table Mon Jan 8 14:57:12 2018 @@ -2136,7 +2136,7 @@ template ::rehash(size_type __n) { -if (__n < 2) +if (__n == 1) __n = 2; else if (__n & (__n - 1)) __n = __next_prime(__n); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r344293 - [Driver] Fix --hash-style choice for Android.
Author: danalbert Date: Thu Oct 11 13:39:32 2018 New Revision: 344293 URL: http://llvm.org/viewvc/llvm-project?rev=344293&view=rev Log: [Driver] Fix --hash-style choice for Android. Summary: Android supports GNU style hashes as of Marshmallow, so we should be generating both styles for pre-M targets and GNU hashes for newer targets. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53118 Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/test/Driver/linux-ld.c Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=344293&r1=344292&r2=344293&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Thu Oct 11 13:39:32 2018 @@ -264,15 +264,18 @@ Linux::Linux(const Driver &D, const llvm // and the MIPS ABI require .dynsym to be sorted in different ways. // .gnu.hash needs symbols to be grouped by hash code whereas the MIPS // ABI requires a mapping between the GOT and the symbol table. - // Android loader does not support .gnu.hash. + // Android loader does not support .gnu.hash until API 23. // Hexagon linker/loader does not support .gnu.hash - if (!IsMips && !IsAndroid && !IsHexagon) { + if (!IsMips && !IsHexagon) { if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() || -(Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick)) +(Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) || +(IsAndroid && !Triple.isAndroidVersionLT(23))) ExtraOpts.push_back("--hash-style=gnu"); -if (Distro.IsDebian() || Distro.IsOpenSUSE() || Distro == Distro::UbuntuLucid || -Distro == Distro::UbuntuJaunty || Distro == Distro::UbuntuKarmic) +if (Distro.IsDebian() || Distro.IsOpenSUSE() || +Distro == Distro::UbuntuLucid || Distro == Distro::UbuntuJaunty || +Distro == Distro::UbuntuKarmic || +(IsAndroid && Triple.isAndroidVersionLT(23))) ExtraOpts.push_back("--hash-style=both"); } Modified: cfe/trunk/test/Driver/linux-ld.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=344293&r1=344292&r2=344293&view=diff == --- cfe/trunk/test/Driver/linux-ld.c (original) +++ cfe/trunk/test/Driver/linux-ld.c Thu Oct 11 13:39:32 2018 @@ -975,6 +975,20 @@ // CHECK-MIPS64EL-REDHAT: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1" // CHECK-MIPS64EL-REDHAT-NOT: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld-musl-mipsel.so.1" // CHECK-MIPS64EL-REDHAT-NOT: "--hash-style={{gnu|both}}" + +// Check that we pass --hash-style=both for pre-M Android versions and +// --hash-style=gnu for newer Android versions. +// RUN: %clang %s -### -o %t.o 2>&1 \ +// RUN: --target=armv7-linux-android21 \ +// RUN: | FileCheck --check-prefix=CHECK-ANDROID-HASH-STYLE-L %s +// CHECK-ANDROID-HASH-STYLE-L: "{{.*}}ld{{(.exe)?}}" +// CHECK-ANDROID-HASH-STYLE-L: "--hash-style=both" +// +// RUN: %clang %s -### -o %t.o 2>&1 \ +// RUN: --target=armv7-linux-android23 \ +// RUN: | FileCheck --check-prefix=CHECK-ANDROID-HASH-STYLE-M %s +// CHECK-ANDROID-HASH-STYLE-M: "{{.*}}ld{{(.exe)?}}" +// CHECK-ANDROID-HASH-STYLE-M: "--hash-style=gnu" // // RUN: %clang %s -### -o %t.o 2>&1 \ // RUN: --target=sparc-unknown-linux-gnu \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r344295 - [Driver] Default to `-z now` and `-z relro` on Android.
Author: danalbert Date: Thu Oct 11 13:57:54 2018 New Revision: 344295 URL: http://llvm.org/viewvc/llvm-project?rev=344295&view=rev Log: [Driver] Default to `-z now` and `-z relro` on Android. Summary: RTLD_LAZY is not supported on Android (though failing to use `-z now` will work since it is assumed by the loader). RelRO is required. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53117 Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/test/Driver/linux-ld.c Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=344295&r1=344294&r2=344295&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Thu Oct 11 13:57:54 2018 @@ -229,12 +229,13 @@ Linux::Linux(const Driver &D, const llvm Distro Distro(D.getVFS()); - if (Distro.IsAlpineLinux()) { + if (Distro.IsAlpineLinux() || Triple.isAndroid()) { ExtraOpts.push_back("-z"); ExtraOpts.push_back("now"); } - if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux()) { + if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() || + Triple.isAndroid()) { ExtraOpts.push_back("-z"); ExtraOpts.push_back("relro"); } Modified: cfe/trunk/test/Driver/linux-ld.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=344295&r1=344294&r2=344295&view=diff == --- cfe/trunk/test/Driver/linux-ld.c (original) +++ cfe/trunk/test/Driver/linux-ld.c Thu Oct 11 13:57:54 2018 @@ -1255,6 +1255,8 @@ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-ANDROID: "-z" "now" +// CHECK-ANDROID: "-z" "relro" // CHECK-ANDROID: "--enable-new-dtags" // CHECK-ANDROID: "{{.*}}{{/|}}crtbegin_dynamic.o" // CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib" ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r344296 - [Driver] Default Android toolchains to libc++.
Author: danalbert Date: Thu Oct 11 13:58:43 2018 New Revision: 344296 URL: http://llvm.org/viewvc/llvm-project?rev=344296&view=rev Log: [Driver] Default Android toolchains to libc++. Reviewers: srhines, pirama, EricWF Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53109 Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/lib/Driver/ToolChains/Linux.h cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=344296&r1=344295&r2=344296&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Thu Oct 11 13:58:43 2018 @@ -436,6 +436,12 @@ Linux::Linux(const Driver &D, const llvm addPathIfExists(D, SysRoot + "/usr/lib", Paths); } +ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const { + if (getTriple().isAndroid()) +return ToolChain::CST_Libcxx; + return ToolChain::CST_Libstdcxx; +} + bool Linux::HasNativeLLVMSupport() const { return true; } Tool *Linux::buildLinker() const { return new tools::gnutools::Linker(*this); } Modified: cfe/trunk/lib/Driver/ToolChains/Linux.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.h?rev=344296&r1=344295&r2=344296&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.h (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.h Thu Oct 11 13:58:43 2018 @@ -37,6 +37,7 @@ public: llvm::opt::ArgStringList &CC1Args) const override; void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + CXXStdlibType GetDefaultCXXStdlibType() const override; bool isPIEDefault() const override; bool IsMathErrnoDefault() const override; SanitizerMask getSupportedSanitizers() const override; Modified: cfe/trunk/test/Driver/android-ndk-standalone.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/android-ndk-standalone.cpp?rev=344296&r1=344295&r2=344296&view=diff == --- cfe/trunk/test/Driver/android-ndk-standalone.cpp (original) +++ cfe/trunk/test/Driver/android-ndk-standalone.cpp Thu Oct 11 13:58:43 2018 @@ -2,21 +2,13 @@ // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -49,21 +41,47 @@ // CHECK-14: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target armv7a-none-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -B%S/Inputs/basic_android_ndk_tree \ +// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ +// RUN: | FileCheck --check-prefix=CHECK-STDCXX %s +// CHECK-STDCXX: {{.*}}clang{{.*}}" "-cc1" +// CHECK-STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" +// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9
r344297 - Revert "[Driver] Default Android toolchains to libc++."
Author: danalbert Date: Thu Oct 11 14:28:42 2018 New Revision: 344297 URL: http://llvm.org/viewvc/llvm-project?rev=344297&view=rev Log: Revert "[Driver] Default Android toolchains to libc++." Breaks some of the Android bots because they aren't expecting to need to explicitly set -stdlib. This reverts commit 031072f5048654b01a40f639633de1ff4e2f3dc8. Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/lib/Driver/ToolChains/Linux.h cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=344297&r1=344296&r2=344297&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Thu Oct 11 14:28:42 2018 @@ -436,12 +436,6 @@ Linux::Linux(const Driver &D, const llvm addPathIfExists(D, SysRoot + "/usr/lib", Paths); } -ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const { - if (getTriple().isAndroid()) -return ToolChain::CST_Libcxx; - return ToolChain::CST_Libstdcxx; -} - bool Linux::HasNativeLLVMSupport() const { return true; } Tool *Linux::buildLinker() const { return new tools::gnutools::Linker(*this); } Modified: cfe/trunk/lib/Driver/ToolChains/Linux.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.h?rev=344297&r1=344296&r2=344297&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.h (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.h Thu Oct 11 14:28:42 2018 @@ -37,7 +37,6 @@ public: llvm::opt::ArgStringList &CC1Args) const override; void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; - CXXStdlibType GetDefaultCXXStdlibType() const override; bool isPIEDefault() const override; bool IsMathErrnoDefault() const override; SanitizerMask getSupportedSanitizers() const override; Modified: cfe/trunk/test/Driver/android-ndk-standalone.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/android-ndk-standalone.cpp?rev=344297&r1=344296&r2=344297&view=diff == --- cfe/trunk/test/Driver/android-ndk-standalone.cpp (original) +++ cfe/trunk/test/Driver/android-ndk-standalone.cpp Thu Oct 11 14:28:42 2018 @@ -2,13 +2,21 @@ // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 \ +// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/v1" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" // CHECK: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -41,47 +49,21 @@ // CHECK-14: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ -// RUN: -B%S/Inputs/basic_android_ndk_tree \ -// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ -// RUN: | FileCheck --check-prefix=CHECK-STDCXX %s -// CHECK-STDCXX: {{.*}}clang{{.*}}" "-cc1" -// CHECK-STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-STDCXX-NO
r344367 - [Driver] Add defaults for Android ARM FPUs.
Author: danalbert Date: Fri Oct 12 10:06:31 2018 New Revision: 344367 URL: http://llvm.org/viewvc/llvm-project?rev=344367&view=rev Log: [Driver] Add defaults for Android ARM FPUs. Summary: Android mandates that devices have at least vfpv3-d16 until Marshmallow and NEON after that. Still honor the user's decision, but raise the defaults for Android targets. Reviewers: srhines, pirama, javed.absar, kristof.beyls, peter.smith Reviewed By: peter.smith Subscribers: peter.smith, rengolin, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D53121 Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp cfe/trunk/test/Driver/arm-mfpu.c Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp?rev=344367&r1=344366&r2=344367&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp Fri Oct 12 10:06:31 2018 @@ -378,6 +378,13 @@ void arm::getARMTargetFeatures(const Too Features); } else if (FPUArg) { getARMFPUFeatures(D, FPUArg, Args, FPUArg->getValue(), Features); + } else if (Triple.isAndroid() && getARMSubArchVersionNumber(Triple) >= 7) { +// Android mandates minimum FPU requirements based on OS version. +const char *AndroidFPU = +Triple.isAndroidVersionLT(23) ? "vfpv3-d16" : "neon"; +if (!llvm::ARM::getFPUFeatures(llvm::ARM::parseFPU(AndroidFPU), Features)) + D.Diag(clang::diag::err_drv_clang_unsupported) + << std::string("-mfpu=") + AndroidFPU; } // Honor -mhwdiv=. ClangAs gives preference to -Wa,-mhwdiv=. Modified: cfe/trunk/test/Driver/arm-mfpu.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-mfpu.c?rev=344367&r1=344366&r2=344367&view=diff == --- cfe/trunk/test/Driver/arm-mfpu.c (original) +++ cfe/trunk/test/Driver/arm-mfpu.c Fri Oct 12 10:06:31 2018 @@ -364,3 +364,67 @@ // CHECK-SOFT-ABI-FP: "-target-feature" "-fp-armv8" // CHECK-SOFT-ABI-FP: "-target-feature" "-neon" // CHECK-SOFT-ABI-FP: "-target-feature" "-crypto" + +// RUN: %clang -target arm-linux-androideabi21 %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM5-ANDROID-FP-DEFAULT %s +// CHECK-ARM5-ANDROID-FP-DEFAULT: "-target-feature" "+soft-float" +// CHECK-ARM5-ANDROID-FP-DEFAULT: "-target-feature" "+soft-float-abi" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+d16" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+vfp3" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+vfp4" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+neon" +// CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+crypto" + +// RUN: %clang -target arm-linux-androideabi21 -march=armv7-a %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MARCH-ARM7-ANDROID-FP %s +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+soft-float" +// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+soft-float-abi" +// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+d16" +// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+vfp3" +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+vfp4" +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+fp-armv8" +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+neon" +// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+crypto" + +// RUN: %clang -target armv7-linux-androideabi21 %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM-ANDROID-L-FP-DEFAULT %s +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+soft-float" +// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+soft-float-abi" +// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+d16" +// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+vfp3" +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+vfp4" +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8" +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+neon" +// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+crypto" + +// RUN: %clang -target armv7-linux-androideabi21 -mfpu=neon %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM-ANDROID-L-FP-NEON %s +// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+soft-float" +// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+soft-float-abi" +// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+vfp3" +// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+vfp4" +// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+fp-armv8" +// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+neon" +// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+crypto" + +// RUN: %clang -target armv7-linux-androideabi23 %s -### -c 2>&1 \ +// RUN: | FileCheck
r344795 - [Driver] Reland: Default Android toolchains to libc++.
Author: danalbert Date: Fri Oct 19 11:06:02 2018 New Revision: 344795 URL: http://llvm.org/viewvc/llvm-project?rev=344795&view=rev Log: [Driver] Reland: Default Android toolchains to libc++. The sanitizer builder that was broken by this should now be fixed. Original review was https://reviews.llvm.org/D53109 Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/lib/Driver/ToolChains/Linux.h cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=344795&r1=344794&r2=344795&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Fri Oct 19 11:06:02 2018 @@ -443,6 +443,12 @@ Linux::Linux(const Driver &D, const llvm addPathIfExists(D, SysRoot + "/usr/lib", Paths); } +ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const { + if (getTriple().isAndroid()) +return ToolChain::CST_Libcxx; + return ToolChain::CST_Libstdcxx; +} + bool Linux::HasNativeLLVMSupport() const { return true; } Tool *Linux::buildLinker() const { return new tools::gnutools::Linker(*this); } Modified: cfe/trunk/lib/Driver/ToolChains/Linux.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.h?rev=344795&r1=344794&r2=344795&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.h (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.h Fri Oct 19 11:06:02 2018 @@ -37,6 +37,7 @@ public: llvm::opt::ArgStringList &CC1Args) const override; void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + CXXStdlibType GetDefaultCXXStdlibType() const override; bool isPIEDefault() const override; bool IsMathErrnoDefault() const override; SanitizerMask getSupportedSanitizers() const override; Modified: cfe/trunk/test/Driver/android-ndk-standalone.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/android-ndk-standalone.cpp?rev=344795&r1=344794&r2=344795&view=diff == --- cfe/trunk/test/Driver/android-ndk-standalone.cpp (original) +++ cfe/trunk/test/Driver/android-ndk-standalone.cpp Fri Oct 19 11:06:02 2018 @@ -2,21 +2,13 @@ // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -49,21 +41,47 @@ // CHECK-14: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target armv7a-none-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -B%S/Inputs/basic_android_ndk_tree \ +// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ +// RUN: | FileCheck --check-prefix=CHECK-STDCXX %s +// CHECK-STDCXX: {{.*}}clang{{.*}}" "-cc1" +// CHECK-STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" +// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-
r344806 - Revert "[Driver] Reland: Default Android toolchains to libc++."
Author: danalbert Date: Fri Oct 19 12:23:01 2018 New Revision: 344806 URL: http://llvm.org/viewvc/llvm-project?rev=344806&view=rev Log: Revert "[Driver] Reland: Default Android toolchains to libc++." This reverts commit 84677d5009d613232d360fda27e6e41fb5cb6700. Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/lib/Driver/ToolChains/Linux.h cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=344806&r1=344805&r2=344806&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Fri Oct 19 12:23:01 2018 @@ -443,12 +443,6 @@ Linux::Linux(const Driver &D, const llvm addPathIfExists(D, SysRoot + "/usr/lib", Paths); } -ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const { - if (getTriple().isAndroid()) -return ToolChain::CST_Libcxx; - return ToolChain::CST_Libstdcxx; -} - bool Linux::HasNativeLLVMSupport() const { return true; } Tool *Linux::buildLinker() const { return new tools::gnutools::Linker(*this); } Modified: cfe/trunk/lib/Driver/ToolChains/Linux.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.h?rev=344806&r1=344805&r2=344806&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.h (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.h Fri Oct 19 12:23:01 2018 @@ -37,7 +37,6 @@ public: llvm::opt::ArgStringList &CC1Args) const override; void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; - CXXStdlibType GetDefaultCXXStdlibType() const override; bool isPIEDefault() const override; bool IsMathErrnoDefault() const override; SanitizerMask getSupportedSanitizers() const override; Modified: cfe/trunk/test/Driver/android-ndk-standalone.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/android-ndk-standalone.cpp?rev=344806&r1=344805&r2=344806&view=diff == --- cfe/trunk/test/Driver/android-ndk-standalone.cpp (original) +++ cfe/trunk/test/Driver/android-ndk-standalone.cpp Fri Oct 19 12:23:01 2018 @@ -2,13 +2,21 @@ // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 \ +// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/v1" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" // CHECK: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -41,47 +49,21 @@ // CHECK-14: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ -// RUN: -B%S/Inputs/basic_android_ndk_tree \ -// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ -// RUN: | FileCheck --check-prefix=CHECK-STDCXX %s -// CHECK-STDCXX: {{.*}}clang{{.*}}" "-cc1" -// CHECK-STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// C
r344946 - [Driver] Reland again: Default Android toolchains to libc++.
Author: danalbert Date: Mon Oct 22 13:16:21 2018 New Revision: 344946 URL: http://llvm.org/viewvc/llvm-project?rev=344946&view=rev Log: [Driver] Reland again: Default Android toolchains to libc++. Some of the test data went missing last time I tried to submit this, causing the tests to fail when the build did not include libc++. Original review was https://reviews.llvm.org/D53109. Added: cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/v1/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/v1/.keep Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/lib/Driver/ToolChains/Linux.h cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=344946&r1=344945&r2=344946&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Mon Oct 22 13:16:21 2018 @@ -443,6 +443,12 @@ Linux::Linux(const Driver &D, const llvm addPathIfExists(D, SysRoot + "/usr/lib", Paths); } +ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const { + if (getTriple().isAndroid()) +return ToolChain::CST_Libcxx; + return ToolChain::CST_Libstdcxx; +} + bool Linux::HasNativeLLVMSupport() const { return true; } Tool *Linux::buildLinker() const { return new tools::gnutools::Linker(*this); } Modified: cfe/trunk/lib/Driver/ToolChains/Linux.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.h?rev=344946&r1=344945&r2=344946&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.h (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.h Mon Oct 22 13:16:21 2018 @@ -37,6 +37,7 @@ public: llvm::opt::ArgStringList &CC1Args) const override; void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + CXXStdlibType GetDefaultCXXStdlibType() const override; bool isPIEDefault() const override; bool IsMathErrnoDefault() const override; SanitizerMask getSupportedSanitizers() const override; Added: cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/v1/.keep URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c%2B%2B/v1/.keep?rev=344946&view=auto == (empty) Modified: cfe/trunk/test/Driver/android-ndk-standalone.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/android-ndk-standalone.cpp?rev=344946&r1=344945&r2=344946&view=diff == --- cfe/trunk/test/Driver/android-ndk-standalone.cpp (original) +++ cfe/trunk/test/Driver/android-ndk-standalone.cpp Mon Oct 22 13:16:21 2018 @@ -2,21 +2,13 @@ // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -49,21 +41,47 @@ // CHECK-14: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target armv7a-none-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -B%S/Inputs/basic_an
r344963 - Revert "[Driver] Reland again: Default Android toolchains to libc++."
Author: danalbert Date: Mon Oct 22 14:58:22 2018 New Revision: 344963 URL: http://llvm.org/viewvc/llvm-project?rev=344963&view=rev Log: Revert "[Driver] Reland again: Default Android toolchains to libc++." More compiler-rt test bot breakages... Removed: cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/v1/.keep Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/lib/Driver/ToolChains/Linux.h cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=344963&r1=344962&r2=344963&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Mon Oct 22 14:58:22 2018 @@ -443,12 +443,6 @@ Linux::Linux(const Driver &D, const llvm addPathIfExists(D, SysRoot + "/usr/lib", Paths); } -ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const { - if (getTriple().isAndroid()) -return ToolChain::CST_Libcxx; - return ToolChain::CST_Libstdcxx; -} - bool Linux::HasNativeLLVMSupport() const { return true; } Tool *Linux::buildLinker() const { return new tools::gnutools::Linker(*this); } Modified: cfe/trunk/lib/Driver/ToolChains/Linux.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.h?rev=344963&r1=344962&r2=344963&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.h (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.h Mon Oct 22 14:58:22 2018 @@ -37,7 +37,6 @@ public: llvm::opt::ArgStringList &CC1Args) const override; void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; - CXXStdlibType GetDefaultCXXStdlibType() const override; bool isPIEDefault() const override; bool IsMathErrnoDefault() const override; SanitizerMask getSupportedSanitizers() const override; Removed: cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/v1/.keep URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c%2B%2B/v1/.keep?rev=344962&view=auto == (empty) Modified: cfe/trunk/test/Driver/android-ndk-standalone.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/android-ndk-standalone.cpp?rev=344963&r1=344962&r2=344963&view=diff == --- cfe/trunk/test/Driver/android-ndk-standalone.cpp (original) +++ cfe/trunk/test/Driver/android-ndk-standalone.cpp Mon Oct 22 14:58:22 2018 @@ -2,13 +2,21 @@ // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 \ +// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/v1" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" +// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" // CHECK: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -41,47 +49,21 @@ // CHECK-14: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ -// RUN: -B%S/Inputs/basic_android_ndk_tree \ -// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ -// RUN: | FileCheck --check-prefix=CHECK-STDCXX %s -// CHECK-STDCXX: {{.*}}clang{{.*}}" "-cc1" -// CHECK-STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-l
r346167 - [Driver] Reland again again: Default Android toolchains to libc++.
Author: danalbert Date: Mon Nov 5 12:57:46 2018 New Revision: 346167 URL: http://llvm.org/viewvc/llvm-project?rev=346167&view=rev Log: [Driver] Reland again again: Default Android toolchains to libc++. Landed more fixes to the compiler-rt Android tests. Original review was https://reviews.llvm.org/D53109. Added: cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/v1/.keep Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/lib/Driver/ToolChains/Linux.h cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=346167&r1=346166&r2=346167&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Mon Nov 5 12:57:46 2018 @@ -443,6 +443,12 @@ Linux::Linux(const Driver &D, const llvm addPathIfExists(D, SysRoot + "/usr/lib", Paths); } +ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const { + if (getTriple().isAndroid()) +return ToolChain::CST_Libcxx; + return ToolChain::CST_Libstdcxx; +} + bool Linux::HasNativeLLVMSupport() const { return true; } Tool *Linux::buildLinker() const { return new tools::gnutools::Linker(*this); } Modified: cfe/trunk/lib/Driver/ToolChains/Linux.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.h?rev=346167&r1=346166&r2=346167&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.h (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.h Mon Nov 5 12:57:46 2018 @@ -37,6 +37,7 @@ public: llvm::opt::ArgStringList &CC1Args) const override; void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + CXXStdlibType GetDefaultCXXStdlibType() const override; bool isPIEDefault() const override; bool IsMathErrnoDefault() const override; SanitizerMask getSupportedSanitizers() const override; Added: cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c++/v1/.keep URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/c%2B%2B/v1/.keep?rev=346167&view=auto == (empty) Modified: cfe/trunk/test/Driver/android-ndk-standalone.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/android-ndk-standalone.cpp?rev=346167&r1=346166&r2=346167&view=diff == --- cfe/trunk/test/Driver/android-ndk-standalone.cpp (original) +++ cfe/trunk/test/Driver/android-ndk-standalone.cpp Mon Nov 5 12:57:46 2018 @@ -2,21 +2,13 @@ // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 \ // RUN: -B%S/Inputs/basic_android_ndk_tree \ // RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ // RUN: | FileCheck %s // CHECK: {{.*}}clang{{.*}}" "-cc1" // CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a/thumb" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" -// CHECK-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" -// CHECK: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" +// CHECK: "-internal-isystem" "{{.*}}/include/c++/v1" // CHECK: "-internal-isystem" "{{.*}}/sysroot/usr/local/include" // CHECK: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|)}}include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" @@ -49,21 +41,47 @@ // CHECK-14: "-L{{.*}}/sysroot/usr/lib/arm-linux-androideabi" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -target armv7a-none-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \ +// RUN: -B%S/Inputs/basic_android_ndk_tree \ +// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ +// RUN: | FileCheck --check-prefix=CHECK-STDCXX %s +// CHECK-STDCXX: {{.*}}clang{{.*}}" "-cc1" +// CHECK-STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" +/
r357197 - [Driver] Default Android toolchains to noexecstack.
Author: danalbert Date: Thu Mar 28 11:08:28 2019 New Revision: 357197 URL: http://llvm.org/viewvc/llvm-project?rev=357197&view=rev Log: [Driver] Default Android toolchains to noexecstack. Android does not support executable stacks. Reviewers: srhines, pirama Reviewed By: pirama Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53343 Modified: cfe/trunk/include/clang/Driver/ToolChain.h cfe/trunk/lib/Driver/ToolChain.cpp cfe/trunk/lib/Driver/ToolChains/Clang.cpp cfe/trunk/lib/Driver/ToolChains/Gnu.cpp cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/lib/Driver/ToolChains/Linux.h cfe/trunk/test/Driver/integrated-as.c cfe/trunk/test/Driver/linux-as.c cfe/trunk/test/Driver/linux-ld.c Modified: cfe/trunk/include/clang/Driver/ToolChain.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=357197&r1=357196&r2=357197&view=diff == --- cfe/trunk/include/clang/Driver/ToolChain.h (original) +++ cfe/trunk/include/clang/Driver/ToolChain.h Thu Mar 28 11:08:28 2019 @@ -412,6 +412,9 @@ public: /// Test whether this toolchain defaults to PIE. virtual bool isPIEDefault() const = 0; + /// Test whether this toolchaind defaults to non-executable stacks. + virtual bool isNoExecStackDefault() const; + /// Tests whether this toolchain forces its default for PIC, PIE or /// non-PIC. If this returns true, any PIC related flags should be ignored /// and instead the results of \c isPICDefault() and \c isPIEDefault() are Modified: cfe/trunk/lib/Driver/ToolChain.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=357197&r1=357196&r2=357197&view=diff == --- cfe/trunk/lib/Driver/ToolChain.cpp (original) +++ cfe/trunk/lib/Driver/ToolChain.cpp Thu Mar 28 11:08:28 2019 @@ -112,6 +112,10 @@ bool ToolChain::useRelaxRelocations() co return ENABLE_X86_RELAX_RELOCATIONS; } +bool ToolChain::isNoExecStackDefault() const { +return false; +} + const SanitizerArgs& ToolChain::getSanitizerArgs() const { if (!SanitizerArguments.get()) SanitizerArguments.reset(new SanitizerArgs(*this, Args)); Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=357197&r1=357196&r2=357197&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Thu Mar 28 11:08:28 2019 @@ -2053,6 +2053,7 @@ static void CollectArgsForIntegratedAsse bool TakeNextArg = false; bool UseRelaxRelocations = C.getDefaultToolChain().useRelaxRelocations(); + bool UseNoExecStack = C.getDefaultToolChain().isNoExecStackDefault(); const char *MipsTargetFeature = nullptr; for (const Arg *A : Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) { @@ -2134,7 +2135,7 @@ static void CollectArgsForIntegratedAsse } else if (Value == "--fatal-warnings") { CmdArgs.push_back("-massembler-fatal-warnings"); } else if (Value == "--noexecstack") { -CmdArgs.push_back("-mnoexecstack"); +UseNoExecStack = true; } else if (Value.startswith("-compress-debug-sections") || Value.startswith("--compress-debug-sections") || Value == "-nocompress-debug-sections" || @@ -2197,6 +2198,8 @@ static void CollectArgsForIntegratedAsse } if (UseRelaxRelocations) CmdArgs.push_back("--mrelax-relocations"); + if (UseNoExecStack) +CmdArgs.push_back("-mnoexecstack"); if (MipsTargetFeature != nullptr) { CmdArgs.push_back("-target-feature"); CmdArgs.push_back(MipsTargetFeature); Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=357197&r1=357196&r2=357197&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Thu Mar 28 11:08:28 2019 @@ -360,6 +360,11 @@ void tools::gnutools::Linker::ConstructJ CmdArgs.push_back("--no-dynamic-linker"); } + if (ToolChain.isNoExecStackDefault()) { +CmdArgs.push_back("-z"); +CmdArgs.push_back("noexecstack"); + } + if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); @@ -609,6 +614,10 @@ void tools::gnutools::Assembler::Constru } } + if (getToolChain().isNoExecStackDefault()) { + CmdArgs.push_back("--noexecstack"); + } + switch (getToolChain().getArch()) { default: break; Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=357197&r1=357196&r2=357
r357296 - [Driver] Use --warn-shared-textrel for Android.
Author: danalbert Date: Fri Mar 29 11:34:25 2019 New Revision: 357296 URL: http://llvm.org/viewvc/llvm-project?rev=357296&view=rev Log: [Driver] Use --warn-shared-textrel for Android. Android does not allow shared text relocations. Enable the linker warning to detect them by default. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53344 Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp cfe/trunk/test/Driver/linux-ld.c Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=357296&r1=357295&r2=357296&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Fri Mar 29 11:34:25 2019 @@ -387,6 +387,11 @@ void tools::gnutools::Linker::ConstructJ CmdArgs.push_back("--fix-cortex-a53-843419"); } + // Android does not allow shared text relocations. Emit a warning if the + // user's code contains any. + if (isAndroid) + CmdArgs.push_back("--warn-shared-textrel"); + for (const auto &Opt : ToolChain.ExtraOpts) CmdArgs.push_back(Opt.c_str()); Modified: cfe/trunk/test/Driver/linux-ld.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=357296&r1=357295&r2=357296&view=diff == --- cfe/trunk/test/Driver/linux-ld.c (original) +++ cfe/trunk/test/Driver/linux-ld.c Fri Mar 29 11:34:25 2019 @@ -1006,7 +1006,13 @@ // CHECK-ANDROID-NOEXECSTACK-NOT: "-z" "execstack" // CHECK-ANDROID-NOEXECSTACK-NOT: "-z,execstack" // CHECK-ANDROID-NOEXECSTACK-NOT: "-zexecstack" -// + ++// RUN: %clang %s -### -o %t.o 2>&1 \ ++// RUN: --target=armv7-linux-android21 \ ++// RUN: | FileCheck --check-prefix=CHECK-ANDROID-WARN-SHARED-TEXTREL %s ++// CHECK-ANDROID-WARN-SHARED-TEXTREL: "{{.*}}ld{{(.exe)?}}" ++// CHECK-ANDROID-WARN-SHARED-TEXTREL: "--warn-shared-textrel" + // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64-linux-gnuabin32 \ // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABIN32 %s // CHECK-MIPS64EL-GNUABIN32: "{{.*}}ld{{(.exe)?}}" ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r354166 - [Driver] Default all Android ARM targets to NEON.
Author: danalbert Date: Fri Feb 15 12:31:54 2019 New Revision: 354166 URL: http://llvm.org/viewvc/llvm-project?rev=354166&view=rev Log: [Driver] Default all Android ARM targets to NEON. Summary: There are an insignificant number of ARM Android devices that don't support NEON. Default to using NEON since that will improve performance on the majority of devices. Users that need to target non-NEON devices can still explicitly disable NEON. Reviewers: srhines, pirama, kristof.beyls Reviewed By: pirama Subscribers: efriedma, javed.absar, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58153 Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp cfe/trunk/test/Driver/arm-mfpu.c Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp?rev=354166&r1=354165&r2=354166&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp Fri Feb 15 12:31:54 2019 @@ -378,9 +378,7 @@ void arm::getARMTargetFeatures(const Too } else if (FPUArg) { getARMFPUFeatures(D, FPUArg, Args, FPUArg->getValue(), Features); } else if (Triple.isAndroid() && getARMSubArchVersionNumber(Triple) >= 7) { -// Android mandates minimum FPU requirements based on OS version. -const char *AndroidFPU = -Triple.isAndroidVersionLT(23) ? "vfpv3-d16" : "neon"; +const char *AndroidFPU = "neon"; if (!llvm::ARM::getFPUFeatures(llvm::ARM::parseFPU(AndroidFPU), Features)) D.Diag(clang::diag::err_drv_clang_unsupported) << std::string("-mfpu=") + AndroidFPU; Modified: cfe/trunk/test/Driver/arm-mfpu.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-mfpu.c?rev=354166&r1=354165&r2=354166&view=diff == --- cfe/trunk/test/Driver/arm-mfpu.c (original) +++ cfe/trunk/test/Driver/arm-mfpu.c Fri Feb 15 12:31:54 2019 @@ -376,55 +376,23 @@ // CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+neon" // CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+crypto" -// RUN: %clang -target arm-linux-androideabi21 -march=armv7-a %s -### -c 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-MARCH-ARM7-ANDROID-FP %s -// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+soft-float" -// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+soft-float-abi" -// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+d16" -// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+vfp3" -// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+vfp4" -// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+fp-armv8" -// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+neon" -// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+crypto" - // RUN: %clang -target armv7-linux-androideabi21 %s -### -c 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-ARM-ANDROID-L-FP-DEFAULT %s -// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+soft-float" -// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+soft-float-abi" -// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+d16" -// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+vfp3" -// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+vfp4" -// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8" -// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+neon" -// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+crypto" - -// RUN: %clang -target armv7-linux-androideabi21 -mfpu=neon %s -### -c 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-ARM-ANDROID-L-FP-NEON %s -// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+soft-float" -// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+soft-float-abi" -// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+vfp3" -// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+vfp4" -// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+fp-armv8" -// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+neon" -// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+crypto" - -// RUN: %clang -target armv7-linux-androideabi23 %s -### -c 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-ARM-ANDROID-M-FP-DEFAULT %s -// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+soft-float" -// CHECK-ARM-ANDROID-M-FP-DEFAULT: "-target-feature" "+soft-float-abi" -// CHECK-ARM-ANDROID-M-FP-DEFAULT: "-target-feature" "+vfp3" -// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+vfp4" -// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8" -// CHECK-ARM-ANDROID-M-FP-DEFAULT: "-target-feature" "+neon" -// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+crypto" +// RUN: | FileCheck --check-prefix=CHECK-ARM7-ANDROID-FP-DEFAULT %s +// CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+soft-float" +// CHECK-ARM7-ANDROID-FP-DEFAULT: "-target-feature" "
r354622 - [Driver] Fix float ABI default for Android ARMv8.
Author: danalbert Date: Thu Feb 21 13:13:03 2019 New Revision: 354622 URL: http://llvm.org/viewvc/llvm-project?rev=354622&view=rev Log: [Driver] Fix float ABI default for Android ARMv8. Summary: Android doesn't regress back to soft float after ARMv7 :) Reviewers: srhines, pirama Reviewed By: srhines, pirama Subscribers: javed.absar, kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58477 Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp cfe/trunk/test/Driver/arm-float-abi.c Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp?rev=354622&r1=354621&r2=354622&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp Thu Feb 21 13:13:03 2019 @@ -248,7 +248,7 @@ arm::FloatABI arm::getARMFloatABI(const ABI = FloatABI::SoftFP; break; case llvm::Triple::Android: -ABI = (SubArch == 7) ? FloatABI::SoftFP : FloatABI::Soft; +ABI = (SubArch >= 7) ? FloatABI::SoftFP : FloatABI::Soft; break; default: // Assume "soft", but warn the user we are guessing. Modified: cfe/trunk/test/Driver/arm-float-abi.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-float-abi.c?rev=354622&r1=354621&r2=354622&view=diff == --- cfe/trunk/test/Driver/arm-float-abi.c (original) +++ cfe/trunk/test/Driver/arm-float-abi.c Thu Feb 21 13:13:03 2019 @@ -4,3 +4,13 @@ // ARMV7-ERROR: unsupported option '-mfloat-abi=hard' for target 'thumbv7' // NOERROR-NOT: unsupported option + +// RUN: %clang -target armv7-linux-androideabi21 %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM7-ANDROID %s +// CHECK-ARM7-ANDROID-NOT: "-target-feature" "+soft-float" +// CHECK-ARM7-ANDROID: "-target-feature" "+soft-float-abi" + +// RUN: %clang -target armv8-linux-androideabi21 %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM8-ANDROID %s +// CHECK-ARM8-ANDROID-NOT: "-target-feature" "+soft-float" +// CHECK-ARM8-ANDROID: "-target-feature" "+soft-float-abi" ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r349570 - [Driver] Also obey -nostdlib++ when rewriting -lstdc++.
Author: danalbert Date: Tue Dec 18 15:29:35 2018 New Revision: 349570 URL: http://llvm.org/viewvc/llvm-project?rev=349570&view=rev Log: [Driver] Also obey -nostdlib++ when rewriting -lstdc++. Reviewers: pirama Reviewed By: pirama Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55856 Modified: cfe/trunk/lib/Driver/Driver.cpp cfe/trunk/test/Driver/nostdlibxx.cpp Modified: cfe/trunk/lib/Driver/Driver.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=349570&r1=349569&r2=349570&view=diff == --- cfe/trunk/lib/Driver/Driver.cpp (original) +++ cfe/trunk/lib/Driver/Driver.cpp Tue Dec 18 15:29:35 2018 @@ -303,6 +303,7 @@ DerivedArgList *Driver::TranslateInputAr DerivedArgList *DAL = new DerivedArgList(Args); bool HasNostdlib = Args.hasArg(options::OPT_nostdlib); + bool HasNostdlibxx = Args.hasArg(options::OPT_nostdlibxx); bool HasNodefaultlib = Args.hasArg(options::OPT_nodefaultlibs); for (Arg *A : Args) { // Unfortunately, we have to parse some forwarding options (-Xassembler, @@ -347,7 +348,8 @@ DerivedArgList *Driver::TranslateInputAr StringRef Value = A->getValue(); // Rewrite unless -nostdlib is present. - if (!HasNostdlib && !HasNodefaultlib && Value == "stdc++") { + if (!HasNostdlib && !HasNodefaultlib && !HasNostdlibxx && + Value == "stdc++") { DAL->AddFlagArg(A, Opts->getOption(options::OPT_Z_reserved_lib_stdcxx)); continue; } Modified: cfe/trunk/test/Driver/nostdlibxx.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/nostdlibxx.cpp?rev=349570&r1=349569&r2=349570&view=diff == --- cfe/trunk/test/Driver/nostdlibxx.cpp (original) +++ cfe/trunk/test/Driver/nostdlibxx.cpp Tue Dec 18 15:29:35 2018 @@ -6,3 +6,12 @@ // CHECK-NOT: -lstdc++ // CHECK-NOT: -lc++ // CHECK: -lm + +// Make sure -lstdc++ isn't rewritten to the default stdlib when -nostdlib++ is +// used. +// +// RUN: %clangxx -target i686-pc-linux-gnu -### \ +// RUN: -nostdlib++ -stdlib=libc++ -lstdc++ %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-RESERVED-LIB-REWRITE < %t %s +// CHECK-RESERVED-LIB-REWRITE: -lstdc++ +// CHECK-RESERVED-LIB-REWRITE-NOT: -lc++ ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r350664 - Android is not GNU, so don't claim that it is.
Author: danalbert Date: Tue Jan 8 14:31:19 2019 New Revision: 350664 URL: http://llvm.org/viewvc/llvm-project?rev=350664&view=rev Log: Android is not GNU, so don't claim that it is. Reviewers: pirama, srhines Reviewed By: srhines Subscribers: kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D55953 Modified: cfe/trunk/lib/Basic/Targets/OSTargets.h cfe/trunk/test/Preprocessor/init.c Modified: cfe/trunk/lib/Basic/Targets/OSTargets.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/OSTargets.h?rev=350664&r1=350663&r2=350664&view=diff == --- cfe/trunk/lib/Basic/Targets/OSTargets.h (original) +++ cfe/trunk/lib/Basic/Targets/OSTargets.h Tue Jan 8 14:31:19 2019 @@ -345,7 +345,6 @@ protected: // 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 @@ protected: 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"); Modified: cfe/trunk/test/Preprocessor/init.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=350664&r1=350663&r2=350664&view=diff == --- cfe/trunk/test/Preprocessor/init.c (original) +++ cfe/trunk/test/Preprocessor/init.c Tue Jan 8 14:31:19 2019 @@ -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
r350668 - [Driver] Default to -fno-addrsig on Android.
Author: danalbert Date: Tue Jan 8 14:33:59 2019 New Revision: 350668 URL: http://llvm.org/viewvc/llvm-project?rev=350668&view=rev Log: [Driver] Default to -fno-addrsig on Android. Summary: The Android NDK still uses GNU binutils by default. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56456 Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp cfe/trunk/test/Driver/addrsig.c Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=350668&r1=350667&r2=350668&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Tue Jan 8 14:33:59 2019 @@ -5292,6 +5292,7 @@ void Clang::ConstructJob(Compilation &C, !TC.getTriple().isPS4() && !TC.getTriple().isOSNetBSD() && !Distro(D.getVFS()).IsGentoo() && + !TC.getTriple().isAndroid() && TC.useIntegratedAs())) CmdArgs.push_back("-faddrsig"); Modified: cfe/trunk/test/Driver/addrsig.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/addrsig.c?rev=350668&r1=350667&r2=350668&view=diff == --- cfe/trunk/test/Driver/addrsig.c (original) +++ cfe/trunk/test/Driver/addrsig.c Tue Jan 8 14:33:59 2019 @@ -8,6 +8,7 @@ // RUN: %clang -### -target x86_64-unknown-linux -fno-addrsig -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s // RUN: %clang -### -target x86_64-apple-darwin -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s // RUN: %clang -### -target x86_64-scei-ps4 -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s +// RUN: %clang -### -target x86_64-linux-android21 -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s // ADDRSIG: -faddrsig // NO-ADDRSIG-NOT: -faddrsig ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r330770 - [Driver] Android triples are not aliases for other triples.
Author: danalbert Date: Tue Apr 24 14:18:37 2018 New Revision: 330770 URL: http://llvm.org/viewvc/llvm-project?rev=330770&view=rev Log: [Driver] Android triples are not aliases for other triples. Summary: Android targets should never use tools/libraries for non-Android targets or vice versa. Reviewers: srhines, george.burgess.iv, eugenis Reviewed By: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45597 Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=330770&r1=330769&r2=330770&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Tue Apr 24 14:18:37 2018 @@ -1816,22 +1816,20 @@ void Generic_GCC::GCCInstallationDetecto // lifetime or initialization issues. static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; static const char *const AArch64Triples[] = { - "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-linux-android", - "aarch64-redhat-linux", "aarch64-suse-linux"}; + "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", + "aarch64-suse-linux"}; static const char *const AArch64beLibDirs[] = {"/lib"}; static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", "aarch64_be-linux-gnu"}; static const char *const ARMLibDirs[] = {"/lib"}; - static const char *const ARMTriples[] = {"arm-linux-gnueabi", - "arm-linux-androideabi"}; + static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", "armv7hl-redhat-linux-gnueabi", "armv6hl-suse-linux-gnueabi", "armv7hl-suse-linux-gnueabi"}; static const char *const ARMebLibDirs[] = {"/lib"}; - static const char *const ARMebTriples[] = {"armeb-linux-gnueabi", - "armeb-linux-androideabi"}; + static const char *const ARMebTriples[] = {"armeb-linux-gnueabi"}; static const char *const ARMebHFTriples[] = { "armeb-linux-gnueabihf", "armebv7hl-redhat-linux-gnueabi"}; @@ -1841,16 +1839,14 @@ void Generic_GCC::GCCInstallationDetecto "x86_64-pc-linux-gnu","x86_64-redhat-linux6E", "x86_64-redhat-linux","x86_64-suse-linux", "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", - "x86_64-slackware-linux", "x86_64-linux-android", - "x86_64-unknown-linux"}; + "x86_64-slackware-linux", "x86_64-unknown-linux"}; static const char *const X32LibDirs[] = {"/libx32"}; static const char *const X86LibDirs[] = {"/lib32", "/lib"}; static const char *const X86Triples[] = { "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", "i386-linux-gnu", "i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux","i386-redhat-linux", "i586-suse-linux", - "i486-slackware-linux", "i686-montavista-linux", "i686-linux-android", - "i586-linux-gnu"}; + "i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu"}; static const char *const MIPSLibDirs[] = {"/lib"}; static const char *const MIPSTriples[] = {"mips-linux-gnu", "mips-mti-linux", @@ -1869,13 +1865,6 @@ void Generic_GCC::GCCInstallationDetecto "mips64el-linux-gnu", "mips-mti-linux-gnu", "mips-img-linux-gnu", "mips64el-linux-gnuabi64"}; - static const char *const MIPSELAndroidLibDirs[] = {"/lib", "/libr2", - "/libr6"}; - static const char *const MIPSELAndroidTriples[] = {"mipsel-linux-android"}; - static const char *const MIPS64ELAndroidLibDirs[] = {"/lib64", "/lib", - "/libr2", "/libr6"}; - static const char *const MIPS64ELAndroidTriples[] = { - "mips64el-linux-android"}; static const char *const PPCLibDirs[] = {"/lib32", "/lib"}; static const char *const PPCTriples[] = { @@ -1952,6 +1941,66 @@ void Generic_GCC::GCCInstallationDetecto return; } + // Android targets should not use GNU/Linux tools or libraries. + if (TargetTriple.isAndroid()) { +static const char *const AArch64AndroidTriples[] = { +"aarch64-linux-android"}; +static const char *const ARMAndroidTriples[] = {"arm-linux-androideabi"}; +static const char *const MIPSELAndroidTriples[] = {"mipsel-linux-android"}; +static const char *const MIPS64ELAndroidTriples[] = { +"mips64el-linux-android"}; +static const char *const X86AndroidTriples[] = {"i686-linux-android"}; +static co
r330780 - Revert "[Driver] Android triples are not aliases for other triples."
Author: danalbert Date: Tue Apr 24 15:06:40 2018 New Revision: 330780 URL: http://llvm.org/viewvc/llvm-project?rev=330780&view=rev Log: Revert "[Driver] Android triples are not aliases for other triples." Revering while I diagnose the failures. This reverts commit 82dc3bf2157da280420f80e654292cb05e0dc5f7. Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=330780&r1=330779&r2=330780&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Tue Apr 24 15:06:40 2018 @@ -1816,20 +1816,22 @@ void Generic_GCC::GCCInstallationDetecto // lifetime or initialization issues. static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; static const char *const AArch64Triples[] = { - "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", - "aarch64-suse-linux"}; + "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-linux-android", + "aarch64-redhat-linux", "aarch64-suse-linux"}; static const char *const AArch64beLibDirs[] = {"/lib"}; static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", "aarch64_be-linux-gnu"}; static const char *const ARMLibDirs[] = {"/lib"}; - static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; + static const char *const ARMTriples[] = {"arm-linux-gnueabi", + "arm-linux-androideabi"}; static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", "armv7hl-redhat-linux-gnueabi", "armv6hl-suse-linux-gnueabi", "armv7hl-suse-linux-gnueabi"}; static const char *const ARMebLibDirs[] = {"/lib"}; - static const char *const ARMebTriples[] = {"armeb-linux-gnueabi"}; + static const char *const ARMebTriples[] = {"armeb-linux-gnueabi", + "armeb-linux-androideabi"}; static const char *const ARMebHFTriples[] = { "armeb-linux-gnueabihf", "armebv7hl-redhat-linux-gnueabi"}; @@ -1839,14 +1841,16 @@ void Generic_GCC::GCCInstallationDetecto "x86_64-pc-linux-gnu","x86_64-redhat-linux6E", "x86_64-redhat-linux","x86_64-suse-linux", "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", - "x86_64-slackware-linux", "x86_64-unknown-linux"}; + "x86_64-slackware-linux", "x86_64-linux-android", + "x86_64-unknown-linux"}; static const char *const X32LibDirs[] = {"/libx32"}; static const char *const X86LibDirs[] = {"/lib32", "/lib"}; static const char *const X86Triples[] = { "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", "i386-linux-gnu", "i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux","i386-redhat-linux", "i586-suse-linux", - "i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu"}; + "i486-slackware-linux", "i686-montavista-linux", "i686-linux-android", + "i586-linux-gnu"}; static const char *const MIPSLibDirs[] = {"/lib"}; static const char *const MIPSTriples[] = {"mips-linux-gnu", "mips-mti-linux", @@ -1865,6 +1869,13 @@ void Generic_GCC::GCCInstallationDetecto "mips64el-linux-gnu", "mips-mti-linux-gnu", "mips-img-linux-gnu", "mips64el-linux-gnuabi64"}; + static const char *const MIPSELAndroidLibDirs[] = {"/lib", "/libr2", + "/libr6"}; + static const char *const MIPSELAndroidTriples[] = {"mipsel-linux-android"}; + static const char *const MIPS64ELAndroidLibDirs[] = {"/lib64", "/lib", + "/libr2", "/libr6"}; + static const char *const MIPS64ELAndroidTriples[] = { + "mips64el-linux-android"}; static const char *const PPCLibDirs[] = {"/lib32", "/lib"}; static const char *const PPCTriples[] = { @@ -1941,66 +1952,6 @@ void Generic_GCC::GCCInstallationDetecto return; } - // Android targets should not use GNU/Linux tools or libraries. - if (TargetTriple.isAndroid()) { -static const char *const AArch64AndroidTriples[] = { -"aarch64-linux-android"}; -static const char *const ARMAndroidTriples[] = {"arm-linux-androideabi"}; -static const char *const MIPSELAndroidTriples[] = {"mipsel-linux-android"}; -static const char *const MIPS64ELAndroidTriples[] = { -"mips64el-linux-android"}; -static const char *const X86AndroidTriples[] = {"i686-linux-android"}; -static const char *const X86_64AndroidTriples[] = {"x86_64-linux-android"}; - -switch (TargetTriple.getArch()) { -case llvm::Triple::aarch
r330873 - [Driver] Reland "Android triples are not aliases for other triples."
Author: danalbert Date: Wed Apr 25 14:26:06 2018 New Revision: 330873 URL: http://llvm.org/viewvc/llvm-project?rev=330873&view=rev Log: [Driver] Reland "Android triples are not aliases for other triples." Fixed directory separators in tests to be compatible with both Windows and !Windows. This reverts commit aa423850afa4c16a53c4c492fe254dcad3d5a53e. Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=330873&r1=330872&r2=330873&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Wed Apr 25 14:26:06 2018 @@ -1816,22 +1816,20 @@ void Generic_GCC::GCCInstallationDetecto // lifetime or initialization issues. static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; static const char *const AArch64Triples[] = { - "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-linux-android", - "aarch64-redhat-linux", "aarch64-suse-linux"}; + "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", + "aarch64-suse-linux"}; static const char *const AArch64beLibDirs[] = {"/lib"}; static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", "aarch64_be-linux-gnu"}; static const char *const ARMLibDirs[] = {"/lib"}; - static const char *const ARMTriples[] = {"arm-linux-gnueabi", - "arm-linux-androideabi"}; + static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", "armv7hl-redhat-linux-gnueabi", "armv6hl-suse-linux-gnueabi", "armv7hl-suse-linux-gnueabi"}; static const char *const ARMebLibDirs[] = {"/lib"}; - static const char *const ARMebTriples[] = {"armeb-linux-gnueabi", - "armeb-linux-androideabi"}; + static const char *const ARMebTriples[] = {"armeb-linux-gnueabi"}; static const char *const ARMebHFTriples[] = { "armeb-linux-gnueabihf", "armebv7hl-redhat-linux-gnueabi"}; @@ -1841,16 +1839,14 @@ void Generic_GCC::GCCInstallationDetecto "x86_64-pc-linux-gnu","x86_64-redhat-linux6E", "x86_64-redhat-linux","x86_64-suse-linux", "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", - "x86_64-slackware-linux", "x86_64-linux-android", - "x86_64-unknown-linux"}; + "x86_64-slackware-linux", "x86_64-unknown-linux"}; static const char *const X32LibDirs[] = {"/libx32"}; static const char *const X86LibDirs[] = {"/lib32", "/lib"}; static const char *const X86Triples[] = { "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", "i386-linux-gnu", "i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux","i386-redhat-linux", "i586-suse-linux", - "i486-slackware-linux", "i686-montavista-linux", "i686-linux-android", - "i586-linux-gnu"}; + "i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu"}; static const char *const MIPSLibDirs[] = {"/lib"}; static const char *const MIPSTriples[] = {"mips-linux-gnu", "mips-mti-linux", @@ -1869,13 +1865,6 @@ void Generic_GCC::GCCInstallationDetecto "mips64el-linux-gnu", "mips-mti-linux-gnu", "mips-img-linux-gnu", "mips64el-linux-gnuabi64"}; - static const char *const MIPSELAndroidLibDirs[] = {"/lib", "/libr2", - "/libr6"}; - static const char *const MIPSELAndroidTriples[] = {"mipsel-linux-android"}; - static const char *const MIPS64ELAndroidLibDirs[] = {"/lib64", "/lib", - "/libr2", "/libr6"}; - static const char *const MIPS64ELAndroidTriples[] = { - "mips64el-linux-android"}; static const char *const PPCLibDirs[] = {"/lib32", "/lib"}; static const char *const PPCTriples[] = { @@ -1952,6 +1941,66 @@ void Generic_GCC::GCCInstallationDetecto return; } + // Android targets should not use GNU/Linux tools or libraries. + if (TargetTriple.isAndroid()) { +static const char *const AArch64AndroidTriples[] = { +"aarch64-linux-android"}; +static const char *const ARMAndroidTriples[] = {"arm-linux-androideabi"}; +static const char *const MIPSELAndroidTriples[] = {"mipsel-linux-android"}; +static const char *const MIPS64ELAndroidTriples[] = { +"mips64el-linux-android"}; +static const char *const X86AndroidTriples[] = {"i686-linux-android"}; +static const char *const X86_64AndroidTriples[] = {"x86_64-linux-android"}; + +switch (TargetTrip
r331389 - [Driver] Obey computed sysroot when finding libc++ headers.
Author: danalbert Date: Wed May 2 12:31:01 2018 New Revision: 331389 URL: http://llvm.org/viewvc/llvm-project?rev=331389&view=rev Log: [Driver] Obey computed sysroot when finding libc++ headers. Summary: A handful of targets will try some default paths if --sysroot is not provided. If that is the case, it should be used for the libc++ header paths. Reviewers: srhines, EricWF Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45292 Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=331389&r1=331388&r2=331389&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Wed May 2 12:31:01 2018 @@ -793,13 +793,14 @@ static std::string DetectLibcxxIncludePa void Linux::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const { + const std::string& SysRoot = computeSysRoot(); const std::string LibCXXIncludePathCandidates[] = { DetectLibcxxIncludePath(getDriver().Dir + "/../include/c++"), // If this is a development, non-installed, clang, libcxx will // not be found at ../include/c++ but it likely to be found at // one of the following two locations: - DetectLibcxxIncludePath(getDriver().SysRoot + "/usr/local/include/c++"), - DetectLibcxxIncludePath(getDriver().SysRoot + "/usr/include/c++") }; + DetectLibcxxIncludePath(SysRoot + "/usr/local/include/c++"), + DetectLibcxxIncludePath(SysRoot + "/usr/include/c++") }; for (const auto &IncludePath : LibCXXIncludePathCandidates) { if (IncludePath.empty() || !getVFS().exists(IncludePath)) continue; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r331390 - [Driver] Infer Android sysroot location.
Author: danalbert Date: Wed May 2 12:38:37 2018 New Revision: 331390 URL: http://llvm.org/viewvc/llvm-project?rev=331390&view=rev Log: [Driver] Infer Android sysroot location. Summary: Android toolchains include their headers and libraries in a self-contained directory within the toolchain. Reviewers: srhines Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45291 Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=331390&r1=331389&r2=331390&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Wed May 2 12:38:37 2018 @@ -429,6 +429,15 @@ std::string Linux::computeSysRoot() cons if (!getDriver().SysRoot.empty()) return getDriver().SysRoot; + if (getTriple().isAndroid()) { +// Android toolchains typically include a sysroot at ../sysroot relative to +// the clang binary. +const StringRef ClangDir = getDriver().getInstalledDir(); +std::string AndroidSysRootPath = (ClangDir + "/../sysroot").str(); +if (getVFS().exists(AndroidSysRootPath)) + return AndroidSysRootPath; + } + if (!GCCInstallation.isValid() || !tools::isMipsArch(getTriple().getArch())) return std::string(); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24690: Replace __ANDROID__ with __BIONIC__.
danalbert added a comment. In https://reviews.llvm.org/D24690#545523, @compnerd wrote: > So, the only thing that Im confused about is where does `__BIONIC__` get > defined? It's in Bionic's ``, which gets pulled in via ``. Comment at: include/__config:340 @@ -339,3 +344,1 @@ #if !defined(_LIBCPP_HAS_MUSL_LIBC) -# include -#if __GLIBC_PREREQ(2, 15) EricWF wrote: > What happened to this include? I believe it's needed to get `__GLIBC_PREREQ`. Included much earlier now (L90). We always needed this for Linux, and having it at the top of the file means we won't accidentally forget to include it for an earlier check. Comment at: include/__config:766 @@ -761,3 +765,3 @@ // Most unix variants have catopen. These are the specific ones that don't. -#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) +#if !defined(_WIN32) && !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) #define _LIBCPP_HAS_CATOPEN 1 compnerd wrote: > Not your fault, but `_WIN32` and `__unix__`? Im not sure if MinGW or cygwin > define both. That is odd. I would assume that `_WIN32` implies `!__unix__`. Repository: rL LLVM https://reviews.llvm.org/D24690 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24690: Replace __ANDROID__ with __BIONIC__.
danalbert added inline comments. Comment at: include/__config:90 @@ +89,3 @@ +#if defined(__linux__) +#include +#if !defined(__GLIBC_PREREQ) EricWF wrote: > Does MUSL libc have a `features.h`? This include was previously guarded by > if `!defined(_LIBCPP_HAS_MUSL_LIBC)`. Yep: https://github.com/wermut/musl/blob/master/include/features.h Repository: rL LLVM https://reviews.llvm.org/D24690 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r281921 - Replace __ANDROID__ with __BIONIC__.
Author: danalbert Date: Mon Sep 19 13:00:45 2016 New Revision: 281921 URL: http://llvm.org/viewvc/llvm-project?rev=281921&view=rev Log: Replace __ANDROID__ with __BIONIC__. Summary: None of these checks are specific to Android devices. If libc++ was used with Bionic on a normal Linux system these checks would still be needed. Reviewers: mclow.lists, EricWF Subscribers: compnerd, tberghammer, danalbert, srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D24690 Modified: libcxx/trunk/include/__config libcxx/trunk/include/support/android/locale_bionic.h libcxx/trunk/src/locale.cpp Modified: libcxx/trunk/include/__config URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=281921&r1=281920&r2=281921&view=diff == --- libcxx/trunk/include/__config (original) +++ libcxx/trunk/include/__config Mon Sep 19 13:00:45 2016 @@ -85,6 +85,13 @@ #define __is_identifier(__x) 1 #endif +// Need to detect which libc we're using if we're on Linux. +#if defined(__linux__) +#include +#if !defined(__GLIBC_PREREQ) +#define __GLIBC_PREREQ(a, b) 0 +#endif // !defined(__GLIBC_PREREQ) +#endif // defined(__linux__) #ifdef __LITTLE_ENDIAN__ #if __LITTLE_ENDIAN__ @@ -333,12 +340,9 @@ typedef __char32_t char32_t; #if defined(__FreeBSD__) #define _LIBCPP_HAS_QUICK_EXIT #define _LIBCPP_HAS_C11_FEATURES -#elif defined(__ANDROID__) -#define _LIBCPP_HAS_QUICK_EXIT #elif defined(__linux__) #if !defined(_LIBCPP_HAS_MUSL_LIBC) -# include -#if __GLIBC_PREREQ(2, 15) +#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__) #define _LIBCPP_HAS_QUICK_EXIT #endif #if __GLIBC_PREREQ(2, 17) @@ -759,7 +763,7 @@ template struct __static_asse #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) // Most unix variants have catopen. These are the specific ones that don't. -#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) +#if !defined(_WIN32) && !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) #define _LIBCPP_HAS_CATOPEN 1 #endif #endif @@ -885,7 +889,8 @@ extern "C" void __sanitizer_annotate_con #define _LIBCPP_HAS_NO_STDOUT #endif -#if defined(__ANDROID__) || defined(__CloudABI__) || defined(_LIBCPP_HAS_MUSL_LIBC) +#if defined(__BIONIC__) || defined(__CloudABI__) || \ +defined(_LIBCPP_HAS_MUSL_LIBC) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE #endif Modified: libcxx/trunk/include/support/android/locale_bionic.h URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/support/android/locale_bionic.h?rev=281921&r1=281920&r2=281921&view=diff == --- libcxx/trunk/include/support/android/locale_bionic.h (original) +++ libcxx/trunk/include/support/android/locale_bionic.h Mon Sep 19 13:00:45 2016 @@ -11,7 +11,7 @@ #ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H #define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H -#if defined(__ANDROID__) +#if defined(__BIONIC__) #ifdef __cplusplus extern "C" { @@ -27,5 +27,5 @@ extern "C" { #include #include -#endif // defined(__ANDROID__) +#endif // defined(__BIONIC__) #endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H Modified: libcxx/trunk/src/locale.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/locale.cpp?rev=281921&r1=281920&r2=281921&view=diff == --- libcxx/trunk/src/locale.cpp (original) +++ libcxx/trunk/src/locale.cpp Mon Sep 19 13:00:45 2016 @@ -28,7 +28,7 @@ #include "__sso_allocator" #if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) #include "support/win32/locale_win32.h" -#elif !defined(__ANDROID__) +#elif !defined(__BIONIC__) #include #endif #include ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24690: Replace __ANDROID__ with __BIONIC__.
This revision was automatically updated to reflect the committed changes. Closed by commit rL281921: Replace __ANDROID__ with __BIONIC__. (authored by danalbert). Changed prior to commit: https://reviews.llvm.org/D24690?vs=71714&id=71852#toc Repository: rL LLVM https://reviews.llvm.org/D24690 Files: libcxx/trunk/include/__config libcxx/trunk/include/support/android/locale_bionic.h libcxx/trunk/src/locale.cpp Index: libcxx/trunk/src/locale.cpp === --- libcxx/trunk/src/locale.cpp +++ libcxx/trunk/src/locale.cpp @@ -28,7 +28,7 @@ #include "__sso_allocator" #if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) #include "support/win32/locale_win32.h" -#elif !defined(__ANDROID__) +#elif !defined(__BIONIC__) #include #endif #include Index: libcxx/trunk/include/support/android/locale_bionic.h === --- libcxx/trunk/include/support/android/locale_bionic.h +++ libcxx/trunk/include/support/android/locale_bionic.h @@ -11,7 +11,7 @@ #ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H #define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H -#if defined(__ANDROID__) +#if defined(__BIONIC__) #ifdef __cplusplus extern "C" { @@ -27,5 +27,5 @@ #include #include -#endif // defined(__ANDROID__) +#endif // defined(__BIONIC__) #endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H Index: libcxx/trunk/include/__config === --- libcxx/trunk/include/__config +++ libcxx/trunk/include/__config @@ -85,6 +85,13 @@ #define __is_identifier(__x) 1 #endif +// Need to detect which libc we're using if we're on Linux. +#if defined(__linux__) +#include +#if !defined(__GLIBC_PREREQ) +#define __GLIBC_PREREQ(a, b) 0 +#endif // !defined(__GLIBC_PREREQ) +#endif // defined(__linux__) #ifdef __LITTLE_ENDIAN__ #if __LITTLE_ENDIAN__ @@ -333,12 +340,9 @@ #if defined(__FreeBSD__) #define _LIBCPP_HAS_QUICK_EXIT #define _LIBCPP_HAS_C11_FEATURES -#elif defined(__ANDROID__) -#define _LIBCPP_HAS_QUICK_EXIT #elif defined(__linux__) #if !defined(_LIBCPP_HAS_MUSL_LIBC) -# include -#if __GLIBC_PREREQ(2, 15) +#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__) #define _LIBCPP_HAS_QUICK_EXIT #endif #if __GLIBC_PREREQ(2, 17) @@ -759,7 +763,7 @@ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) // Most unix variants have catopen. These are the specific ones that don't. -#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) +#if !defined(_WIN32) && !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) #define _LIBCPP_HAS_CATOPEN 1 #endif #endif @@ -885,7 +889,8 @@ #define _LIBCPP_HAS_NO_STDOUT #endif -#if defined(__ANDROID__) || defined(__CloudABI__) || defined(_LIBCPP_HAS_MUSL_LIBC) +#if defined(__BIONIC__) || defined(__CloudABI__) || \ +defined(_LIBCPP_HAS_MUSL_LIBC) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE #endif Index: libcxx/trunk/src/locale.cpp === --- libcxx/trunk/src/locale.cpp +++ libcxx/trunk/src/locale.cpp @@ -28,7 +28,7 @@ #include "__sso_allocator" #if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) #include "support/win32/locale_win32.h" -#elif !defined(__ANDROID__) +#elif !defined(__BIONIC__) #include #endif #include Index: libcxx/trunk/include/support/android/locale_bionic.h === --- libcxx/trunk/include/support/android/locale_bionic.h +++ libcxx/trunk/include/support/android/locale_bionic.h @@ -11,7 +11,7 @@ #ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H #define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H -#if defined(__ANDROID__) +#if defined(__BIONIC__) #ifdef __cplusplus extern "C" { @@ -27,5 +27,5 @@ #include #include -#endif // defined(__ANDROID__) +#endif // defined(__BIONIC__) #endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H Index: libcxx/trunk/include/__config === --- libcxx/trunk/include/__config +++ libcxx/trunk/include/__config @@ -85,6 +85,13 @@ #define __is_identifier(__x) 1 #endif +// Need to detect which libc we're using if we're on Linux. +#if defined(__linux__) +#include +#if !defined(__GLIBC_PREREQ) +#define __GLIBC_PREREQ(a, b) 0 +#endif // !defined(__GLIBC_PREREQ) +#endif // defined(__linux__) #ifdef __LITTLE_ENDIAN__ #if __LITTLE_ENDIAN__ @@ -333,12 +340,9 @@ #if defined(__FreeBSD__) #define _LIBCPP_HAS_QUICK_EXIT #define _LIBCPP_HAS_C11_FEATURES -#elif defined(__ANDROID__) -#define _LIBCPP_HAS_QUICK_EXIT #elif defined(__linux__) #if !defined(_LIBCPP_HAS_MUSL_LIBC) -# include -#if __GLIBC_PREREQ(2, 15) +#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__) #define _LIBCPP_HAS_QUICK_EXIT #endif #if __GLIBC_PREREQ(2, 17) @@ -759,7 +763,7 @@ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH_
[PATCH] D24743: Fix signatures of fallback tow(upper|lower)_l.
danalbert created this revision. danalbert added reviewers: EricWF, mclow.lists. danalbert added a subscriber: cfe-commits. danalbert set the repository for this revision to rL LLVM. These functions take and return wint_t, not int: http://pubs.opengroup.org/onlinepubs/9699919799/functions/towupper.html Repository: rL LLVM https://reviews.llvm.org/D24743 Files: include/support/xlocale/__posix_l_fallback.h Index: include/support/xlocale/__posix_l_fallback.h === --- include/support/xlocale/__posix_l_fallback.h +++ include/support/xlocale/__posix_l_fallback.h @@ -124,11 +124,11 @@ return ::tolower(c); } -inline _LIBCPP_ALWAYS_INLINE int towupper_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towupper_l(wint_t c, locale_t) { return ::towupper(c); } -inline _LIBCPP_ALWAYS_INLINE int towlower_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towlower_l(wint_t c, locale_t) { return ::towlower(c); } Index: include/support/xlocale/__posix_l_fallback.h === --- include/support/xlocale/__posix_l_fallback.h +++ include/support/xlocale/__posix_l_fallback.h @@ -124,11 +124,11 @@ return ::tolower(c); } -inline _LIBCPP_ALWAYS_INLINE int towupper_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towupper_l(wint_t c, locale_t) { return ::towupper(c); } -inline _LIBCPP_ALWAYS_INLINE int towlower_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towlower_l(wint_t c, locale_t) { return ::towlower(c); } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r281936 - Fix signatures of fallback tow(upper|lower)_l.
Author: danalbert Date: Mon Sep 19 15:42:57 2016 New Revision: 281936 URL: http://llvm.org/viewvc/llvm-project?rev=281936&view=rev Log: Fix signatures of fallback tow(upper|lower)_l. Summary: These functions take and return wint_t, not int: http://pubs.opengroup.org/onlinepubs/9699919799/functions/towupper.html Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24743 Modified: libcxx/trunk/include/support/xlocale/__posix_l_fallback.h Modified: libcxx/trunk/include/support/xlocale/__posix_l_fallback.h URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/support/xlocale/__posix_l_fallback.h?rev=281936&r1=281935&r2=281936&view=diff == --- libcxx/trunk/include/support/xlocale/__posix_l_fallback.h (original) +++ libcxx/trunk/include/support/xlocale/__posix_l_fallback.h Mon Sep 19 15:42:57 2016 @@ -124,11 +124,11 @@ inline _LIBCPP_ALWAYS_INLINE int tolower return ::tolower(c); } -inline _LIBCPP_ALWAYS_INLINE int towupper_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towupper_l(wint_t c, locale_t) { return ::towupper(c); } -inline _LIBCPP_ALWAYS_INLINE int towlower_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towlower_l(wint_t c, locale_t) { return ::towlower(c); } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D24743: Fix signatures of fallback tow(upper|lower)_l.
This revision was automatically updated to reflect the committed changes. Closed by commit rL281936: Fix signatures of fallback tow(upper|lower)_l. (authored by danalbert). Changed prior to commit: https://reviews.llvm.org/D24743?vs=71871&id=71876#toc Repository: rL LLVM https://reviews.llvm.org/D24743 Files: libcxx/trunk/include/support/xlocale/__posix_l_fallback.h Index: libcxx/trunk/include/support/xlocale/__posix_l_fallback.h === --- libcxx/trunk/include/support/xlocale/__posix_l_fallback.h +++ libcxx/trunk/include/support/xlocale/__posix_l_fallback.h @@ -124,11 +124,11 @@ return ::tolower(c); } -inline _LIBCPP_ALWAYS_INLINE int towupper_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towupper_l(wint_t c, locale_t) { return ::towupper(c); } -inline _LIBCPP_ALWAYS_INLINE int towlower_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towlower_l(wint_t c, locale_t) { return ::towlower(c); } Index: libcxx/trunk/include/support/xlocale/__posix_l_fallback.h === --- libcxx/trunk/include/support/xlocale/__posix_l_fallback.h +++ libcxx/trunk/include/support/xlocale/__posix_l_fallback.h @@ -124,11 +124,11 @@ return ::tolower(c); } -inline _LIBCPP_ALWAYS_INLINE int towupper_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towupper_l(wint_t c, locale_t) { return ::towupper(c); } -inline _LIBCPP_ALWAYS_INLINE int towlower_l(int c, locale_t) { +inline _LIBCPP_ALWAYS_INLINE wint_t towlower_l(wint_t c, locale_t) { return ::towlower(c); } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] ANDROID: AArch64: Change default max-page-size from 4k to 16k (PR #70251)
DanAlbert wrote: I thought we'd decided to not do this yet. https://github.com/llvm/llvm-project/pull/70251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r310895 - Fix LLVMgold plugin name/path for non-Linux.
Author: danalbert Date: Mon Aug 14 16:19:38 2017 New Revision: 310895 URL: http://llvm.org/viewvc/llvm-project?rev=310895&view=rev Log: Fix LLVMgold plugin name/path for non-Linux. Summary: It's only named LLVMgold.so on Linux. Fix the name for Windows and Darwin. Also fix the path for Windows so binutils doesn't have to. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35739 Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=310895&r1=310894&r2=310895&view=diff == --- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Mon Aug 14 16:19:38 2017 @@ -376,8 +376,20 @@ void tools::AddGoldPlugin(const ToolChai // as gold requires -plugin to come before any -plugin-opt that -Wl might // forward. CmdArgs.push_back("-plugin"); - std::string Plugin = - ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold.so"; + +#if defined(LLVM_ON_WIN32) + const char *Suffix = ".dll"; +#elif defined(__APPLE__) + const char *Suffix = ".dylib"; +#else + const char *Suffix = ".so"; +#endif + + SmallString<1024> Plugin; + llvm::sys::path::native(Twine(ToolChain.getDriver().Dir) + + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" + + Suffix, + Plugin); CmdArgs.push_back(Args.MakeArgString(Plugin)); // Try to pass driver level flags relevant to LTO code generation down to ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r310903 - Revert "Fix LLVMgold plugin name/path for non-Linux."
Author: danalbert Date: Mon Aug 14 17:31:44 2017 New Revision: 310903 URL: http://llvm.org/viewvc/llvm-project?rev=310903&view=rev Log: Revert "Fix LLVMgold plugin name/path for non-Linux." Broke a test. Will fix the test and re-land later. Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=310903&r1=310902&r2=310903&view=diff == --- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Mon Aug 14 17:31:44 2017 @@ -376,20 +376,8 @@ void tools::AddGoldPlugin(const ToolChai // as gold requires -plugin to come before any -plugin-opt that -Wl might // forward. CmdArgs.push_back("-plugin"); - -#if defined(LLVM_ON_WIN32) - const char *Suffix = ".dll"; -#elif defined(__APPLE__) - const char *Suffix = ".dylib"; -#else - const char *Suffix = ".so"; -#endif - - SmallString<1024> Plugin; - llvm::sys::path::native(Twine(ToolChain.getDriver().Dir) + - "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" + - Suffix, - Plugin); + std::string Plugin = + ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold.so"; CmdArgs.push_back(Args.MakeArgString(Plugin)); // Try to pass driver level flags relevant to LTO code generation down to ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r310960 - Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""
Author: danalbert Date: Tue Aug 15 14:31:17 2017 New Revision: 310960 URL: http://llvm.org/viewvc/llvm-project?rev=310960&view=rev Log: Revert "Revert "Fix LLVMgold plugin name/path for non-Linux."" Summary: Relanding https://reviews.llvm.org/D35739 which was reverted because it broke the tests on non-Linux. The tests have been fixed to be platform agnostic, and additional tests have been added to make sure that the plugin has the correct extension on each platform (%pluginext doesn't work in CHECK lines). Reviewers: srhines, pirama Reviewed By: srhines Subscribers: emaste, mehdi_amini, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D36769 Added: cfe/trunk/test/Driver/lto-plugin-darwin.c cfe/trunk/test/Driver/lto-plugin-linux.c cfe/trunk/test/Driver/lto-plugin-windows.c Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp cfe/trunk/test/Driver/freebsd.c cfe/trunk/test/Driver/gold-lto.c cfe/trunk/test/Driver/lto.c cfe/trunk/test/Driver/thinlto.c Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=310960&r1=310959&r2=310960&view=diff == --- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Tue Aug 15 14:31:17 2017 @@ -376,8 +376,20 @@ void tools::AddGoldPlugin(const ToolChai // as gold requires -plugin to come before any -plugin-opt that -Wl might // forward. CmdArgs.push_back("-plugin"); - std::string Plugin = - ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold.so"; + +#if defined(LLVM_ON_WIN32) + const char *Suffix = ".dll"; +#elif defined(__APPLE__) + const char *Suffix = ".dylib"; +#else + const char *Suffix = ".so"; +#endif + + SmallString<1024> Plugin; + llvm::sys::path::native(Twine(ToolChain.getDriver().Dir) + + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" + + Suffix, + Plugin); CmdArgs.push_back(Args.MakeArgString(Plugin)); // Try to pass driver level flags relevant to LTO code generation down to Modified: cfe/trunk/test/Driver/freebsd.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/freebsd.c?rev=310960&r1=310959&r2=310960&view=diff == --- cfe/trunk/test/Driver/freebsd.c (original) +++ cfe/trunk/test/Driver/freebsd.c Tue Aug 15 14:31:17 2017 @@ -127,7 +127,7 @@ // RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-LTO %s -// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so +// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.{{dll|dylib|so}} // RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic -no-integrated-as 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s Modified: cfe/trunk/test/Driver/gold-lto.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/gold-lto.c?rev=310960&r1=310959&r2=310960&view=diff == --- cfe/trunk/test/Driver/gold-lto.c (original) +++ cfe/trunk/test/Driver/gold-lto.c Tue Aug 15 14:31:17 2017 @@ -3,14 +3,14 @@ // RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \ // RUN: -Wl,-plugin-opt=foo -O3 \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-64-BASIC -// CHECK-X86-64-BASIC: "-plugin" "{{.*}}/LLVMgold.so" +// CHECK-X86-64-BASIC: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}" // CHECK-X86-64-BASIC: "-plugin-opt=O3" // CHECK-X86-64-BASIC: "-plugin-opt=foo" // // RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \ // RUN: -march=corei7 -Wl,-plugin-opt=foo -Ofast \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-64-COREI7 -// CHECK-X86-64-COREI7: "-plugin" "{{.*}}/LLVMgold.so" +// CHECK-X86-64-COREI7: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}" // CHECK-X86-64-COREI7: "-plugin-opt=mcpu=corei7" // CHECK-X86-64-COREI7: "-plugin-opt=O3" // CHECK-X86-64-COREI7: "-plugin-opt=foo" @@ -18,11 +18,11 @@ // RUN: %clang -target arm-unknown-linux -### %t.o -flto 2>&1 \ // RUN: -march=armv7a -Wl,-plugin-opt=foo -O0 \ // RUN: | FileCheck %s --check-prefix=CHECK-ARM-V7A -// CHECK-ARM-V7A: "-plugin" "{{.*}}/LLVMgold.so" +// CHECK-ARM-V7A: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}" // CHECK-ARM-V7A: "-plugin-opt=mcpu=generic" // CHECK-ARM-V7A: "-plugin-opt=O0" // CHECK-ARM-V7A: "-plugin-opt=foo" // // RUN: %clang -target i686-linux-android -### %t.o -flto 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-ANDROID -// CHECK-X86-ANDROID: "-plugin" "{{.*}}/LLVMgold.so" +// CHECK-X86-ANDROID: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}" Added: cfe/trunk/test/Driver/lto-plugin-darwin.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-
r310966 - Add a target for new LTO plugin name tests.
Author: danalbert Date: Tue Aug 15 15:10:44 2017 New Revision: 310966 URL: http://llvm.org/viewvc/llvm-project?rev=310966&view=rev Log: Add a target for new LTO plugin name tests. Not all targets will use -plugin with -flto. Pick a fixed target so this works regardless of the default target (regardless of host OS, the toolchain should be picking the correct LTO plugin for a target that supports it). Modified: cfe/trunk/test/Driver/lto-plugin-darwin.c cfe/trunk/test/Driver/lto-plugin-linux.c cfe/trunk/test/Driver/lto-plugin-windows.c Modified: cfe/trunk/test/Driver/lto-plugin-darwin.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-darwin.c?rev=310966&r1=310965&r2=310966&view=diff == --- cfe/trunk/test/Driver/lto-plugin-darwin.c (original) +++ cfe/trunk/test/Driver/lto-plugin-darwin.c Tue Aug 15 15:10:44 2017 @@ -1,6 +1,6 @@ // Check that Darwin uses LLVMgold.dylib. // REQUIRES: system-darwin -// RUN: %clang -### %s -flto 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux -### %s -flto 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s // // CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.dylib" Modified: cfe/trunk/test/Driver/lto-plugin-linux.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-linux.c?rev=310966&r1=310965&r2=310966&view=diff == --- cfe/trunk/test/Driver/lto-plugin-linux.c (original) +++ cfe/trunk/test/Driver/lto-plugin-linux.c Tue Aug 15 15:10:44 2017 @@ -1,6 +1,6 @@ // Check that non-Windows, non-Darwin OSs use LLVMgold.so. // REQUIRES: !system-darwin && !system-windows -// RUN: %clang -### %s -flto 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux -### %s -flto 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s // // CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.so" Modified: cfe/trunk/test/Driver/lto-plugin-windows.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-windows.c?rev=310966&r1=310965&r2=310966&view=diff == --- cfe/trunk/test/Driver/lto-plugin-windows.c (original) +++ cfe/trunk/test/Driver/lto-plugin-windows.c Tue Aug 15 15:10:44 2017 @@ -1,6 +1,6 @@ // Check that Windows uses LLVMgold.dll. // REQUIRES: system-windows -// RUN: %clang -### %s -flto 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux -### %s -flto 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s // // CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.dll" ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r310976 - Revert "Add a target for new LTO plugin name tests."
Author: danalbert Date: Tue Aug 15 16:57:32 2017 New Revision: 310976 URL: http://llvm.org/viewvc/llvm-project?rev=310976&view=rev Log: Revert "Add a target for new LTO plugin name tests." Modified: cfe/trunk/test/Driver/lto-plugin-darwin.c cfe/trunk/test/Driver/lto-plugin-linux.c cfe/trunk/test/Driver/lto-plugin-windows.c Modified: cfe/trunk/test/Driver/lto-plugin-darwin.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-darwin.c?rev=310976&r1=310975&r2=310976&view=diff == --- cfe/trunk/test/Driver/lto-plugin-darwin.c (original) +++ cfe/trunk/test/Driver/lto-plugin-darwin.c Tue Aug 15 16:57:32 2017 @@ -1,6 +1,6 @@ // Check that Darwin uses LLVMgold.dylib. // REQUIRES: system-darwin -// RUN: %clang -target x86_64-unknown-linux -### %s -flto 2>&1 \ +// RUN: %clang -### %s -flto 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s // // CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.dylib" Modified: cfe/trunk/test/Driver/lto-plugin-linux.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-linux.c?rev=310976&r1=310975&r2=310976&view=diff == --- cfe/trunk/test/Driver/lto-plugin-linux.c (original) +++ cfe/trunk/test/Driver/lto-plugin-linux.c Tue Aug 15 16:57:32 2017 @@ -1,6 +1,6 @@ // Check that non-Windows, non-Darwin OSs use LLVMgold.so. // REQUIRES: !system-darwin && !system-windows -// RUN: %clang -target x86_64-unknown-linux -### %s -flto 2>&1 \ +// RUN: %clang -### %s -flto 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s // // CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.so" Modified: cfe/trunk/test/Driver/lto-plugin-windows.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-windows.c?rev=310976&r1=310975&r2=310976&view=diff == --- cfe/trunk/test/Driver/lto-plugin-windows.c (original) +++ cfe/trunk/test/Driver/lto-plugin-windows.c Tue Aug 15 16:57:32 2017 @@ -1,6 +1,6 @@ // Check that Windows uses LLVMgold.dll. // REQUIRES: system-windows -// RUN: %clang -target x86_64-unknown-linux -### %s -flto 2>&1 \ +// RUN: %clang -### %s -flto 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s // // CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.dll" ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r310977 - Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux."""
Author: danalbert Date: Tue Aug 15 16:57:34 2017 New Revision: 310977 URL: http://llvm.org/viewvc/llvm-project?rev=310977&view=rev Log: Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""" Removed: cfe/trunk/test/Driver/lto-plugin-darwin.c cfe/trunk/test/Driver/lto-plugin-linux.c cfe/trunk/test/Driver/lto-plugin-windows.c Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp cfe/trunk/test/Driver/freebsd.c cfe/trunk/test/Driver/gold-lto.c cfe/trunk/test/Driver/lto.c cfe/trunk/test/Driver/thinlto.c Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=310977&r1=310976&r2=310977&view=diff == --- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Tue Aug 15 16:57:34 2017 @@ -376,20 +376,8 @@ void tools::AddGoldPlugin(const ToolChai // as gold requires -plugin to come before any -plugin-opt that -Wl might // forward. CmdArgs.push_back("-plugin"); - -#if defined(LLVM_ON_WIN32) - const char *Suffix = ".dll"; -#elif defined(__APPLE__) - const char *Suffix = ".dylib"; -#else - const char *Suffix = ".so"; -#endif - - SmallString<1024> Plugin; - llvm::sys::path::native(Twine(ToolChain.getDriver().Dir) + - "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" + - Suffix, - Plugin); + std::string Plugin = + ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold.so"; CmdArgs.push_back(Args.MakeArgString(Plugin)); // Try to pass driver level flags relevant to LTO code generation down to Modified: cfe/trunk/test/Driver/freebsd.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/freebsd.c?rev=310977&r1=310976&r2=310977&view=diff == --- cfe/trunk/test/Driver/freebsd.c (original) +++ cfe/trunk/test/Driver/freebsd.c Tue Aug 15 16:57:34 2017 @@ -127,7 +127,7 @@ // RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-LTO %s -// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.{{dll|dylib|so}} +// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so // RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic -no-integrated-as 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s Modified: cfe/trunk/test/Driver/gold-lto.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/gold-lto.c?rev=310977&r1=310976&r2=310977&view=diff == --- cfe/trunk/test/Driver/gold-lto.c (original) +++ cfe/trunk/test/Driver/gold-lto.c Tue Aug 15 16:57:34 2017 @@ -3,14 +3,14 @@ // RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \ // RUN: -Wl,-plugin-opt=foo -O3 \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-64-BASIC -// CHECK-X86-64-BASIC: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}" +// CHECK-X86-64-BASIC: "-plugin" "{{.*}}/LLVMgold.so" // CHECK-X86-64-BASIC: "-plugin-opt=O3" // CHECK-X86-64-BASIC: "-plugin-opt=foo" // // RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \ // RUN: -march=corei7 -Wl,-plugin-opt=foo -Ofast \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-64-COREI7 -// CHECK-X86-64-COREI7: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}" +// CHECK-X86-64-COREI7: "-plugin" "{{.*}}/LLVMgold.so" // CHECK-X86-64-COREI7: "-plugin-opt=mcpu=corei7" // CHECK-X86-64-COREI7: "-plugin-opt=O3" // CHECK-X86-64-COREI7: "-plugin-opt=foo" @@ -18,11 +18,11 @@ // RUN: %clang -target arm-unknown-linux -### %t.o -flto 2>&1 \ // RUN: -march=armv7a -Wl,-plugin-opt=foo -O0 \ // RUN: | FileCheck %s --check-prefix=CHECK-ARM-V7A -// CHECK-ARM-V7A: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}" +// CHECK-ARM-V7A: "-plugin" "{{.*}}/LLVMgold.so" // CHECK-ARM-V7A: "-plugin-opt=mcpu=generic" // CHECK-ARM-V7A: "-plugin-opt=O0" // CHECK-ARM-V7A: "-plugin-opt=foo" // // RUN: %clang -target i686-linux-android -### %t.o -flto 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-ANDROID -// CHECK-X86-ANDROID: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}" +// CHECK-X86-ANDROID: "-plugin" "{{.*}}/LLVMgold.so" Removed: cfe/trunk/test/Driver/lto-plugin-darwin.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-darwin.c?rev=310976&view=auto == --- cfe/trunk/test/Driver/lto-plugin-darwin.c (original) +++ cfe/trunk/test/Driver/lto-plugin-darwin.c (removed) @@ -1,6 +0,0 @@ -// Check that Darwin uses LLVMgold.dylib. -// REQUIRES: system-darwin -// RUN: %clang -### %s -flto 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s -// -// CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold
r311487 - Revert "Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""""
Author: danalbert Date: Tue Aug 22 14:05:01 2017 New Revision: 311487 URL: http://llvm.org/viewvc/llvm-project?rev=311487&view=rev Log: Revert "Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux. With tests fixed for Windows style paths now that they are going through path canonicalization. Added: cfe/trunk/test/Driver/lto-plugin-darwin.c cfe/trunk/test/Driver/lto-plugin-linux.c cfe/trunk/test/Driver/lto-plugin-windows.c Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp cfe/trunk/test/Driver/freebsd.c cfe/trunk/test/Driver/gold-lto.c cfe/trunk/test/Driver/lto.c cfe/trunk/test/Driver/thinlto.c Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=311487&r1=311486&r2=311487&view=diff == --- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Tue Aug 22 14:05:01 2017 @@ -376,8 +376,20 @@ void tools::AddGoldPlugin(const ToolChai // as gold requires -plugin to come before any -plugin-opt that -Wl might // forward. CmdArgs.push_back("-plugin"); - std::string Plugin = - ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold.so"; + +#if defined(LLVM_ON_WIN32) + const char *Suffix = ".dll"; +#elif defined(__APPLE__) + const char *Suffix = ".dylib"; +#else + const char *Suffix = ".so"; +#endif + + SmallString<1024> Plugin; + llvm::sys::path::native(Twine(ToolChain.getDriver().Dir) + + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" + + Suffix, + Plugin); CmdArgs.push_back(Args.MakeArgString(Plugin)); // Try to pass driver level flags relevant to LTO code generation down to Modified: cfe/trunk/test/Driver/freebsd.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/freebsd.c?rev=311487&r1=311486&r2=311487&view=diff == --- cfe/trunk/test/Driver/freebsd.c (original) +++ cfe/trunk/test/Driver/freebsd.c Tue Aug 22 14:05:01 2017 @@ -127,7 +127,7 @@ // RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-LTO %s -// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so +// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}} // RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic -no-integrated-as 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s Modified: cfe/trunk/test/Driver/gold-lto.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/gold-lto.c?rev=311487&r1=311486&r2=311487&view=diff == --- cfe/trunk/test/Driver/gold-lto.c (original) +++ cfe/trunk/test/Driver/gold-lto.c Tue Aug 22 14:05:01 2017 @@ -3,14 +3,14 @@ // RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \ // RUN: -Wl,-plugin-opt=foo -O3 \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-64-BASIC -// CHECK-X86-64-BASIC: "-plugin" "{{.*}}/LLVMgold.so" +// CHECK-X86-64-BASIC: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}" // CHECK-X86-64-BASIC: "-plugin-opt=O3" // CHECK-X86-64-BASIC: "-plugin-opt=foo" // // RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \ // RUN: -march=corei7 -Wl,-plugin-opt=foo -Ofast \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-64-COREI7 -// CHECK-X86-64-COREI7: "-plugin" "{{.*}}/LLVMgold.so" +// CHECK-X86-64-COREI7: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}" // CHECK-X86-64-COREI7: "-plugin-opt=mcpu=corei7" // CHECK-X86-64-COREI7: "-plugin-opt=O3" // CHECK-X86-64-COREI7: "-plugin-opt=foo" @@ -18,11 +18,11 @@ // RUN: %clang -target arm-unknown-linux -### %t.o -flto 2>&1 \ // RUN: -march=armv7a -Wl,-plugin-opt=foo -O0 \ // RUN: | FileCheck %s --check-prefix=CHECK-ARM-V7A -// CHECK-ARM-V7A: "-plugin" "{{.*}}/LLVMgold.so" +// CHECK-ARM-V7A: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}" // CHECK-ARM-V7A: "-plugin-opt=mcpu=generic" // CHECK-ARM-V7A: "-plugin-opt=O0" // CHECK-ARM-V7A: "-plugin-opt=foo" // // RUN: %clang -target i686-linux-android -### %t.o -flto 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-ANDROID -// CHECK-X86-ANDROID: "-plugin" "{{.*}}/LLVMgold.so" +// CHECK-X86-ANDROID: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}" Added: cfe/trunk/test/Driver/lto-plugin-darwin.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-darwin.c?rev=311487&view=auto == --- cfe/trunk/test/Driver/lto-plugin-darwin.c (added) +++ cfe/trunk/test/Driver/lto-plugin-darwin.c Tue Aug 22 14:05:01 2017 @@ -0,0 +1,6 @@ +// Check that Darwin uses LLVMgold.dylib. +// REQUIRES: syste
r311488 - Degeneralize more tests.
Author: danalbert Date: Tue Aug 22 14:16:22 2017 New Revision: 311488 URL: http://llvm.org/viewvc/llvm-project?rev=311488&view=rev Log: Degeneralize more tests. As before, not every platform supports LTO. Make sure the platform we're targeting is one that supports it (regardless of the *host* platform). Modified: cfe/trunk/test/Driver/lto-plugin-darwin.c cfe/trunk/test/Driver/lto-plugin-linux.c cfe/trunk/test/Driver/lto-plugin-windows.c Modified: cfe/trunk/test/Driver/lto-plugin-darwin.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-darwin.c?rev=311488&r1=311487&r2=311488&view=diff == --- cfe/trunk/test/Driver/lto-plugin-darwin.c (original) +++ cfe/trunk/test/Driver/lto-plugin-darwin.c Tue Aug 22 14:16:22 2017 @@ -1,6 +1,6 @@ // Check that Darwin uses LLVMgold.dylib. // REQUIRES: system-darwin -// RUN: %clang -### %s -flto 2>&1 \ +// RUN: %clang -### %s -target x86_64-unknown-linux -flto 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s // // CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.dylib" Modified: cfe/trunk/test/Driver/lto-plugin-linux.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-linux.c?rev=311488&r1=311487&r2=311488&view=diff == --- cfe/trunk/test/Driver/lto-plugin-linux.c (original) +++ cfe/trunk/test/Driver/lto-plugin-linux.c Tue Aug 22 14:16:22 2017 @@ -1,6 +1,6 @@ // Check that non-Windows, non-Darwin OSs use LLVMgold.so. // REQUIRES: !system-darwin && !system-windows -// RUN: %clang -### %s -flto 2>&1 \ +// RUN: %clang -### %s -target x86_64-unknown-linux -flto 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s // // CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.so" Modified: cfe/trunk/test/Driver/lto-plugin-windows.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-plugin-windows.c?rev=311488&r1=311487&r2=311488&view=diff == --- cfe/trunk/test/Driver/lto-plugin-windows.c (original) +++ cfe/trunk/test/Driver/lto-plugin-windows.c Tue Aug 22 14:16:22 2017 @@ -1,6 +1,6 @@ // Check that Windows uses LLVMgold.dll. // REQUIRES: system-windows -// RUN: %clang -### %s -flto 2>&1 \ +// RUN: %clang -### %s -target x86_64-unknown-linux -flto 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s // // CHECK-LTO-PLUGIN: "-plugin" "{{.*}}\\LLVMgold.dll" ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r311487 - Revert "Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""""
r311488 was submitted moments later and should fix this (one of the other buildbots caught this really quickly). On Tue, Aug 22, 2017 at 3:09 PM, Adrian Prantl wrote: > > > On Aug 22, 2017, at 2:05 PM, Dan Albert via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > > > > Author: danalbert > > Date: Tue Aug 22 14:05:01 2017 > > New Revision: 311487 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=311487&view=rev > > Log: > > Revert "Revert "Revert "Revert "Fix LLVMgold plugin name/path for > non-Linux."""" > > > > With tests fixed for Windows style paths now that they are going > > through path canonicalization. > > > > Added: > >cfe/trunk/test/Driver/lto-plugin-darwin.c > > This test fails on green dragon. Could you please take a look? > > http://green.lab.llvm.org/green/job/clang-stage1-configure-RA_check/34792/ > consoleFull#11650695138254eaf0-7326-4999-85b0-388101f2d404 > > -- adrian > > >cfe/trunk/test/Driver/lto-plugin-linux.c > >cfe/trunk/test/Driver/lto-plugin-windows.c > > Modified: > >cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp > >cfe/trunk/test/Driver/freebsd.c > >cfe/trunk/test/Driver/gold-lto.c > >cfe/trunk/test/Driver/lto.c > >cfe/trunk/test/Driver/thinlto.c > > > > Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp > > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ > ToolChains/CommonArgs.cpp?rev=311487&r1=311486&r2=311487&view=diff > > > == > > --- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original) > > +++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Tue Aug 22 14:05:01 > 2017 > > @@ -376,8 +376,20 @@ void tools::AddGoldPlugin(const ToolChai > > // as gold requires -plugin to come before any -plugin-opt that -Wl > might > > // forward. > > CmdArgs.push_back("-plugin"); > > - std::string Plugin = > > - ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX > "/LLVMgold.so"; > > + > > +#if defined(LLVM_ON_WIN32) > > + const char *Suffix = ".dll"; > > +#elif defined(__APPLE__) > > + const char *Suffix = ".dylib"; > > +#else > > + const char *Suffix = ".so"; > > +#endif > > + > > + SmallString<1024> Plugin; > > + llvm::sys::path::native(Twine(ToolChain.getDriver().Dir) + > > + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" > + > > + Suffix, > > + Plugin); > > CmdArgs.push_back(Args.MakeArgString(Plugin)); > > > > // Try to pass driver level flags relevant to LTO code generation down > to > > > > Modified: cfe/trunk/test/Driver/freebsd.c > > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/ > freebsd.c?rev=311487&r1=311486&r2=311487&view=diff > > > == > > --- cfe/trunk/test/Driver/freebsd.c (original) > > +++ cfe/trunk/test/Driver/freebsd.c Tue Aug 22 14:05:01 2017 > > @@ -127,7 +127,7 @@ > > > > // RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto 2>&1 \ > > // RUN: | FileCheck --check-prefix=CHECK-LTO %s > > -// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so > > +// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}{{[/\\]}} > LLVMgold.{{dll|dylib|so}} > > > > // RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic > -no-integrated-as 2>&1 \ > > // RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s > > > > Modified: cfe/trunk/test/Driver/gold-lto.c > > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/ > gold-lto.c?rev=311487&r1=311486&r2=311487&view=diff > > > == > > --- cfe/trunk/test/Driver/gold-lto.c (original) > > +++ cfe/trunk/test/Driver/gold-lto.c Tue Aug 22 14:05:01 2017 > > @@ -3,14 +3,14 @@ > > // RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \ > > // RUN: -Wl,-plugin-opt=foo -O3 \ > > // RUN: | FileCheck %s --check-prefix=CHECK-X86-64-BASIC > > -// CHECK-X86-64-BASIC: "-plugin" "{{.*}}/LLVMgold.so" > > +// CHECK-X86-64-BASIC: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{ > dll|dylib|so}}" > > // CHECK-X86-64-BASIC: "-plugin-opt=O3" >
[clang] 0849047 - Add a less ambiguous macro for Android version.
Author: Dan Albert Date: 2020-12-02T13:26:28-08:00 New Revision: 0849047860a343d8bcf1f828a82d585e89079943 URL: https://github.com/llvm/llvm-project/commit/0849047860a343d8bcf1f828a82d585e89079943 DIFF: https://github.com/llvm/llvm-project/commit/0849047860a343d8bcf1f828a82d585e89079943.diff LOG: Add a less ambiguous macro for Android version. Android has a handful of API levels relevant to developers described here: https://developer.android.com/studio/build#module-level. `__ANDROID_API__` is too vague and confuses a lot of people. Introduce a new macro name that is explicit about which one it represents. Keep the old name around because code has been using it for a decade. Added: Modified: clang/lib/Basic/Targets/OSTargets.h clang/test/Preprocessor/init.c Removed: diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h index 60e47bcacbf4..0d5d6f553093 100644 --- a/clang/lib/Basic/Targets/OSTargets.h +++ b/clang/lib/Basic/Targets/OSTargets.h @@ -383,8 +383,12 @@ class LLVM_LIBRARY_VISIBILITY LinuxTargetInfo : public OSTargetInfo { Triple.getEnvironmentVersion(Maj, Min, Rev); this->PlatformName = "android"; this->PlatformMinVersion = VersionTuple(Maj, Min, Rev); - if (Maj) -Builder.defineMacro("__ANDROID_API__", Twine(Maj)); + if (Maj) { +Builder.defineMacro("__ANDROID_MIN_SDK_VERSION__", Twine(Maj)); +// This historical but ambiguous name for the minSdkVersion macro. Keep +// defined for compatibility. +Builder.defineMacro("__ANDROID_API__", "__ANDROID_MIN_SDK_VERSION__"); + } } else { Builder.defineMacro("__gnu_linux__"); } diff --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c index 079ec6e021f8..e599d9afb42e 100644 --- a/clang/test/Preprocessor/init.c +++ b/clang/test/Preprocessor/init.c @@ -1397,6 +1397,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-NOT:#define __ANDROID_MIN_SDK_VERSION__ // ANDROID:#define __ANDROID__ 1 // ANDROID-NOT:#define __gnu_linux__ // @@ -1407,7 +1408,8 @@ // X86_64-ANDROID-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL // // 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_API__ __ANDROID_MIN_SDK_VERSION__ +// ANDROID20:#define __ANDROID_MIN_SDK_VERSION__ 20 // ANDROID20:#define __ANDROID__ 1 // ANDROID-NOT:#define __gnu_linux__ // ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r329234 - [Driver] Include the Android multiarch includes.
Author: danalbert Date: Wed Apr 4 14:28:34 2018 New Revision: 329234 URL: http://llvm.org/viewvc/llvm-project?rev=329234&view=rev Log: [Driver] Include the Android multiarch includes. Summary: Most Android headers live in a single directory, but a small handful live in multiarch directories. Reviewers: srhines Reviewed By: srhines Subscribers: javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D44995 Added: cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/include/c++/4.9/x86_64-linux-android/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/include/c++/4.9/x86_64-linux-android/.keep cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/lib/gcc/x86_64-linux-android/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/lib/gcc/x86_64-linux-android/4.9/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/lib/gcc/x86_64-linux-android/4.9/crtbegin.o cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/lib/gcc/x86_64-linux-android/4.9/crtend.o cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/lib/gcc/x86_64-linux-android/4.9/include/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/lib/gcc/x86_64-linux-android/4.9/include/.keep cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/aarch64-linux-android/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/aarch64-linux-android/.keep cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/arm-linux-androideabi/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/arm-linux-androideabi/.keep cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/i686-linux-android/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/i686-linux-android/.keep cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/x86_64-linux-android/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/sysroot/usr/include/x86_64-linux-android/.keep cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/x86_64-linux-android/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/x86_64-linux-android/bin/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/x86_64-linux-android/bin/ld cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/x86_64-linux-android/bin/ld.bfd cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/x86_64-linux-android/bin/ld.gold cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/x86_64-linux-android/lib/ cfe/trunk/test/Driver/Inputs/basic_android_ndk_tree/x86_64-linux-android/lib/.keep Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/test/Driver/android-ndk-standalone.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=329234&r1=329233&r2=329234&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Wed Apr 4 14:28:34 2018 @@ -42,6 +42,7 @@ static std::string getMultiarchTriple(co StringRef SysRoot) { llvm::Triple::EnvironmentType TargetEnvironment = TargetTriple.getEnvironment(); + bool IsAndroid = TargetTriple.isAndroid(); // For most architectures, just use whatever we have rather than trying to be // clever. @@ -55,7 +56,9 @@ static std::string getMultiarchTriple(co // regardless of what the actual target triple is. case llvm::Triple::arm: case llvm::Triple::thumb: -if (TargetEnvironment == llvm::Triple::GNUEABIHF) { +if (IsAndroid) { + return "arm-linux-androideabi"; +} else if (TargetEnvironment == llvm::Triple::GNUEABIHF) { if (D.getVFS().exists(SysRoot + "/lib/arm-linux-gnueabihf")) return "arm-linux-gnueabihf"; } else { @@ -74,16 +77,22 @@ static std::string getMultiarchTriple(co } break; case llvm::Triple::x86: +if (IsAndroid) + return "i686-linux-android"; if (D.getVFS().exists(SysRoot + "/lib/i386-linux-gnu")) return "i386-linux-gnu"; break; case llvm::Triple::x86_64: +if (IsAndroid) + return "x86_64-linux-android"; // We don't want this for x32, otherwise it will match x86_64 libs if (TargetEnvironment != llvm::Triple::GNUX32 && D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnu")) return "x86_64-linux-gnu"; break; case llvm::Triple::aarch64: +if (IsAndroid) + return "aarch64-linux-android"; if (D.getVFS().exists(SysRoot + "/lib/aarch64-linux-gnu")) return "aarch64-linux-gnu"; break; @@ -96,6 +105,8 @@ static std::string getMultiarchTriple(co return "mips-linux-gnu"; break; case llvm::Triple::mipsel: +if (IsAndroid) + return "mipsel-linux-android"; if (D.getVFS().exists(SysRoot + "/lib/mipsel-linux-gnu")) r
[libcxx] r317124 - [libc++] Don't alias quick_exit if __ANDROID_API__ < 21
Author: danalbert Date: Wed Nov 1 14:17:56 2017 New Revision: 317124 URL: http://llvm.org/viewvc/llvm-project?rev=317124&view=rev Log: [libc++] Don't alias quick_exit if __ANDROID_API__ < 21 Summary: quick_exit() and at_quick_exit() were introduced in android NDK 21: https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/stdlib.h#55 This CL conditions `_LIBCPP_HAS_QUICK_EXIT` on `__ANDROID_API__ >= 21`. The only place this macro is used is in some using declarations: `using ::quick_exit`, `using ::at_quick_exit`. Also, add a missing include to sys/cdefs.h which is what defines `__BIONIC__`. Reviewers: thakis, danalbert, EricWF Reviewed By: danalbert Subscribers: srhines, krytarowski Differential Revision: https://reviews.llvm.org/D39479 Modified: libcxx/trunk/include/__config Modified: libcxx/trunk/include/__config URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=317124&r1=317123&r2=317124&view=diff == --- libcxx/trunk/include/__config (original) +++ libcxx/trunk/include/__config Wed Nov 1 14:17:56 2017 @@ -296,6 +296,10 @@ #define _LIBCPP_NO_CFI #endif +#if __libcpp_has_include() +#include +#endif + #if defined(_LIBCPP_COMPILER_CLANG) // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for @@ -407,7 +411,7 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_C11_FEATURES #elif defined(__linux__) #if !defined(_LIBCPP_HAS_MUSL_LIBC) -#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__) +#if __GLIBC_PREREQ(2, 15) || (defined(__BIONIC__) && (__ANDROID_API__ >= 21)) #define _LIBCPP_HAS_QUICK_EXIT #endif #if __GLIBC_PREREQ(2, 17) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r317125 - [libunwind] Don't use dl_iterate_phdr if __ANDROID_API__ < 21
Author: danalbert Date: Wed Nov 1 14:26:06 2017 New Revision: 317125 URL: http://llvm.org/viewvc/llvm-project?rev=317125&view=rev Log: [libunwind] Don't use dl_iterate_phdr if __ANDROID_API__ < 21 Summary: On ARM, dl_iterate_phdr is only implemented in the Android NDK version 21 or later: https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/link.h#55 Reviewers: thakis, danalbert Reviewed By: danalbert Subscribers: dtzWill, aemerson, srhines, kristof.beyls Differential Revision: https://reviews.llvm.org/D39468 Modified: libunwind/trunk/src/AddressSpace.hpp Modified: libunwind/trunk/src/AddressSpace.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/AddressSpace.hpp?rev=317125&r1=317124&r2=317125&view=diff == --- libunwind/trunk/src/AddressSpace.hpp (original) +++ libunwind/trunk/src/AddressSpace.hpp Wed Nov 1 14:26:06 2017 @@ -393,6 +393,14 @@ inline bool LocalAddressSpace::findUnwin } } return false; +#elif defined(_LIBUNWIND_ARM_EHABI) && defined(__BIONIC__) && \ +(__ANDROID_API__ < 21) + int length = 0; + info.arm_section = + (uintptr_t)dl_unwind_find_exidx((_Unwind_Ptr)targetAddr, &length); + info.arm_section_length = (uintptr_t)length; + if (info.arm_section && info.arm_section_length) +return true; #elif defined(_LIBUNWIND_ARM_EHABI) || defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) struct dl_iterate_cb_data { LocalAddressSpace *addressSpace; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r317142 - Revert "[libc++] Don't alias quick_exit if __ANDROID_API__ < 21"
Author: danalbert Date: Wed Nov 1 16:43:07 2017 New Revision: 317142 URL: http://llvm.org/viewvc/llvm-project?rev=317142&view=rev Log: Revert "[libc++] Don't alias quick_exit if __ANDROID_API__ < 21" Broke the Darwin build bots. This reverts commit f56f1bba1ade4a408d403ff050d50e837bae47df. Modified: libcxx/trunk/include/__config Modified: libcxx/trunk/include/__config URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=317142&r1=317141&r2=317142&view=diff == --- libcxx/trunk/include/__config (original) +++ libcxx/trunk/include/__config Wed Nov 1 16:43:07 2017 @@ -296,10 +296,6 @@ #define _LIBCPP_NO_CFI #endif -#if __libcpp_has_include() -#include -#endif - #if defined(_LIBCPP_COMPILER_CLANG) // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for @@ -411,7 +407,7 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_C11_FEATURES #elif defined(__linux__) #if !defined(_LIBCPP_HAS_MUSL_LIBC) -#if __GLIBC_PREREQ(2, 15) || (defined(__BIONIC__) && (__ANDROID_API__ >= 21)) +#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__) #define _LIBCPP_HAS_QUICK_EXIT #endif #if __GLIBC_PREREQ(2, 17) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D23524: [libc++abi] Fix backtrace_test.pass.cpp failure seemingly caused by inlining differences.
danalbert added a comment. Maybe `__attribute__((noinline))` every function instead? https://reviews.llvm.org/D23524 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24690: Replace __ANDROID__ with __BIONIC__.
danalbert created this revision. danalbert added reviewers: EricWF, mclow.lists. danalbert added a subscriber: cfe-commits. danalbert set the repository for this revision to rL LLVM. Herald added subscribers: srhines, danalbert, tberghammer. None of these checks are specific to Android devices. If libc++ was used with Bionic on a normal Linux system these checks would still be needed. Repository: rL LLVM https://reviews.llvm.org/D24690 Files: include/__config include/support/android/locale_bionic.h src/locale.cpp Index: src/locale.cpp === --- src/locale.cpp +++ src/locale.cpp @@ -28,7 +28,7 @@ #include "__sso_allocator" #if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) #include "support/win32/locale_win32.h" -#elif !defined(__ANDROID__) +#elif !defined(__BIONIC__) #include #endif #include Index: include/support/android/locale_bionic.h === --- include/support/android/locale_bionic.h +++ include/support/android/locale_bionic.h @@ -11,7 +11,7 @@ #ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H #define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H -#if defined(__ANDROID__) +#if defined(__BIONIC__) #ifdef __cplusplus extern "C" { @@ -27,5 +27,5 @@ #include #include -#endif // defined(__ANDROID__) +#endif // defined(__BIONIC__) #endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H Index: include/__config === --- include/__config +++ include/__config @@ -85,6 +85,13 @@ #define __is_identifier(__x) 1 #endif +// Need to detect which libc we're using if we're on Linux. +#if defined(__linux__) +#include +#if !defined(__GLIBC_PREREQ) +#define __GLIBC_PREREQ(a, b) 0 +#endif // !defined(__GLIBC_PREREQ) +#endif // defined(__linux__) #ifdef __LITTLE_ENDIAN__ #if __LITTLE_ENDIAN__ @@ -333,12 +340,9 @@ #if defined(__FreeBSD__) #define _LIBCPP_HAS_QUICK_EXIT #define _LIBCPP_HAS_C11_FEATURES -#elif defined(__ANDROID__) -#define _LIBCPP_HAS_QUICK_EXIT #elif defined(__linux__) #if !defined(_LIBCPP_HAS_MUSL_LIBC) -# include -#if __GLIBC_PREREQ(2, 15) +#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__) #define _LIBCPP_HAS_QUICK_EXIT #endif #if __GLIBC_PREREQ(2, 17) @@ -759,7 +763,7 @@ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) // Most unix variants have catopen. These are the specific ones that don't. -#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) +#if !defined(_WIN32) && !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) #define _LIBCPP_HAS_CATOPEN 1 #endif #endif @@ -885,7 +889,8 @@ #define _LIBCPP_HAS_NO_STDOUT #endif -#if defined(__ANDROID__) || defined(__CloudABI__) || defined(_LIBCPP_HAS_MUSL_LIBC) +#if defined(__BIONIC__) || defined(__CloudABI__) || \ +defined(_LIBCPP_HAS_MUSL_LIBC) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE #endif Index: src/locale.cpp === --- src/locale.cpp +++ src/locale.cpp @@ -28,7 +28,7 @@ #include "__sso_allocator" #if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) #include "support/win32/locale_win32.h" -#elif !defined(__ANDROID__) +#elif !defined(__BIONIC__) #include #endif #include Index: include/support/android/locale_bionic.h === --- include/support/android/locale_bionic.h +++ include/support/android/locale_bionic.h @@ -11,7 +11,7 @@ #ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H #define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H -#if defined(__ANDROID__) +#if defined(__BIONIC__) #ifdef __cplusplus extern "C" { @@ -27,5 +27,5 @@ #include #include -#endif // defined(__ANDROID__) +#endif // defined(__BIONIC__) #endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H Index: include/__config === --- include/__config +++ include/__config @@ -85,6 +85,13 @@ #define __is_identifier(__x) 1 #endif +// Need to detect which libc we're using if we're on Linux. +#if defined(__linux__) +#include +#if !defined(__GLIBC_PREREQ) +#define __GLIBC_PREREQ(a, b) 0 +#endif // !defined(__GLIBC_PREREQ) +#endif // defined(__linux__) #ifdef __LITTLE_ENDIAN__ #if __LITTLE_ENDIAN__ @@ -333,12 +340,9 @@ #if defined(__FreeBSD__) #define _LIBCPP_HAS_QUICK_EXIT #define _LIBCPP_HAS_C11_FEATURES -#elif defined(__ANDROID__) -#define _LIBCPP_HAS_QUICK_EXIT #elif defined(__linux__) #if !defined(_LIBCPP_HAS_MUSL_LIBC) -# include -#if __GLIBC_PREREQ(2, 15) +#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__) #define _LIBCPP_HAS_QUICK_EXIT #endif #if __GLIBC_PREREQ(2, 17) @@ -759,7 +763,7 @@ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) // Most unix variants have catopen. These are the specific ones that don't. -#if !defined(_WIN32) && !defined(__ANDROID__) &
[libcxx] r293926 - Avoid implementation defined behavior in a test.
Author: danalbert Date: Thu Feb 2 13:44:11 2017 New Revision: 293926 URL: http://llvm.org/viewvc/llvm-project?rev=293926&view=rev Log: Avoid implementation defined behavior in a test. Summary: num_put::put uses %p for pointer types, but the exact format of %p is implementation defined behavior for the C library. Compare output to snprintf for portability. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29197 Modified: libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp Modified: libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp?rev=293926&r1=293925&r2=293926&view=diff == --- libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp (original) +++ libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp Thu Feb 2 13:44:11 2017 @@ -38,6 +38,12 @@ int main() char str[50]; output_iterator iter = f.put(output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); -assert(ex == "0x0" || ex == "(nil)"); +char expected_str[32] = {}; +// num_put::put uses %p for pointer types, but the exact format of %p is +// implementation defined behavior for the C library. Compare output to +// snprintf for portability. +int rc = snprintf(expected_str, sizeof(expected_str), "%p", v); +assert(rc > 0); +assert(ex == expected_str); } } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r294350 - Use copy.deepcopy instead of doing it manually.
Author: danalbert Date: Tue Feb 7 15:04:19 2017 New Revision: 294350 URL: http://llvm.org/viewvc/llvm-project?rev=294350&view=rev Log: Use copy.deepcopy instead of doing it manually. Reviewers: EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29209 Modified: libcxx/trunk/test/libcxx/compiler.py libcxx/trunk/test/libcxx/test/format.py Modified: libcxx/trunk/test/libcxx/compiler.py URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/compiler.py?rev=294350&r1=294349&r2=294350&view=diff == --- libcxx/trunk/test/libcxx/compiler.py (original) +++ libcxx/trunk/test/libcxx/compiler.py Tue Feb 7 15:04:19 2017 @@ -49,18 +49,6 @@ class CXXCompiler(object): if self.type is None or self.version is None: self._initTypeAndVersion() -def copy(self): -new_cxx = CXXCompiler( -self.path, flags=self.flags, compile_flags=self.compile_flags, -link_flags=self.link_flags, warning_flags=self.warning_flags, -verify_supported=self.verify_supported, -verify_flags=self.verify_flags, use_verify=self.use_verify, -modules_flags=self.modules_flags, use_modules=self.use_modules, -use_ccache=self.use_ccache, use_warnings=self.use_warnings, -compile_env=self.compile_env, cxx_type=self.type, -cxx_version=self.version) -return new_cxx - def isVerifySupported(self): if self.verify_supported is None: self.verify_supported = self.hasCompileFlag(['-Xclang', Modified: libcxx/trunk/test/libcxx/test/format.py URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/format.py?rev=294350&r1=294349&r2=294350&view=diff == --- libcxx/trunk/test/libcxx/test/format.py (original) +++ libcxx/trunk/test/libcxx/test/format.py Tue Feb 7 15:04:19 2017 @@ -7,6 +7,7 @@ # #===--===## +import copy import errno import os import time @@ -36,7 +37,7 @@ class LibcxxTestFormat(object): def __init__(self, cxx, use_verify_for_fail, execute_external, executor, exec_env): -self.cxx = cxx.copy() +self.cxx = copy.deepcopy(cxx) self.use_verify_for_fail = use_verify_for_fail self.execute_external = execute_external self.executor = executor @@ -115,7 +116,7 @@ class LibcxxTestFormat(object): tmpBase) script = lit.TestRunner.applySubstitutions(script, substitutions) -test_cxx = self.cxx.copy() +test_cxx = copy.deepcopy(self.cxx) if is_fail_test: test_cxx.useCCache(False) test_cxx.useWarnings(False) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26385: Define __ANDROID_API__ for all Android builds.
danalbert added a comment. > This macro (along with ANDROID) should always be defined for Android targets. What if only `arm-linux-androideabi` (without a version) is specified? We should be falling back to the old behavior (don't defined `__ANDROID_API__`) when that happens since that's what every build system out there is going to be relying on. https://reviews.llvm.org/D26385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26385: Define __ANDROID_API__ for all Android builds.
danalbert added a comment. > It is defines with a value of 0. This allows you to actually do something > better, IMO. Can we stick with undefined? That's historically how things have been, and I'm sure there's code out there depending on that (I had actually written a test that would depend on this a few weeks ago). If we do want to do this, we're going to have to redo the legacy headers as they current define this unconditionally (`-Wmacro-redefined`). I suppose we probably don't have to worry about people using a new clang with an old NDK, so we could just change that, but I don't really see an argument for setting it to zero. https://reviews.llvm.org/D26385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26385: Define __ANDROID_API__ for all Android builds.
danalbert accepted this revision. danalbert added a reviewer: danalbert. danalbert added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D26385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r247827 - Add endianness configuration block for GCC.
Author: danalbert Date: Wed Sep 16 13:10:47 2015 New Revision: 247827 URL: http://llvm.org/viewvc/llvm-project?rev=247827&view=rev Log: Add endianness configuration block for GCC. Previously GCC using libc++ would just leak endian.h for every include. Modified: libcxx/trunk/include/__config Modified: libcxx/trunk/include/__config URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=247827&r1=247826&r2=247827&view=diff == --- libcxx/trunk/include/__config (original) +++ libcxx/trunk/include/__config Wed Sep 16 13:10:47 2015 @@ -64,6 +64,16 @@ #endif // __BIG_ENDIAN__ #endif // __BIG_ENDIAN__ +#ifdef __BYTE_ORDER__ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define _LIBCPP_LITTLE_ENDIAN 1 +#define _LIBCPP_BIG_ENDIAN 0 +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define _LIBCPP_LITTLE_ENDIAN 0 +#define _LIBCPP_BIG_ENDIAN 1 +#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#endif // __BYTE_ORDER__ + #ifdef __FreeBSD__ # include # if _BYTE_ORDER == _LITTLE_ENDIAN ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D13331: [libcxx] Use newest supported language dialect when running the test suite.
danalbert accepted this revision. danalbert added a comment. This revision is now accepted and ready to land. LGTM. http://reviews.llvm.org/D13331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11948: Add some macros to abstract marking of parameters as "not null", and use them in
danalbert added a comment. In http://reviews.llvm.org/D11948#221936, @joerg wrote: > I'm against doing this unconditionally. IMO it creates bugs without > reasonable compensation. Just because glibc wants to hurt people doesn't mean > anyone should get hurt. +1. We don't want this in Android. http://reviews.llvm.org/D11948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11948: Add some macros to abstract marking of parameters as "not null", and use them in
> > Would you be opposed to annotations that tell the programmer they have > UB in their code, but *do not* effect the code generation? Not on our end. This would be great. On Tue, Aug 11, 2015 at 12:56 PM, Aaron Ballman via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Tue, Aug 11, 2015 at 3:32 PM, Joerg Sonnenberger via cfe-commits > wrote: > > joerg added a comment. > > > > No, it doesn't. It tells the compiler that it is free to make such > assumptions. Take a step back from the standard. Can you think of any > reasonable and efficient implementation of memcpy and friends, which fails > for size 0? Adding the annotations (whether here or in string.h) > effectively changes the behavior of the program. It is behavior people have > been expecting for two decades, even when C90 said something else. This is > completely different from the warning annotations. I'm just waiting for > some of the bigger projects like PostgreSQL to start getting annoyed enough > to introduce sane_memcpy for this. > > I can't speak for Linux distributions using glibc, but I find this kind > of smoking gun completely unacceptable to force unconditionally on everyone. > > Would you be opposed to annotations that tell the programmer they have > UB in their code, but *do not* effect the code generation? > > ~Aaron > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11948: Add some macros to abstract marking of parameters as "not null", and use them in
Yeah, those sound like exactly what we want. Helping people find UB is good, but optimizing assuming we've fixed all of the UB isn't something we can do. Our bugs end up being rather permanent so we need to be defensive. On Tue, Aug 11, 2015 at 1:18 PM, Aaron Ballman wrote: > On Tue, Aug 11, 2015 at 4:10 PM, Dan Albert wrote: > >> Would you be opposed to annotations that tell the programmer they have > >> UB in their code, but *do not* effect the code generation? > > > > > > Not on our end. This would be great. > > I ask because the new nullability attributes do not affect codegen > (that I'm aware of), and so they might be a reasonable tradeoff > between warning users that they've done something with UB, without > triggering aggressive optimizations, if we didn't want to have some > sort of flag for this. > > That being said, the user's code does have UB if it passes in a null > pointer for these APIs and relying on the compiler to not optimize > that is asking for trouble. Warning them about the UB is very > important. Not optimizing on the UB is far less so, IMO. > > ~Aaron > > > > > On Tue, Aug 11, 2015 at 12:56 PM, Aaron Ballman via cfe-commits > > wrote: > >> > >> On Tue, Aug 11, 2015 at 3:32 PM, Joerg Sonnenberger via cfe-commits > >> wrote: > >> > joerg added a comment. > >> > > >> > No, it doesn't. It tells the compiler that it is free to make such > >> > assumptions. Take a step back from the standard. Can you think of any > >> > reasonable and efficient implementation of memcpy and friends, which > fails > >> > for size 0? Adding the annotations (whether here or in string.h) > effectively > >> > changes the behavior of the program. It is behavior people have been > >> > expecting for two decades, even when C90 said something else. This is > >> > completely different from the warning annotations. I'm just waiting > for some > >> > of the bigger projects like PostgreSQL to start getting annoyed > enough to > >> > introduce sane_memcpy for this. > >> > I can't speak for Linux distributions using glibc, but I find this > kind > >> > of smoking gun completely unacceptable to force unconditionally on > everyone. > >> > >> Would you be opposed to annotations that tell the programmer they have > >> UB in their code, but *do not* effect the code generation? > >> > >> ~Aaron > >> ___ > >> cfe-commits mailing list > >> cfe-commits@lists.llvm.org > >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > > > > > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11963: Create a __config_site file to capture configuration decisions.
danalbert added inline comments. Comment at: CMakeLists.txt:304 @@ +303,3 @@ +configure_file( + include/__config_site.in + ${CMAKE_BINARY_DIR}/include/c++/v1/__config_site Did you forget to upload this? http://reviews.llvm.org/D11963 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11948: Add some macros to abstract marking of parameters as "not null", and use them in
My testing was varied. I could not get GCC or clang to optimize it away for Linux, but both did for ARM Android. Regardless, the fact that GCC is already doing this doesn't mean it's desirable. We end up hunting and fixing bugs from this optimization this every release, and our time could be better spent. On Wed, Aug 12, 2015 at 3:42 PM, Marshall Clow via cfe-commits < cfe-commits@lists.llvm.org> wrote: > > > On Tue, Aug 11, 2015 at 2:28 PM, Joerg Sonnenberger via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> On Tue, Aug 11, 2015 at 02:06:58PM -0700, Marshall Clow via cfe-commits >> wrote: >> > On Tue, Aug 11, 2015 at 1:34 PM, Dan Albert >> wrote: >> > >> > > Yeah, those sound like exactly what we want. Helping people find UB is >> > > good, but optimizing assuming we've fixed all of the UB isn't >> something we >> > > can do. >> > > >> > >> > Dan -- that's the situation you're in today. >> > GCC has done that kind of optimization for *years*. >> >> Only on platforms that use this markup. Which is exactly the point I am >> raising. The gain by this optimisation is questionable at best and it >> has created (or exposed, however you want to call it) non-trivial bugs >> in the real world. There is a reason why there is a lot of push back >> outside glibc for this markers. >> >> > I don't think that this is true. > > My tests (from a previous message - run on a Mac, which does not use > glibc) show that gcc recognizes this and optimizes based on that. > > -- Marshall > > > > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11948: Add some macros to abstract marking of parameters as "not null", and use them in
Because we consider the fact that clang and gcc do this when those functions are not marked with nonnull by the libc to be a bug. Adding it to libc++ would just make another place that we have to fix that bug. What is the objection to using _Nullable instead of __attribute__(nonnull)? The original motivation in the PSA for this was for better ubsan diagnostics. _Nullable does that for us, and leaves the decision of whether null is allowed up to the libc implementers (assuming the compilers are fixed). On Aug 13, 2015 07:16, "Marshall Clow" wrote: > On Wed, Aug 12, 2015 at 4:03 PM, Dan Albert wrote: > >> My testing was varied. I could not get GCC or clang to optimize it away >> for Linux, but both did for ARM Android. >> > > Then I don't understand your objection to this change, then. > > On your platform, the effect of this change is (therefore) a compile-time > warning when you pass (a constant) NULL to a set of functions that are > documented to require non-null parameters. > > -- Marshall > > > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12164: Stop treating -static as overriding -fPIC: they are distinct.
danalbert added inline comments. Comment at: lib/Driver/Tools.cpp:3025 @@ -3024,3 +3024,3 @@ - // Note that these flags are trump-cards. Regardless of the order w.r.t. the - // PIC or PIE options above, if these show up, PIC is disabled. + // Note that this flag is a trump-cards. Regardless of the order + // w.r.t. the PIC or PIE options above, if it shows up, PIC is trump-card (singular) http://reviews.llvm.org/D12164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12129: [libcxx] Add new Sphinx documentation
danalbert accepted this revision. danalbert added a comment. I think I prefer the haiku style, but I couldn't give you any concrete reasons for that. http://reviews.llvm.org/D12129 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage
danalbert added reviewers: mclow.lists, EricWF. danalbert added a comment. FYI this was found because it can cause issues when used with GCC. http://reviews.llvm.org/D12247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604
danalbert added a comment. Android has posix_memalign too. http://reviews.llvm.org/D12512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604
Android has posix_memalign too. On Sep 5, 2015 12:00, "Joerg Sonnenberger" wrote: > On Fri, Sep 04, 2015 at 09:28:39PM +, Eric Fiselier via cfe-commits > wrote: > > EricWF added a comment. > > > > In http://reviews.llvm.org/D12512#237175, @joerg wrote: > > > > > Please don't commit this as is. Many platforms have posix_memalign or > equivalent, which makes this both simpler and potentially without wasting > memory. Compare e.g. http://reviews.llvm.org/D12001. > > > > > > Will do. Any advice on detecting posix_memalign? I don't see anything in > the patch you pointed me to. > > Provide a feature variable for it and set it by default. For Unix-like > systems, I think only Android wants to disable it by default. Not sure > about Windows and OSX. > > Joerg > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [libcxx] r252274 - Cleanup foo.h headers and __config to work in C
Yeah, what's the motivation for this? I'd actually prefer that these didn't work in C because I'd like to know if my build system is broken. On Nov 6, 2015 03:05, "Joerg Sonnenberger via cfe-commits" < cfe-commits@lists.llvm.org> wrote: > On Fri, Nov 06, 2015 at 06:30:12AM -, Eric Fiselier via cfe-commits > wrote: > > Author: ericwf > > Date: Fri Nov 6 00:30:12 2015 > > New Revision: 252274 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=252274&view=rev > > Log: > > Cleanup foo.h headers and __config to work in C > > Why? > > Joerg > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604
danalbert added a comment. The configure-time check LGTM. Android has it for all recent versions (since JB), but that will cover the case of GB and ICS. Comment at: src/cxa_exception.cpp:127 @@ +126,3 @@ +// on 32 bit targets. +ptr = std::malloc(size); +#endif `#warning` until that's done? https://reviews.llvm.org/D12512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D17416: [libcxx] Reorganize locale extension fallbacks. NFCI
danalbert accepted this revision. danalbert added a comment. This revision is now accepted and ready to land. LGTM. Sorry for the delay in response. http://reviews.llvm.org/D17416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D21247: Add `REQUIRES: c++experimental` where appropriate.
danalbert created this revision. danalbert added reviewers: EricWF, mclow.lists. danalbert added a subscriber: cfe-commits. I haven't added it to all the tests, just those that fail without it (those that aren't header only). http://reviews.llvm.org/D21247 Files: test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/max_size.pass.cpp test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp Index: test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp === --- test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp +++ test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp @@ -7,6 +7,7 @@ // //===--===// +// REQUIRES: c++experimental // UNSUPPORTED: c++98, c++03 // Index: test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp === --- test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp +++ test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp @@ -7,6 +7,7 @@ // //===--===// +// REQUIRES: c++experimental // UNSUPPORTED: c++98, c++03 // Index: test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp === --- test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp +++ test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp @@ -7,6 +7,7 @@ // //===--===// +// REQUIRES: c++experimental // UNSUPPORTED: c++98, c++03 // Index: test/std/experimental/memory/memory.resource.aliases/header
Re: [PATCH] D21247: Add `REQUIRES: c++experimental` where appropriate.
This revision was automatically updated to reflect the committed changes. Closed by commit rL272443: Add `REQUIRES: c++experimental` where appropriate. (authored by danalbert). Changed prior to commit: http://reviews.llvm.org/D21247?vs=60420&id=60421#toc Repository: rL LLVM http://reviews.llvm.org/D21247 Files: libcxx/trunk/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/max_size.pass.cpp libcxx/trunk/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp libcxx/trunk/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp Index: libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp === --- libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp +++ libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp @@ -7,6 +7,7 @@ // //===--===// +// REQUIRES: c++experimental // UNSUPPORTED: c++98, c++03 // Index: libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp === --- libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp +++ libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocat
[libcxx] r272443 - Add `REQUIRES: c++experimental` where appropriate.
Author: danalbert Date: Fri Jun 10 17:45:11 2016 New Revision: 272443 URL: http://llvm.org/viewvc/llvm-project?rev=272443&view=rev Log: Add `REQUIRES: c++experimental` where appropriate. Summary: I haven't added it to all the tests, just those that fail without it (those that aren't header only). Reviewers: EricWF, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21247 Modified: libcxx/trunk/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/max_size.pass.cpp libcxx/trunk/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp libcxx/trunk/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp libcxx/trunk/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp Modified: libcxx/trunk/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/max_size.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/max_size.pass.cpp?rev=272443&r1=272442&r2=272443&view=diff == --- libcxx/trunk/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/max_size.pass.cpp (original) +++ libcxx/trunk/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/max_size.pass.cpp Fri Jun 10 17:45:11 2016 @@ -7,6 +7,7 @@ // //===--===// +// REQUIRES: c++experimental // UNSUPPORTED: c++98, c++03 // Modified: libcxx/trunk
[PATCH] D21402: Add an Android version check for GNU strerror_r.
danalbert created this revision. danalbert added reviewers: mclow.lists, EricWF. danalbert added a subscriber: cfe-commits. Herald added subscribers: srhines, danalbert, tberghammer. Android didn't gain GNU's strerror_r until Marshmallow. If we're building libc++ against something older (we build the NDK library against the oldest release we support, currently Gingerbread), fall back to the POSIX version. http://reviews.llvm.org/D21402 Files: src/system_error.cpp Index: src/system_error.cpp === --- src/system_error.cpp +++ src/system_error.cpp @@ -21,6 +21,10 @@ #include "string" #include "string.h" +#if defined(__ANDROID__) +#include +#endif + _LIBCPP_BEGIN_NAMESPACE_STD // class error_category @@ -58,7 +62,8 @@ string do_strerror_r(int ev); -#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) +#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) \ +&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23) // GNU Extended version string do_strerror_r(int ev) { char buffer[strerror_buff_size]; Index: src/system_error.cpp === --- src/system_error.cpp +++ src/system_error.cpp @@ -21,6 +21,10 @@ #include "string" #include "string.h" +#if defined(__ANDROID__) +#include +#endif + _LIBCPP_BEGIN_NAMESPACE_STD // class error_category @@ -58,7 +62,8 @@ string do_strerror_r(int ev); -#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) +#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) \ +&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23) // GNU Extended version string do_strerror_r(int ev) { char buffer[strerror_buff_size]; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D21402: Add an Android version check for GNU strerror_r.
This revision was automatically updated to reflect the committed changes. Closed by commit rL272827: Add an Android version check for GNU strerror_r. (authored by danalbert). Changed prior to commit: http://reviews.llvm.org/D21402?vs=60887&id=60893#toc Repository: rL LLVM http://reviews.llvm.org/D21402 Files: libcxx/trunk/src/system_error.cpp Index: libcxx/trunk/src/system_error.cpp === --- libcxx/trunk/src/system_error.cpp +++ libcxx/trunk/src/system_error.cpp @@ -21,6 +21,10 @@ #include "string" #include "string.h" +#if defined(__ANDROID__) +#include +#endif + _LIBCPP_BEGIN_NAMESPACE_STD // class error_category @@ -58,7 +62,8 @@ string do_strerror_r(int ev); -#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) +#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) \ +&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23) // GNU Extended version string do_strerror_r(int ev) { char buffer[strerror_buff_size]; Index: libcxx/trunk/src/system_error.cpp === --- libcxx/trunk/src/system_error.cpp +++ libcxx/trunk/src/system_error.cpp @@ -21,6 +21,10 @@ #include "string" #include "string.h" +#if defined(__ANDROID__) +#include +#endif + _LIBCPP_BEGIN_NAMESPACE_STD // class error_category @@ -58,7 +62,8 @@ string do_strerror_r(int ev); -#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) +#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) \ +&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23) // GNU Extended version string do_strerror_r(int ev) { char buffer[strerror_buff_size]; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r272827 - Add an Android version check for GNU strerror_r.
Author: danalbert Date: Wed Jun 15 15:20:32 2016 New Revision: 272827 URL: http://llvm.org/viewvc/llvm-project?rev=272827&view=rev Log: Add an Android version check for GNU strerror_r. Summary: Android didn't gain GNU's strerror_r until Marshmallow. If we're building libc++ against something older (we build the NDK library against the oldest release we support, currently Gingerbread), fall back to the POSIX version. Reviewers: mclow.lists, EricWF Subscribers: tberghammer, danalbert, srhines, cfe-commits Differential Revision: http://reviews.llvm.org/D21402 Modified: libcxx/trunk/src/system_error.cpp Modified: libcxx/trunk/src/system_error.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/system_error.cpp?rev=272827&r1=272826&r2=272827&view=diff == --- libcxx/trunk/src/system_error.cpp (original) +++ libcxx/trunk/src/system_error.cpp Wed Jun 15 15:20:32 2016 @@ -21,6 +21,10 @@ #include "string" #include "string.h" +#if defined(__ANDROID__) +#include +#endif + _LIBCPP_BEGIN_NAMESPACE_STD // class error_category @@ -58,7 +62,8 @@ constexpr size_t strerror_buff_size = 10 string do_strerror_r(int ev); -#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) +#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) \ +&& (!defined(__ANDROID__) || __ANDROID_API__ >= 23) // GNU Extended version string do_strerror_r(int ev) { char buffer[strerror_buff_size]; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D15217: Clang documentation for UBSan.
danalbert added inline comments. Comment at: docs/UndefinedBehaviorSanitizer.rst:128 @@ +127,3 @@ + ``-fsanitize=undefined``. + - ``-fsanitize=integer``: Checks for undefined or suspicious integer + behavior. Suspicious here meaning that it also checks undefined overflow? Might want to clarify. http://reviews.llvm.org/D15217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D15217: Clang documentation for UBSan.
danalbert added inline comments. Comment at: docs/UndefinedBehaviorSanitizer.rst:128 @@ +127,3 @@ + ``-fsanitize=undefined``. + - ``-fsanitize=integer``: Checks for undefined or suspicious integer + behavior. rsmith wrote: > danalbert wrote: > > Suspicious here meaning that it also checks undefined overflow? Might want > > to clarify. > You mean "defined" rather than "undefined", right? :) I actually meant unsigned, but yes, same thing :) http://reviews.llvm.org/D15217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Add a testcase for riscv64-linux-android triple (PR #116892)
@@ -311,3 +311,19 @@ // CHECK-X86_64-GCC: Found candidate GCC installation: {{.*}}i686-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Found candidate GCC installation: {{.*}}x86_64-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Selected GCC installation: {{.*}}x86_64-linux-android{{[/\\]}}4.9 +// +// RUN: %clang -### %s 2>&1 \ +// RUN: --target=riscv64-linux-android \ +// RUN: -march=rv64i \ +// RUN: --gcc-toolchain=%S/Inputs/basic_android_ndk_tree \ DanAlbert wrote: The `CHECK-ARM64` variant of the test has it. I think it's so the test can find the linker? As long as this test is essentially a copy of that with the target and arch names swapped out, it's at least not wronger than the existing tests. https://github.com/llvm/llvm-project/pull/116892 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Pack relocations for Android API >= 28 (PR #117624)
https://github.com/DanAlbert approved this pull request. https://github.com/llvm/llvm-project/pull/117624 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] [ARM] Explicitly enable NEON for Windows/Darwin targets (PR #122095)
DanAlbert wrote: It's over 4 years old so unfortunately I'm probably not much help beyond what's already written on the old review/commit. At the time we were still using GAS though, so perhaps that made it more meaningful? If vfpv3 was already the default FPU for armv7 at the time then it's probable that I just misunderstood. https://github.com/llvm/llvm-project/pull/122095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits