From ca24adbd1e74702db332e888d5e015b13192f08e Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Tue, 11 May 2021 17:00:10 +0200 Subject: [PATCH 1/6] clang 12.0.0 --- README.md | 8 +-- recipe/meta.yaml | 17 +++--- .../0001-Find-conda-gcc-installation.patch | 24 ++++---- ...0002-Fix-sysroot-detection-for-linux.patch | 12 ++-- ...pecific-env-var-CONDA_BUILD_SYSROOT.patch} | 20 +++---- ...ramName-s-handling-of-dots-outside-.patch} | 9 ++- ...lang-fix-sysroot-dupe-headers-a3a243.patch | 57 ------------------- ... => 0005-Set-VERSION-in-osx-as-well.patch} | 14 ++--- ... 0006-Fix-crosscompiling-LLVM-tools.patch} | 20 ++++++- ...nly-error-on-undefined-TARGET_OS_OSX.patch | 25 ++++++++ recipe/patches/disable-wundef-prefix.patch | 11 ---- 11 files changed, 95 insertions(+), 122 deletions(-) rename recipe/patches/{0002-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch => 0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch} (78%) rename recipe/patches/{0003-clang-Fix-normalizeProgramName-s-handling-of-dots-ou.patch => 0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch} (92%) delete mode 100644 recipe/patches/0004-clang-fix-sysroot-dupe-headers-a3a243.patch rename recipe/patches/{0001-Set-VERSION-in-osx-as-well.patch => 0005-Set-VERSION-in-osx-as-well.patch} (66%) rename recipe/patches/{cross-compile.diff => 0006-Fix-crosscompiling-LLVM-tools.patch} (53%) create mode 100644 recipe/patches/0007-Only-error-on-undefined-TARGET_OS_OSX.patch delete mode 100644 recipe/patches/disable-wundef-prefix.patch diff --git a/README.md b/README.md index 04ae5d76..81741e73 100644 --- a/README.md +++ b/README.md @@ -82,13 +82,13 @@ Current release info | Name | Downloads | Version | Platforms | | --- | --- | --- | --- | | [![Conda Recipe](https://img.shields.io/badge/recipe-clang-green.svg)](https://anaconda.org/conda-forge/clang) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/clang.svg)](https://anaconda.org/conda-forge/clang) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/clang.svg)](https://anaconda.org/conda-forge/clang) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/clang.svg)](https://anaconda.org/conda-forge/clang) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-clang--11-green.svg)](https://anaconda.org/conda-forge/clang-11) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/clang-11.svg)](https://anaconda.org/conda-forge/clang-11) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/clang-11.svg)](https://anaconda.org/conda-forge/clang-11) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/clang-11.svg)](https://anaconda.org/conda-forge/clang-11) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-clang--12-green.svg)](https://anaconda.org/conda-forge/clang-12) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/clang-12.svg)](https://anaconda.org/conda-forge/clang-12) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/clang-12.svg)](https://anaconda.org/conda-forge/clang-12) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/clang-12.svg)](https://anaconda.org/conda-forge/clang-12) | | [![Conda Recipe](https://img.shields.io/badge/recipe-clang--tools-green.svg)](https://anaconda.org/conda-forge/clang-tools) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/clang-tools.svg)](https://anaconda.org/conda-forge/clang-tools) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/clang-tools.svg)](https://anaconda.org/conda-forge/clang-tools) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/clang-tools.svg)](https://anaconda.org/conda-forge/clang-tools) | | [![Conda Recipe](https://img.shields.io/badge/recipe-clangdev-green.svg)](https://anaconda.org/conda-forge/clangdev) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/clangdev.svg)](https://anaconda.org/conda-forge/clangdev) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/clangdev.svg)](https://anaconda.org/conda-forge/clangdev) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/clangdev.svg)](https://anaconda.org/conda-forge/clangdev) | | [![Conda Recipe](https://img.shields.io/badge/recipe-clangxx-green.svg)](https://anaconda.org/conda-forge/clangxx) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/clangxx.svg)](https://anaconda.org/conda-forge/clangxx) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/clangxx.svg)](https://anaconda.org/conda-forge/clangxx) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/clangxx.svg)](https://anaconda.org/conda-forge/clangxx) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libclang-green.svg)](https://anaconda.org/conda-forge/libclang) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libclang.svg)](https://anaconda.org/conda-forge/libclang) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libclang.svg)](https://anaconda.org/conda-forge/libclang) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libclang.svg)](https://anaconda.org/conda-forge/libclang) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libclang--cpp-green.svg)](https://anaconda.org/conda-forge/libclang-cpp) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libclang-cpp.svg)](https://anaconda.org/conda-forge/libclang-cpp) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libclang-cpp.svg)](https://anaconda.org/conda-forge/libclang-cpp) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libclang-cpp.svg)](https://anaconda.org/conda-forge/libclang-cpp) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-libclang--cpp11.1-green.svg)](https://anaconda.org/conda-forge/libclang-cpp11.1) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libclang-cpp11.1.svg)](https://anaconda.org/conda-forge/libclang-cpp11.1) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libclang-cpp11.1.svg)](https://anaconda.org/conda-forge/libclang-cpp11.1) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libclang-cpp11.1.svg)](https://anaconda.org/conda-forge/libclang-cpp11.1) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-libclang--cpp12-green.svg)](https://anaconda.org/conda-forge/libclang-cpp12) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libclang-cpp12.svg)](https://anaconda.org/conda-forge/libclang-cpp12) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libclang-cpp12.svg)](https://anaconda.org/conda-forge/libclang-cpp12) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libclang-cpp12.svg)](https://anaconda.org/conda-forge/libclang-cpp12) | | [![Conda Recipe](https://img.shields.io/badge/recipe-python--clang-green.svg)](https://anaconda.org/conda-forge/python-clang) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/python-clang.svg)](https://anaconda.org/conda-forge/python-clang) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/python-clang.svg)](https://anaconda.org/conda-forge/python-clang) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/python-clang.svg)](https://anaconda.org/conda-forge/python-clang) | Installing clang_packages @@ -101,10 +101,10 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `clang, clang-11, clang-tools, clangdev, clangxx, libclang, libclang-cpp, libclang-cpp11.1, python-clang` can be installed with: +Once the `conda-forge` channel has been enabled, `clang, clang-12, clang-tools, clangdev, clangxx, libclang, libclang-cpp, libclang-cpp12, python-clang` can be installed with: ``` -conda install clang clang-11 clang-tools clangdev clangxx libclang libclang-cpp libclang-cpp11.1 python-clang +conda install clang clang-12 clang-tools clangdev clangxx libclang libclang-cpp libclang-cpp12 python-clang ``` It is possible to list all of the versions of `clang` available on your platform with: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c276112d..56eede8b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "11.1.0" %} +{% set version = "12.0.0" %} {% set major_version = version.split(".")[0] %} {% set build_number = 1 %} @@ -14,23 +14,22 @@ package: source: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/clang-{{ version.replace(".rc", "rc") }}.src.tar.xz - sha256: 0a8288f065d1f57cb6d96da4d2965cbea32edc572aa972e466e954d17148558b + sha256: e26e452e91d4542da3ebbf404f024d3e1cbf103f4cd110c26bf0a19621cca9ed patches: - patches/0001-Find-conda-gcc-installation.patch - patches/0002-Fix-sysroot-detection-for-linux.patch - - patches/0002-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch - - patches/0003-clang-Fix-normalizeProgramName-s-handling-of-dots-ou.patch - - patches/0004-clang-fix-sysroot-dupe-headers-a3a243.patch - - patches/0001-Set-VERSION-in-osx-as-well.patch - - patches/cross-compile.diff + - patches/0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch + - patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch + - patches/0005-Set-VERSION-in-osx-as-well.patch + - patches/0006-Fix-crosscompiling-LLVM-tools.patch # Disable -Werror,-Wundef-prefix=TARGET_OS as they are not yet defined in the 10.9 SDK used for osx-64 # Only enable it for TARGET_OS_OSX. - - patches/disable-wundef-prefix.patch # [osx and x86_64] + - patches/0007-Only-error-on-undefined-TARGET_OS_OSX.patch # [osx and x86_64] #- patches/amd-roc-2.7.0.diff # [variant != "hcc"] #- patches/amd-roc-hcc-2.7.0.diff # [variant == "hcc"] folder: . - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/clang-tools-extra-{{ version.replace(".rc", "rc") }}.src.tar.xz - sha256: 76707c249de7a9cde3456b960c9a36ed9bbde8e3642c01f0ef61a43d61e0c1a2 + sha256: ad41e0b527a65ade95c1ba690a5434cefaab4a2daa1be307caaa1e8541fe6d5c folder: tools/extra build: diff --git a/recipe/patches/0001-Find-conda-gcc-installation.patch b/recipe/patches/0001-Find-conda-gcc-installation.patch index 763c06d0..35f712c1 100644 --- a/recipe/patches/0001-Find-conda-gcc-installation.patch +++ b/recipe/patches/0001-Find-conda-gcc-installation.patch @@ -1,17 +1,17 @@ -From e7a1fd56465717f1b8db4985fb88f6990aa567c2 Mon Sep 17 00:00:00 2001 +From cd2fd6e355e40ba64267a5baa68f5678bb6b3382 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 8 Apr 2019 16:20:03 -0500 -Subject: [PATCH 1/2] Find conda gcc installation +Subject: [PATCH 1/7] Find conda gcc installation --- lib/Driver/ToolChains/Gnu.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp -index 2ad45097..1ad905a4 100644 +index 1d8a3cdc..7ba5e93d 100644 --- a/lib/Driver/ToolChains/Gnu.cpp +++ b/lib/Driver/ToolChains/Gnu.cpp -@@ -1871,7 +1871,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( +@@ -2075,7 +2075,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; static const char *const AArch64Triples[] = { "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", @@ -20,7 +20,7 @@ index 2ad45097..1ad905a4 100644 static const char *const AArch64beLibDirs[] = {"/lib"}; static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", "aarch64_be-linux-gnu"}; -@@ -1896,7 +1896,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( +@@ -2103,7 +2103,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( "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", @@ -30,15 +30,15 @@ index 2ad45097..1ad905a4 100644 static const char *const X32LibDirs[] = {"/libx32"}; static const char *const X86LibDirs[] = {"/lib32", "/lib"}; static const char *const X86Triples[] = { -@@ -1949,7 +1950,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - static const char *const PPC64LELibDirs[] = {"/lib64", "/lib"}; +@@ -2164,7 +2165,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( static const char *const PPC64LETriples[] = { "powerpc64le-linux-gnu", "powerpc64le-unknown-linux-gnu", -- "powerpc64le-suse-linux", "ppc64le-redhat-linux"}; -+ "powerpc64le-suse-linux", "ppc64le-redhat-linux", "powerpc64le-conda_cos7-linux-gnu", "powerpc64le-conda-linux-gnu"}; + "powerpc64le-none-linux-gnu", "powerpc64le-suse-linux", +- "ppc64le-redhat-linux"}; ++ "ppc64le-redhat-linux", "powerpc64le-conda_cos7-linux-gnu", "powerpc64le-conda-linux-gnu"}; - static const char *const RISCV32LibDirs[] = {"/lib", "/lib32"}; - static const char *const RISCVTriples[] = {"riscv32-unknown-linux-gnu", + static const char *const RISCV32LibDirs[] = {"/lib32", "/lib"}; + static const char *const RISCV32Triples[] = {"riscv32-unknown-linux-gnu", -- -2.17.1 +2.30.1 (Apple Git-130) diff --git a/recipe/patches/0002-Fix-sysroot-detection-for-linux.patch b/recipe/patches/0002-Fix-sysroot-detection-for-linux.patch index e336b67b..9cfe8352 100644 --- a/recipe/patches/0002-Fix-sysroot-detection-for-linux.patch +++ b/recipe/patches/0002-Fix-sysroot-detection-for-linux.patch @@ -1,17 +1,17 @@ -From 662d7b8e96468596a67e4b8e917b5f776e1e745f Mon Sep 17 00:00:00 2001 +From 879df15dc13b2863f31aa544631f443c04d1d929 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 8 Apr 2019 16:32:17 -0500 -Subject: [PATCH 2/2] Fix sysroot detection for linux +Subject: [PATCH 2/7] Fix sysroot detection for linux --- lib/Driver/ToolChains/Linux.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp -index 65ab9b2d..77e7b178 100644 +index 9663a739..d8889f0f 100644 --- a/lib/Driver/ToolChains/Linux.cpp +++ b/lib/Driver/ToolChains/Linux.cpp -@@ -478,7 +478,7 @@ std::string Linux::computeSysRoot() const { +@@ -388,7 +388,7 @@ std::string Linux::computeSysRoot() const { return AndroidSysRootPath; } @@ -20,7 +20,7 @@ index 65ab9b2d..77e7b178 100644 return std::string(); // Standalone MIPS toolchains use different names for sysroot folder -@@ -496,6 +496,14 @@ std::string Linux::computeSysRoot() const { +@@ -406,6 +406,14 @@ std::string Linux::computeSysRoot() const { if (getVFS().exists(Path)) return Path; @@ -36,5 +36,5 @@ index 65ab9b2d..77e7b178 100644 if (getVFS().exists(Path)) -- -2.17.1 +2.30.1 (Apple Git-130) diff --git a/recipe/patches/0002-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch b/recipe/patches/0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch similarity index 78% rename from recipe/patches/0002-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch rename to recipe/patches/0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch index 3815b83a..f7ea58e5 100644 --- a/recipe/patches/0002-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch +++ b/recipe/patches/0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch @@ -1,7 +1,7 @@ -From 7565075efc6ba701dc5a6d0ba7667658dac5d3d9 Mon Sep 17 00:00:00 2001 +From ab31defa0707928ce574033c80b20a44f34fdc6b Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Sat, 25 Aug 2018 09:20:04 -0500 -Subject: [PATCH 2/3] clang: add conda specific env var CONDA_BUILD_SYSROOT +Subject: [PATCH 3/7] clang: add conda specific env var CONDA_BUILD_SYSROOT --- lib/Driver/Driver.cpp | 9 +++++++-- @@ -9,12 +9,12 @@ Subject: [PATCH 2/3] clang: add conda specific env var CONDA_BUILD_SYSROOT 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp -index 952a716..67e4917 100644 +index 418e1d3e..f3dab141 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp -@@ -971,8 +971,13 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { - A->claim(); - PrefixDirs.push_back(A->getValue(0)); +@@ -1114,8 +1114,13 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { + CompilerPath = Split.second; + } } - if (const Arg *A = Args.getLastArg(options::OPT__sysroot_EQ)) - SysRoot = A->getValue(); @@ -29,10 +29,10 @@ index 952a716..67e4917 100644 DyldPrefix = A->getValue(); diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp -index 8a70404..b1c5f55 100644 +index bc31445d..49a8ad66 100644 --- a/lib/Frontend/InitHeaderSearch.cpp +++ b/lib/Frontend/InitHeaderSearch.cpp -@@ -27,6 +27,7 @@ +@@ -26,6 +26,7 @@ #include "llvm/ADT/Twine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Path.h" @@ -40,7 +40,7 @@ index 8a70404..b1c5f55 100644 #include "llvm/Support/raw_ostream.h" using namespace clang; -@@ -228,7 +229,10 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, +@@ -236,7 +237,10 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, LLVM_FALLTHROUGH; default: // FIXME: temporary hack: hard-coded paths. @@ -53,5 +53,5 @@ index 8a70404..b1c5f55 100644 } } -- -2.5.4 (Apple Git-61) +2.30.1 (Apple Git-130) diff --git a/recipe/patches/0003-clang-Fix-normalizeProgramName-s-handling-of-dots-ou.patch b/recipe/patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch similarity index 92% rename from recipe/patches/0003-clang-Fix-normalizeProgramName-s-handling-of-dots-ou.patch rename to recipe/patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch index df449f57..2ecf6266 100644 --- a/recipe/patches/0003-clang-Fix-normalizeProgramName-s-handling-of-dots-ou.patch +++ b/recipe/patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch @@ -1,7 +1,7 @@ -From 810992794396fbd34349bf1dac9a9fe38a4d5020 Mon Sep 17 00:00:00 2001 +From ae57784c2ec3ba24bc16551e695685a6924c2c9e Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Wed, 30 Aug 2017 20:01:49 +0100 -Subject: [PATCH 3/3] Fix normalizeProgramName()'s handling of dots outside of +Subject: [PATCH 4/7] Fix normalizeProgramName()'s handling of dots outside of .exe It used to strip everything after the last dot, turning: @@ -18,7 +18,7 @@ x86_64-apple-darwin13.4 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp -index b8c12fc9..e6eb95fa 100644 +index b2ddef14..c8f2a567 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -50,6 +50,7 @@ using namespace driver; @@ -61,3 +61,6 @@ index b8c12fc9..e6eb95fa 100644 #ifdef _WIN32 // Transform to lowercase for case insensitive file systems. std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(), ::tolower); +-- +2.30.1 (Apple Git-130) + diff --git a/recipe/patches/0004-clang-fix-sysroot-dupe-headers-a3a243.patch b/recipe/patches/0004-clang-fix-sysroot-dupe-headers-a3a243.patch deleted file mode 100644 index 221466b6..00000000 --- a/recipe/patches/0004-clang-fix-sysroot-dupe-headers-a3a243.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/lib/Driver/ToolChains/Darwin.cpp -+++ b/lib/Driver/ToolChains/Darwin.cpp -@@ -2020,21 +2020,42 @@ void DarwinClang::AddClangCXXStdlibIncludeArgs( - - switch (GetCXXStdlibType(DriverArgs)) { - case ToolChain::CST_Libcxx: { -- // On Darwin, libc++ is installed alongside the compiler in -- // include/c++/v1, so get from '/bin' to '/include/c++/v1'. -- { -- llvm::SmallString<128> P = llvm::StringRef(getDriver().getInstalledDir()); -- // Note that P can be relative, so we have to '..' and not parent_path. -- llvm::sys::path::append(P, "..", "include", "c++", "v1"); -- addSystemInclude(DriverArgs, CC1Args, P); -+ // On Darwin, libc++ can be installed in one of the following two places: -+ // 1. Alongside the compiler in /include/c++/v1 -+ // 2. In a SDK (or a custom sysroot) in /usr/include/c++/v1 -+ // -+ // The precendence of paths is as listed above, i.e. we take the first path -+ // that exists. Also note that we never include libc++ twice -- we take the -+ // first path that exists and don't send the other paths to CC1 (otherwise -+ // include_next could break). -+ -+ // Check for (1) -+ // Get from '/bin' to '/include/c++/v1'. -+ // Note that InstallBin can be relative, so we use '..' instead of -+ // parent_path. -+ llvm::SmallString<128> InstallBin = -+ llvm::StringRef(getDriver().getInstalledDir()); // /bin -+ llvm::sys::path::append(InstallBin, "..", "include", "c++", "v1"); -+ if (getVFS().exists(InstallBin)) { -+ addSystemInclude(DriverArgs, CC1Args, InstallBin); -+ return; -+ } else if (DriverArgs.hasArg(options::OPT_v)) { -+ llvm::errs() << "ignoring nonexistent directory \"" << InstallBin -+ << "\"\n"; - } -- // Also add /usr/include/c++/v1 unless -nostdinc is used, -- // to match the legacy behavior in CC1. -- if (!DriverArgs.hasArg(options::OPT_nostdinc)) { -- llvm::SmallString<128> P = Sysroot; -- llvm::sys::path::append(P, "usr", "include", "c++", "v1"); -- addSystemInclude(DriverArgs, CC1Args, P); -+ -+ // Otherwise, check for (2) -+ llvm::SmallString<128> SysrootUsr = Sysroot; -+ llvm::sys::path::append(SysrootUsr, "usr", "include", "c++", "v1"); -+ if (getVFS().exists(SysrootUsr)) { -+ addSystemInclude(DriverArgs, CC1Args, SysrootUsr); -+ return; -+ } else if (DriverArgs.hasArg(options::OPT_v)) { -+ llvm::errs() << "ignoring nonexistent directory \"" << SysrootUsr -+ << "\"\n"; - } -+ -+ // Otherwise, don't add any path. - break; - } diff --git a/recipe/patches/0001-Set-VERSION-in-osx-as-well.patch b/recipe/patches/0005-Set-VERSION-in-osx-as-well.patch similarity index 66% rename from recipe/patches/0001-Set-VERSION-in-osx-as-well.patch rename to recipe/patches/0005-Set-VERSION-in-osx-as-well.patch index 0d8e2f5b..76f9da68 100644 --- a/recipe/patches/0001-Set-VERSION-in-osx-as-well.patch +++ b/recipe/patches/0005-Set-VERSION-in-osx-as-well.patch @@ -1,17 +1,17 @@ -From f3a88106a4178516c4cfc89b4b98b23ecdebb73a Mon Sep 17 00:00:00 2001 +From db25bdc8cb43309263810000679543bc05328a9b Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 27 Jul 2019 11:55:23 -0500 -Subject: [PATCH] Set VERSION in osx as well +Subject: [PATCH 5/7] Set VERSION in osx as well --- - tools/libclang/CMakeLists.txt | 4 ++++ - 1 file changed, 4 insertions(+) + tools/libclang/CMakeLists.txt | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt -index 32333b01..6d5f3290 100644 +index 51ff2e7e..15699ea8 100644 --- a/tools/libclang/CMakeLists.txt +++ b/tools/libclang/CMakeLists.txt -@@ -114,6 +114,11 @@ if(ENABLE_SHARED) +@@ -149,6 +149,11 @@ if(ENABLE_SHARED) set_property(TARGET libclang APPEND_STRING PROPERTY LINK_FLAGS ${LIBCLANG_LINK_FLAGS}) @@ -24,5 +24,5 @@ index 32333b01..6d5f3290 100644 set_target_properties(libclang PROPERTIES -- -2.22.0 +2.30.1 (Apple Git-130) diff --git a/recipe/patches/cross-compile.diff b/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch similarity index 53% rename from recipe/patches/cross-compile.diff rename to recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch index b7963cc8..d20003fe 100644 --- a/recipe/patches/cross-compile.diff +++ b/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch @@ -1,6 +1,17 @@ ---- CMakeLists.txt.old 2020-08-07 20:15:39.605174899 +0000 -+++ CMakeLists.txt 2020-08-07 20:20:01.383910098 +0000 -@@ -111,6 +111,16 @@ +From 6df7fb48f7d03ed28f3ecb64684b41cb86c0d237 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Tue, 11 May 2021 15:08:13 +0200 +Subject: [PATCH 6/7] Fix crosscompiling LLVM tools + +--- + CMakeLists.txt | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e740141..0af66ab8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -110,6 +110,16 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) option(LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON) include(AddLLVM) @@ -17,3 +28,6 @@ include(TableGen) include(HandleLLVMOptions) include(VersionFromVCS) +-- +2.30.1 (Apple Git-130) + diff --git a/recipe/patches/0007-Only-error-on-undefined-TARGET_OS_OSX.patch b/recipe/patches/0007-Only-error-on-undefined-TARGET_OS_OSX.patch new file mode 100644 index 00000000..d1323a40 --- /dev/null +++ b/recipe/patches/0007-Only-error-on-undefined-TARGET_OS_OSX.patch @@ -0,0 +1,25 @@ +From 5b397a1a0499fcf0a27dc978db6962064408b0a1 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Tue, 11 May 2021 15:09:51 +0200 +Subject: [PATCH 7/7] Only error on undefined TARGET_OS_OSX + +--- + lib/Driver/ToolChains/Darwin.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/Driver/ToolChains/Darwin.cpp b/lib/Driver/ToolChains/Darwin.cpp +index bdc3923a..55d68dd4 100644 +--- a/lib/Driver/ToolChains/Darwin.cpp ++++ b/lib/Driver/ToolChains/Darwin.cpp +@@ -979,7 +979,7 @@ DarwinClang::DarwinClang(const Driver &D, const llvm::Triple &Triple, + + void DarwinClang::addClangWarningOptions(ArgStringList &CC1Args) const { + // Always error about undefined 'TARGET_OS_*' macros. +- CC1Args.push_back("-Wundef-prefix=TARGET_OS_"); ++ CC1Args.push_back("-Wundef-prefix=TARGET_OS_OSX"); + CC1Args.push_back("-Werror=undef-prefix"); + + // For modern targets, promote certain warnings to errors. +-- +2.30.1 (Apple Git-130) + diff --git a/recipe/patches/disable-wundef-prefix.patch b/recipe/patches/disable-wundef-prefix.patch deleted file mode 100644 index 68859a67..00000000 --- a/recipe/patches/disable-wundef-prefix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/Driver/ToolChains/Darwin.cpp.orig 2020-11-17 21:12:24.000000000 +0100 -+++ lib/Driver/ToolChains/Darwin.cpp 2020-11-17 21:12:37.000000000 +0100 -@@ -960,7 +960,7 @@ - - void DarwinClang::addClangWarningOptions(ArgStringList &CC1Args) const { - // Always error about undefined 'TARGET_OS_*' macros. -- CC1Args.push_back("-Wundef-prefix=TARGET_OS_"); -+ CC1Args.push_back("-Wundef-prefix=TARGET_OS_OSX"); - CC1Args.push_back("-Werror=undef-prefix"); - - // For modern targets, promote certain warnings to errors. From 60babf3b8138e87196d848c4427b8d0caed56577 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Tue, 11 May 2021 22:14:10 +0200 Subject: [PATCH 2/6] Make clangd CompletionModel not depend on directory layout --- recipe/build.sh | 1 + recipe/meta.yaml | 2 ++ ...letionModel-not-depend-on-directory-.patch | 29 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 recipe/patches/0001-Make-clangd-CompletionModel-not-depend-on-directory-.patch diff --git a/recipe/build.sh b/recipe/build.sh index a798e49e..98581267 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -35,6 +35,7 @@ cmake \ -DLLVM_INCLUDE_DOCS=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ -DCMAKE_AR=$AR \ + -DPython3_EXECUTABLE=${BUILD_PREFIX}/bin/python \ $CMAKE_ARGS \ .. diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 56eede8b..ce0573c5 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -31,6 +31,8 @@ source: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/clang-tools-extra-{{ version.replace(".rc", "rc") }}.src.tar.xz sha256: ad41e0b527a65ade95c1ba690a5434cefaab4a2daa1be307caaa1e8541fe6d5c folder: tools/extra + patches: + - patches/0001-Make-clangd-CompletionModel-not-depend-on-directory-.patch build: number: {{ build_number }} diff --git a/recipe/patches/0001-Make-clangd-CompletionModel-not-depend-on-directory-.patch b/recipe/patches/0001-Make-clangd-CompletionModel-not-depend-on-directory-.patch new file mode 100644 index 00000000..1a7a0e69 --- /dev/null +++ b/recipe/patches/0001-Make-clangd-CompletionModel-not-depend-on-directory-.patch @@ -0,0 +1,29 @@ +From 5b69bd706085271321e4125f616927f2176da608 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Tue, 11 May 2021 22:12:48 +0200 +Subject: [PATCH] Make clangd CompletionModel not depend on directory layout + +--- + clangd/quality/CompletionModel.cmake | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/clangd/quality/CompletionModel.cmake b/clangd/quality/CompletionModel.cmake +index 60c6d2a..dc0c0cd 100644 +--- a/clangd/quality/CompletionModel.cmake ++++ b/clangd/quality/CompletionModel.cmake +@@ -4,9 +4,10 @@ + # ${CMAKE_CURRENT_BINARY_DIR}. The generated header + # will define a C++ class called ${cpp_class} - which may be a + # namespace-qualified class name. ++set(CLANGD_COMPLETION_MODEL_COMPILER ${CMAKE_CURRENT_LIST_DIR}/CompletionModelCodegen.py) + function(gen_decision_forest model filename cpp_class) +- set(model_compiler ${CMAKE_SOURCE_DIR}/../clang-tools-extra/clangd/quality/CompletionModelCodegen.py) +- ++ set(model_compiler ${CLANGD_COMPLETION_MODEL_COMPILER}) ++ + set(output_dir ${CMAKE_CURRENT_BINARY_DIR}) + set(header_file ${output_dir}/${filename}.h) + set(cpp_file ${output_dir}/${filename}.cpp) +-- +2.30.2 + From 51c01899a2e81cf872ea4578b9bb37e115c67162 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 12 May 2021 07:38:04 +0000 Subject: [PATCH 3/6] Set ZLIB_ROOT on cross-compiling --- recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index 98581267..fea58388 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -12,7 +12,7 @@ fi if [[ "$CONDA_BUILD_CROSS_COMPILATION" == "1" ]]; then CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_TABLEGEN_EXE=$BUILD_PREFIX/bin/llvm-tblgen -DNATIVE_LLVM_DIR=$BUILD_PREFIX/lib/cmake/llvm" - CMAKE_ARGS="${CMAKE_ARGS} -DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_C_COMPILER=$CC_FOR_BUILD;-DCMAKE_CXX_COMPILER=$CXX_FOR_BUILD;-DCMAKE_C_FLAGS=-O2;-DCMAKE_CXX_FLAGS=-O2;-DCMAKE_EXE_LINKER_FLAGS=;-DCMAKE_MODULE_LINKER_FLAGS=;-DCMAKE_SHARED_LINKER_FLAGS=;-DCMAKE_STATIC_LINKER_FLAGS=;" + CMAKE_ARGS="${CMAKE_ARGS} -DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_C_COMPILER=$CC_FOR_BUILD;-DCMAKE_CXX_COMPILER=$CXX_FOR_BUILD;-DCMAKE_C_FLAGS=-O2;-DCMAKE_CXX_FLAGS=-O2;-DCMAKE_EXE_LINKER_FLAGS=;-DCMAKE_MODULE_LINKER_FLAGS=;-DCMAKE_SHARED_LINKER_FLAGS=;-DCMAKE_STATIC_LINKER_FLAGS=;-DZLIB_ROOT=$BUILD_PREFIX" else rm -rf $BUILD_PREFIX/bin/llvm-tblgen fi From 492d4b2e7340c41aad1db4351e71317dd56800de Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 12 May 2021 07:44:34 +0000 Subject: [PATCH 4/6] Add @xhochy as a maintainer --- .github/CODEOWNERS | 2 +- README.md | 1 + recipe/meta.yaml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b572a862..5a338258 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @SylvainCorlay @chrisburr @inducer @isuruf @jakirkham @timsnyder \ No newline at end of file +* @SylvainCorlay @chrisburr @inducer @isuruf @jakirkham @timsnyder @xhochy \ No newline at end of file diff --git a/README.md b/README.md index 81741e73..81c38f5f 100644 --- a/README.md +++ b/README.md @@ -183,4 +183,5 @@ Feedstock Maintainers * [@isuruf](https://github.com/isuruf/) * [@jakirkham](https://github.com/jakirkham/) * [@timsnyder](https://github.com/timsnyder/) +* [@xhochy](https://github.com/xhochy/) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index ce0573c5..5437436a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -360,3 +360,4 @@ extra: - SylvainCorlay - timsnyder - chrisburr + - xhochy From 28cbd3df11ad7423d546658e1ff10f1c1de7bf16 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Thu, 13 May 2021 20:52:52 +0200 Subject: [PATCH 5/6] Set Python3_EXECUTABLE on Windows --- recipe/bld.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/bld.bat b/recipe/bld.bat index 37a79765..a9563551 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -18,6 +18,7 @@ cmake -G "Ninja" ^ -DLLVM_INCLUDE_DOCS=OFF ^ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON ^ -DLLVM_ENABLE_LIBXML2=OFF ^ + -DPython3_EXECUTABLE=%BUILD_PREFIX%\python ^ %SRC_DIR% if errorlevel 1 exit 1 From af8d3e41ce6bae92966d50934f6ed252ada45adb Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Thu, 13 May 2021 21:13:12 +0200 Subject: [PATCH 6/6] Fix authorship --- recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch b/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch index d20003fe..09eb099a 100644 --- a/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch +++ b/recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch @@ -1,5 +1,5 @@ From 6df7fb48f7d03ed28f3ecb64684b41cb86c0d237 Mon Sep 17 00:00:00 2001 -From: "Uwe L. Korn" +From: Isuru Fernando Date: Tue, 11 May 2021 15:08:13 +0200 Subject: [PATCH 6/7] Fix crosscompiling LLVM tools