Skip to content

Commit

Permalink
llvm_11: init at 11.0.0rc1
Browse files Browse the repository at this point in the history
http://lists.llvm.org/pipermail/release-testers/2020-July/001305.html

TODO: Enable Polly.

Co-authored-by: conferno <conferno@camfex.cz>
  • Loading branch information
2 people authored and primeos committed Aug 25, 2020
1 parent 28f2797 commit 0a8334d
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 145 deletions.

This file was deleted.

6 changes: 3 additions & 3 deletions pkgs/development/compilers/llvm/11/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
pname = "clang";
inherit version;

src = fetch "clang" "091bvcny2lh32zy8f3m9viayyhb2zannrndni7325rl85cwgr6pr";
src = fetch "clang" "0jfgxn0xck73zgv3kral27ccynchfwiqg6b4r1r39wzfzm8drb0f";

unpackPhase = ''
unpackFile $src
Expand All @@ -27,7 +27,6 @@ let
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++14"
"-DCLANGD_BUILD_XPC=OFF"
"-DLLVM_ENABLE_RTTI=ON"
] ++ stdenv.lib.optionals enableManpages [
"-DCLANG_INCLUDE_DOCS=ON"
"-DLLVM_ENABLE_SPHINX=ON"
Expand All @@ -39,7 +38,6 @@ let
patches = [
./purity.patch
# https://reviews.llvm.org/D51899
./compiler-rt-baremetal.patch
];

postPatch = ''
Expand Down Expand Up @@ -87,6 +85,8 @@ let
passthru = {
isClang = true;
inherit llvm;
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
};

meta = {
Expand Down
8 changes: 3 additions & 5 deletions pkgs/development/compilers/llvm/11/clang/purity.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@ diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
index fe3c0191bb..c6a482bece 100644
--- a/lib/Driver/ToolChains/Gnu.cpp
+++ b/lib/Driver/ToolChains/Gnu.cpp
@@ -494,13 +494,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -487,12 +487,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (!IsStatic) {
if (Args.hasArg(options::OPT_rdynamic))
CmdArgs.push_back("-export-dynamic");
-
- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE) {
- const std::string Loader =
- D.DyldPrefix + ToolChain.getDynamicLinker(Args);
- CmdArgs.push_back("-dynamic-linker");
- CmdArgs.push_back(Args.MakeArgString(Loader));
- CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) +
- ToolChain.getDynamicLinker(Args)));
- }
}

CmdArgs.push_back("-o");
--
2.11.0

3 changes: 1 addition & 2 deletions pkgs/development/compilers/llvm/11/compiler-rt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ in
stdenv.mkDerivation rec {
pname = "compiler-rt";
inherit version;
src = fetch pname "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr";
src = fetch pname "050p46f37cz4a8rzhjnq3lyfvii2790spkcrr3b79yrcwzbym1n6";

nativeBuildInputs = [ cmake python3 llvm ];
buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
Expand Down Expand Up @@ -47,7 +47,6 @@ stdenv.mkDerivation rec {

patches = [
./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
./find-darwin-sdk-version.patch # don't test for macOS being >= 10.15
]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;

Expand Down
19 changes: 9 additions & 10 deletions pkgs/development/compilers/llvm/11/default.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
{ lowPrio, newScope, pkgs, stdenv, cmake
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
, buildPackages
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
}:

let
release_version = "10.0.1";
version = release_version; # differentiating these (variables) is important for RCs
release_version = "11.0.0";
candidate = "rc1";
version = "${release_version}${candidate}"; # differentiating these (variables) is important for RCs
targetConfig = stdenv.targetPlatform.config;

fetch = name: sha256: fetchurl {
url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${release_version}/${name}-${version}.src.tar.xz";
url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${release_version}-${candidate}/${name}-${version}.src.tar.xz";
inherit sha256;
};

clang-tools-extra_src = fetch "clang-tools-extra" "06n1yp638rh24xdxv9v2df0qajxbjz4w59b7dd4ky36drwmpi4yh";
clang-tools-extra_src = fetch "clang-tools-extra" "1ja4mdal3ixjhiwwyw7yb1a1abw783drqq0135k9lig1gbfc67q0";

tools = stdenv.lib.makeExtensible (tools: let
callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
Expand All @@ -25,8 +25,8 @@ let
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
'';
in {

Expand Down Expand Up @@ -60,8 +60,7 @@ let

libstdcxxClang = wrapCCWith rec {
cc = tools.clang-unwrapped;
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
libcxx = null;
libcxx = null; # libstdcxx is smuggled in with clang.gcc
extraPackages = [
targetLlvmLibraries.compiler-rt
];
Expand Down
62 changes: 0 additions & 62 deletions pkgs/development/compilers/llvm/11/find-darwin-sdk-version.patch

This file was deleted.

2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/11/libc++/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ stdenv.mkDerivation {
pname = "libc++";
inherit version;

src = fetch "libcxx" "0v78bfr6h2zifvdqnj2wlfk4pvxzrqn3hg1v6lqk3y12bx9p9xny";
src = fetch "libcxx" "0rxqix45gwwfc98gfrx3jbhhp24la3i47lagqv0g0lg7sdw8vmn4";

postUnpack = ''
unpackFile ${libcxxabi.src}
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/11/libc++abi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ stdenv.mkDerivation {
pname = "libc++abi";
inherit version;

src = fetch "libcxxabi" "0yqs722y76cwvmfsq0lb917r9m3fci7bf5z3yzl71yz9n88ghzm9";
src = fetch "libcxxabi" "1hz19nmxi3kjz5fjf51v80aji7r609ckjzw759yxwjrwkxx48lhx";

nativeBuildInputs = [ cmake ];
buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/11/libunwind.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
pname = "libunwind";
inherit version;

src = fetch pname "09syx66idnm2pr46x2vmk0jn3iwdv0lkd04xy4zjbwmz3vn066bl";
src = fetch pname "0qras7ls393pc8zmm4qkpw0vkarkf5i5281s9pfbnc90dmnv4x69";

nativeBuildInputs = [ cmake ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/11/lld.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
pname = "lld";
inherit version;

src = fetch pname "0ynzi35r4fckvp6842alpd43qr810j3728yfslc66fk2mbh4j52r";
src = fetch pname "0g5w88mpa0ppfajxdpbqi5dzrxw6c22hzjmljv0kn93kmiwdrjcy";

nativeBuildInputs = [ cmake ];
buildInputs = [ llvm libxml2 ];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/11/lldb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stdenv.mkDerivation (rec {
pname = "lldb";
inherit version;

src = fetch pname "051p5b04y6z3g730rmc2n2v71lipbw7k69riww3a6sl74myfiaq7";
src = fetch pname "1vzbfb356psrcczx9a5g29pic4qr6vmbdbrsyaakl6q2ax0prkvh";

patches = [ ./lldb-procfs.patch ];

Expand Down
7 changes: 3 additions & 4 deletions pkgs/development/compilers/llvm/11/llvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
|| stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245
|| stdenv.isAarch32 # broken for the armv7l builder
)
, enablePolly ? true
, enablePolly ? false
}:

let
Expand All @@ -32,8 +32,8 @@ in stdenv.mkDerivation (rec {
pname = "llvm";
inherit version;

src = fetch pname "1wydhbp9kyjp5y0rc627imxgkgqiv3dfirbqil9dgpnbaw5y7n65";
polly_src = fetch "polly" "0nm2d8niz47yjsa3r17v3p13b70igkd338ib8191znr1dfw0pyyj";
src = fetch pname "11nym1bycy2ynr3z9frifbhqf82jjby2jk4xni6kx9zdqxjfz7q3";
polly_src = fetch "polly" "1zq14njfmxgyncy8lwwm72l4338m3q3hwl5gnl4732cc1daaxvyh";

unpackPhase = ''
unpackFile $src
Expand Down Expand Up @@ -81,7 +81,6 @@ in stdenv.mkDerivation (rec {
rm test/DebugInfo/X86/convert-debugloc.ll
rm test/DebugInfo/X86/convert-inlined.ll
rm test/DebugInfo/X86/convert-linked.ll
rm test/DebugInfo/X86/debug_addr.ll
rm test/tools/dsymutil/X86/op-convert.test
'' + optionalString (stdenv.hostPlatform.system == "armv6l-linux") ''
# Seems to require certain floating point hardware (NEON?)
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/11/openmp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
pname = "openmp";
inherit version;

src = fetch pname "0i4bn84lkpm5w3qkpvwm5z6jdj8fynp7d3bcasa1xyq4is6757yi";
src = fetch pname "1qg6chhfhp0fv9k5vzmqbn14snbzwh3y6810a60mk77m4jlijnbc";

nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
Expand Down
12 changes: 12 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8373,6 +8373,7 @@ in
};
};

clang_11 = llvmPackages_11.clang;
clang_10 = llvmPackages_10.clang;
clang_9 = llvmPackages_9.clang;
clang_8 = llvmPackages_8.clang;
Expand Down Expand Up @@ -9187,6 +9188,7 @@ in
lld_8 = llvmPackages_8.lld;
lld_9 = llvmPackages_9.lld;
lld_10 = llvmPackages_10.lld;
lld_11 = llvmPackages_11.lld;

lldb = llvmPackages.lldb;
lldb_5 = llvmPackages_5.lldb;
Expand All @@ -9195,10 +9197,12 @@ in
lldb_8 = llvmPackages_8.lldb;
lldb_9 = llvmPackages_9.lldb;
lldb_10 = llvmPackages_10.lldb;
lldb_11 = llvmPackages_11.lldb;

llvm = llvmPackages.llvm;
llvm-manpages = llvmPackages.llvm-manpages;

llvm_11 = llvmPackages_11.llvm;
llvm_10 = llvmPackages_10.llvm;
llvm_9 = llvmPackages_9.llvm;
llvm_8 = llvmPackages_8.llvm;
Expand Down Expand Up @@ -9244,6 +9248,14 @@ in
targetLlvmLibraries = targetPackages.llvmPackages_10.libraries;
};

llvmPackages_11 = callPackage ../development/compilers/llvm/11 ({
inherit (stdenvAdapters) overrideCC;
buildLlvmTools = buildPackages.llvmPackages_11.tools;
targetLlvmLibraries = targetPackages.llvmPackages_11.libraries;
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && buildPackages.stdenv.cc.isGNU) {
stdenv = gcc7Stdenv;
});

llvmPackages_latest = llvmPackages_10;

llvmPackages_rocm = callPackage ../development/compilers/llvm/rocm { };
Expand Down

0 comments on commit 0a8334d

Please sign in to comment.