Merge remote-tracking branch 'upstream/master' into haskell-no-rec
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
diff --git a/default.build b/default.build
|
||||
index e48fd9e..b0dee4f 100644
|
||||
--- a/default.build
|
||||
+++ b/default.build
|
||||
@@ -23,14 +23,14 @@
|
||||
<property name="skip.ast" value="False" />
|
||||
<property name="skip.vs" value="False" />
|
||||
|
||||
- <property name="gsv.name" value="gtksourceview-1.0" />
|
||||
+ <property name="gsv.name" value="gtksourceview-2.0" />
|
||||
|
||||
<property name="build.dir" value="build" dynamic="True"/>
|
||||
<property name="distrobuild.dir" value="distrobuild"/>
|
||||
<property name="docs.dir" value="docs" />
|
||||
<property name="examples.dir" value="examples" />
|
||||
|
||||
- <property name="install.prefix" value="/usr/local" />
|
||||
+ <property name="install.prefix" value="$out" />
|
||||
<property name="install.destdir" value="/" />
|
||||
|
||||
<property name="install.share" value="${path::combine(install.prefix,'share')}" />
|
||||
@@ -575,9 +575,9 @@
|
||||
key files for mime detection, etc
|
||||
-->
|
||||
|
||||
- <property name="sharedmime.prefix" value="${pkg-config::get-variable('shared-mime-info','prefix')}" />
|
||||
+ <property name="sharedmime.prefix" value="$out" />
|
||||
<property name="fakeroot.sharedmime" value="${fakeroot}/${sharedmime.prefix}" />
|
||||
- <property name="gsv.prefix" value="${pkg-config::get-variable(gsv.name,'prefix')}" />
|
||||
+ <property name="gsv.prefix" value="$out" />
|
||||
<property name="fakeroot.gsv" value="${fakeroot}/${gsv.prefix}" />
|
||||
|
||||
<mkdir dir="${fakeroot.boolib}"/>
|
||||
@@ -707,9 +707,9 @@
|
||||
key files for mime detection, etc
|
||||
-->
|
||||
|
||||
- <property name="sharedmime.prefix" value="${pkg-config::get-variable('shared-mime-info','prefix')}" />
|
||||
+ <property name="sharedmime.prefix" value="$out" />
|
||||
<property name="fakeroot.sharedmime" value="${fakeroot}/${sharedmime.prefix}" />
|
||||
- <property name="gsv.prefix" value="${pkg-config::get-variable(gsv.name,'prefix')}" />
|
||||
+ <property name="gsv.prefix" value="$out" />
|
||||
<property name="fakeroot.gsv" value="${fakeroot}/${gsv.prefix}" />
|
||||
|
||||
<foreach item="File" property="filename">
|
||||
@@ -1,46 +0,0 @@
|
||||
{ stdenv, fetchFromGitHub, pkgconfig, mono, makeWrapper, nant
|
||||
, shared-mime-info, gtksourceview, gtk2 }:
|
||||
|
||||
let
|
||||
release = "alpha";
|
||||
in stdenv.mkDerivation rec {
|
||||
name = "boo-${version}";
|
||||
version = "2013-10-21";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "boo-lang";
|
||||
repo = "boo";
|
||||
|
||||
rev = "${release}";
|
||||
sha256 = "174abdwfpq8i3ijx6bwqll16lx7xwici374rgsbymyk8g8mla094";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [
|
||||
mono makeWrapper nant shared-mime-info gtksourceview
|
||||
gtk2
|
||||
];
|
||||
|
||||
patches = [ ./config.patch ];
|
||||
|
||||
postPatch = ''
|
||||
sed -e 's|\$out|'$out'|' -i default.build
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
nant -t:mono-4.5
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
nant install
|
||||
cp $out/lib/mono/boo/*.dll $out/lib/boo/
|
||||
'';
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "The Boo Programming Language";
|
||||
platforms = platforms.linux;
|
||||
broken = true;
|
||||
};
|
||||
}
|
||||
@@ -70,5 +70,6 @@ stdenv.mkDerivation rec {
|
||||
maintainers = [stdenv.lib.maintainers.raskin];
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
homepage = "https://github.com/drmeister/clasp";
|
||||
broken = true; # 2018-09-08, no successful build since 2018-01-03
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ stdenv, lib, fetchurl, fetchpatch
|
||||
, coq, ocamlPackages
|
||||
, coq, ocamlPackages, coq2html
|
||||
, tools ? stdenv.cc
|
||||
}:
|
||||
|
||||
@@ -7,23 +7,18 @@ assert lib.versionAtLeast ocamlPackages.ocaml.version "4.02";
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "compcert-${version}";
|
||||
version = "3.3";
|
||||
version = "3.4";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://compcert.inria.fr/release/${name}.tgz";
|
||||
sha256 = "16xrqcwak1v1fk5ndx6jf1yvxv3adsr7p7z34gfm2mpggxnq0xwn";
|
||||
sha256 = "12gchwvkzhd2bhrnwzfb4a06wc4hgv98z987k06vj7ga31ii763h";
|
||||
};
|
||||
|
||||
buildInputs = [ coq ]
|
||||
buildInputs = [ coq coq2html ]
|
||||
++ (with ocamlPackages; [ ocaml findlib menhir ]);
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
patches = [ (fetchpatch {
|
||||
url = "https://github.com/AbsInt/CompCert/commit/679ecfeaa24c0615fa1999e9582bf2af6a9f35e7.patch";
|
||||
sha256 = "04yrn6dp57aw6lmlr4yssjlx9cxix0mlmaw7gfhwyz5bzqc2za1a";
|
||||
})];
|
||||
|
||||
configurePhase = ''
|
||||
substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
|
||||
./configure -clightgen -prefix $out -toolprefix ${tools}/bin/ '' +
|
||||
|
||||
@@ -92,7 +92,7 @@ stdenv.mkDerivation rec {
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://dotnet.github.io/core/;
|
||||
homepage = https://github.com/dotnet/core/;
|
||||
description = ".NET is a general purpose development platform";
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with maintainers; [ kuznero ];
|
||||
|
||||
@@ -12,15 +12,20 @@ let
|
||||
rpath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc libunwind libuuid icu openssl zlib curl ];
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
version = "2.1.302";
|
||||
version = "2.1.401";
|
||||
name = "dotnet-sdk-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dotnetcli.azureedge.net/dotnet/Sdk/${version}/dotnet-sdk-${version}-linux-x64.tar.gz";
|
||||
sha256 = "1a8z9q69cd9a33j7fr7907abm5z4qiivw5k379cgsjmmvxwyvjia";
|
||||
# use sha512 from the download page
|
||||
sha512 = "639f9f68f225246d9cce798d72d011f65c7eda0d775914d1394df050bddf93e2886555f5eed85a75d6c72e9063a54d8aa053c64c326c683b94e9e0a0570e5654";
|
||||
};
|
||||
|
||||
unpackPhase = "tar xvzf $src";
|
||||
unpackPhase = ''
|
||||
mkdir src
|
||||
cd src
|
||||
tar xvzf $src
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{ lib, stdenv, buildEnv, haskell, nodejs, fetchurl, makeWrapper, git }:
|
||||
{ lib, stdenv, buildEnv
|
||||
, haskell, nodejs
|
||||
, fetchurl, fetchpatch, makeWrapper, git }:
|
||||
|
||||
# To update:
|
||||
|
||||
@@ -90,6 +92,12 @@ let
|
||||
export ELM_HOME=`pwd`/.elm
|
||||
'' + (makeDotElm "0.19.0" (import ./packages/elm-elm.nix));
|
||||
buildTools = drv.buildTools or [] ++ [ makeWrapper ];
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
url = "https://github.com/elm/compiler/pull/1784/commits/78d2d8eab310552b1b877a3e90e1e57e7a09ddec.patch";
|
||||
sha256 = "0vdhk16xqm2hxw12s1b91a0bmi8w4wsxc086qlzglgnjxrl5b3w4";
|
||||
})
|
||||
];
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/elm \
|
||||
--prefix PATH ':' ${lib.makeBinPath [ nodejs ]}
|
||||
|
||||
@@ -11,8 +11,8 @@ mkDerivation {
|
||||
version = "0.19.0";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/elm/compiler";
|
||||
sha256 = "0s93z9vr0vp5w894ghc5s34nsq09sg1msf59zfiba87sid5vgjqy";
|
||||
rev = "32059a289d27e303fa1665e9ada0a52eb688f302";
|
||||
sha256 = "13jks6c6i80z71mjjfg46ri570g5ini0k3xw3857v6z66zcl56x4";
|
||||
rev = "d5cbc41aac23da463236bbc250933d037da4055a";
|
||||
};
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{ stdenv, callPackage, fetchurl }:
|
||||
|
||||
callPackage ./build.nix {
|
||||
version = "4.8.9";
|
||||
version = "4.9.0";
|
||||
|
||||
SRC = fetchurl {
|
||||
url = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.8/source/gambit-v4_8_9-devel.tgz";
|
||||
sha256 = "1gwzz1ag9hlv266nvfq1bhwzrps3f2yghhffasjjqy8i8xwnry5p";
|
||||
url = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.9/source/gambit-v4_9_0-devel.tgz";
|
||||
sha256 = "0wyfpjs244zrbrdil9rfkdgcawvms84z0r77qwhwadghma4dqgjf";
|
||||
};
|
||||
inherit stdenv;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{ stdenv, callPackage, fetchgit }:
|
||||
|
||||
callPackage ./build.nix {
|
||||
version = "unstable-2018-08-06";
|
||||
# git-version = "4.8.9-77-g91a4ad2c";
|
||||
version = "unstable-2018-09-03";
|
||||
# git-version = "4.9.0";
|
||||
SRC = fetchgit {
|
||||
url = "https://github.com/feeley/gambit.git";
|
||||
rev = "91a4ad2c28375f067adedcaa61f9d66a4b536f4f";
|
||||
sha256 = "0px1ipvhh0hz8n38h6jv4y1nn163j8llvcy4l7p3hkdns5czwy1p";
|
||||
rev = "7cdc7e7b9194b2c088c0667efaf7686a4ffd0d8a";
|
||||
sha256 = "06mmi8jkinihfirz4gjfw2lhxhskiqf3d47sihzx10r60asyqcxg";
|
||||
};
|
||||
inherit stdenv;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{ stdenv, callPackage, fetchurl, gambit }:
|
||||
|
||||
callPackage ./build.nix {
|
||||
version = "0.12-RELEASE";
|
||||
git-version = "0.12";
|
||||
version = "0.13";
|
||||
git-version = "0.13";
|
||||
GAMBIT = gambit;
|
||||
SRC = fetchurl {
|
||||
url = "https://github.com/vyzo/gerbil/archive/v0.12.tar.gz";
|
||||
sha256 = "0nigr3mgrzai57q2jqac8f39zj8rcmic3277ynyzlgm8hhps71pq";
|
||||
url = "https://github.com/vyzo/gerbil/archive/v0.13.tar.gz";
|
||||
sha256 = "1qs0vdq2lgxlpw20s8jzw2adx1xk9wb3w2m4a8vp6bb8hagmfr5l";
|
||||
};
|
||||
inherit stdenv;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{ stdenv, callPackage, fetchgit, gambit-unstable }:
|
||||
|
||||
callPackage ./build.nix {
|
||||
version = "unstable-2018-08-11";
|
||||
git-version = "0.13-DEV-542-g274e1a22";
|
||||
version = "unstable-2018-09-06";
|
||||
git-version = "0.14-DEV";
|
||||
GAMBIT = gambit-unstable;
|
||||
SRC = fetchgit {
|
||||
url = "https://github.com/vyzo/gerbil.git";
|
||||
rev = "274e1a22b2d2b708d5582594274ab52ee9ba1686";
|
||||
sha256 = "10j44ar4xfl8xmh276zg1ykd3r0vy7w2f2cg4p8slwnk9r251g2s";
|
||||
rev = "184cb635c82517d5d75d7966dcdf1d25ad863dac";
|
||||
sha256 = "1ljzbpc36i9zpzfwra5hpfbgzj1dyzzp50h5jf976n8qr9x4l7an";
|
||||
};
|
||||
inherit stdenv;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,10 @@ stdenv.mkDerivation (rec {
|
||||
sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3";
|
||||
extraPrefix = "utils/hsc2hs/";
|
||||
stripLen = 1;
|
||||
}) (fetchpatch rec { # https://phabricator.haskell.org/D5123
|
||||
url = "http://tarballs.nixos.org/sha256/${sha256}";
|
||||
name = "D5123.diff";
|
||||
sha256 = "0nhqwdamf2y4gbwqxcgjxs0kqx23w9gv5kj0zv6450dq19rji82n";
|
||||
})] ++ stdenv.lib.optional deterministicProfiling
|
||||
(fetchpatch rec {
|
||||
url = "http://tarballs.nixos.org/sha256/${sha256}";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# build-tools
|
||||
, bootPkgs
|
||||
, autoconf, automake, coreutils, fetchurl, perl, python3, m4
|
||||
, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4
|
||||
|
||||
, libiconv ? null, ncurses
|
||||
|
||||
@@ -78,18 +78,24 @@ let
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (rec {
|
||||
version = "8.6.0.20180810";
|
||||
version = "8.6.1";
|
||||
name = "${targetPrefix}ghc-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.haskell.org/~ghc/8.6.1-beta1/ghc-${version}-src.tar.xz";
|
||||
sha256 = "0b3nyjs4lsh67lfw7wh7r7kkf4g2xiypdxd77aycmwd3pdxj09yw";
|
||||
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
|
||||
sha256 = "0dkh7idgrqr567fq94a0f5x3w0r4cm2ydn51nb5wfisw3rnw499c";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
patches = [(fetchpatch rec { # https://phabricator.haskell.org/D5123
|
||||
url = "http://tarballs.nixos.org/sha256/${sha256}";
|
||||
name = "D5123.diff";
|
||||
sha256 = "0nhqwdamf2y4gbwqxcgjxs0kqx23w9gv5kj0zv6450dq19rji82n";
|
||||
})];
|
||||
|
||||
postPatch = "patchShebangs .";
|
||||
|
||||
# GHC is a bit confused on its cross terminology.
|
||||
|
||||
@@ -34,6 +34,8 @@ in stdenv.mkDerivation rec {
|
||||
|
||||
configureFlags = stdenv.lib.optional (!emacsSupport) "--without-emacs";
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
installFlags = stdenv.lib.optional emacsSupport "lispdir=$(out)/share/emacs/site-lisp";
|
||||
|
||||
# For some reason the tests fail if executated with nix-build, but pass if
|
||||
|
||||
@@ -125,6 +125,8 @@ stdenv.mkDerivation rec {
|
||||
./remove-fhs-test-references.patch
|
||||
./skip-external-network-tests.patch
|
||||
./skip-nohup-tests.patch
|
||||
# breaks under load: https://github.com/golang/go/issues/25628
|
||||
./skip-test-extra-files-on-386.patch
|
||||
];
|
||||
|
||||
postPatch = optionalString stdenv.isDarwin ''
|
||||
@@ -139,7 +141,7 @@ stdenv.mkDerivation rec {
|
||||
else if stdenv.targetPlatform.isAarch32 then "arm"
|
||||
else if stdenv.targetPlatform.isAarch64 then "arm64"
|
||||
else throw "Unsupported system";
|
||||
GOARM = stdenv.targetPlatform.parsed.cpu.version or "";
|
||||
GOARM = toString (stdenv.lib.intersectLists [(stdenv.targetPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
|
||||
GO386 = 387; # from Arch: don't assume sse2 on i686
|
||||
CGO_ENABLED = 1;
|
||||
GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go
|
||||
index 558345ff63..22129bf022 100644
|
||||
--- a/src/os/exec/exec_test.go
|
||||
+++ b/src/os/exec/exec_test.go
|
||||
@@ -593,6 +593,10 @@ func TestExtraFiles(t *testing.T) {
|
||||
t.Skipf("skipping test on %q", runtime.GOOS)
|
||||
}
|
||||
|
||||
+ if runtime.GOOS == "linux" && runtime.GOARCH == "386" {
|
||||
+ t.Skipf("skipping test on %q %q", runtime.GOARCH, runtime.GOOS)
|
||||
+ }
|
||||
+
|
||||
// Ensure that file descriptors have not already been leaked into
|
||||
// our environment.
|
||||
if !testedAlreadyLeaked {
|
||||
@@ -211,7 +211,7 @@ stdenv.mkDerivation rec {
|
||||
description = "High-level performance-oriented dynamical language for technical computing";
|
||||
homepage = https://julialang.org/;
|
||||
license = stdenv.lib.licenses.mit;
|
||||
maintainers = with stdenv.lib.maintainers; [ raskin rob ];
|
||||
maintainers = with stdenv.lib.maintainers; [ raskin rob garrison ];
|
||||
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
|
||||
broken = stdenv.isi686;
|
||||
};
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{ stdenv, fetchurl, makeWrapper, jre, unzip }:
|
||||
|
||||
let
|
||||
version = "1.2.61";
|
||||
version = "1.2.70";
|
||||
in stdenv.mkDerivation rec {
|
||||
inherit version;
|
||||
name = "kotlin-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/JetBrains/kotlin/releases/download/v${version}/kotlin-compiler-${version}.zip";
|
||||
sha256 = "1gsvilsbgwdvyvxjnlvs0rhrgm6x9dapziwgwgg9kbi9a0w4avdy";
|
||||
sha256 = "0d44rzngpfhgh1qc99b97dczdyrmypbwzrmr00qmcy2ya2il0fm2";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ jre ] ;
|
||||
|
||||
@@ -6,7 +6,7 @@ let
|
||||
|
||||
fetch = fetch_v version;
|
||||
fetch_v = ver: name: sha256: fetchurl {
|
||||
url = "http://llvm.org/releases/${ver}/${name}-${ver}.src.tar.xz";
|
||||
url = "https://releases.llvm.org/${ver}/${name}-${ver}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ let
|
||||
|
||||
fetch = fetch_v version;
|
||||
fetch_v = ver: name: sha256: fetchurl {
|
||||
url = "http://llvm.org/releases/${ver}/${name}-${ver}.src.tar.xz";
|
||||
url = "https://releases.llvm.org/${ver}/${name}-${ver}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ let
|
||||
|
||||
fetch = fetch_v version;
|
||||
fetch_v = ver: name: sha256: fetchurl {
|
||||
url = "http://llvm.org/releases/${ver}/${name}-${ver}.src.tar.xz";
|
||||
url = "https://releases.llvm.org/${ver}/${name}-${ver}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ let
|
||||
|
||||
fetch = fetch_v version;
|
||||
fetch_v = ver: name: sha256: fetchurl {
|
||||
url = "http://llvm.org/releases/${version}/${name}-${ver}.src.tar.xz";
|
||||
url = "https://releases.llvm.org/${version}/${name}-${ver}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ let
|
||||
version = release_version; # differentiating these is important for rc's
|
||||
|
||||
fetch = name: sha256: fetchurl {
|
||||
url = "http://llvm.org/releases/${release_version}/${name}-${version}.src.tar.xz";
|
||||
url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ let
|
||||
version = release_version; # differentiating these is important for rc's
|
||||
|
||||
fetch = name: sha256: fetchurl {
|
||||
url = "http://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz";
|
||||
url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
|
||||
106
pkgs/development/compilers/llvm/7/clang/default.nix
Normal file
106
pkgs/development/compilers/llvm/7/clang/default.nix
Normal file
@@ -0,0 +1,106 @@
|
||||
{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python
|
||||
, fixDarwinDylibNames
|
||||
, enableManpages ? false
|
||||
}:
|
||||
|
||||
let
|
||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||
self = stdenv.mkDerivation ({
|
||||
name = "clang-${version}";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile ${fetch "cfe" "0mdsbgj3p7mayhzm8hclzl3i46r2lwa8fr1cz399f9km3iqi40jm"}
|
||||
mv cfe-${version}* clang
|
||||
sourceRoot=$PWD/clang
|
||||
unpackFile ${clang-tools-extra_src}
|
||||
mv clang-tools-extra-* $sourceRoot/tools/extra
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake python ]
|
||||
++ stdenv.lib.optional enableManpages python.pkgs.sphinx;
|
||||
|
||||
buildInputs = [ libxml2 llvm ]
|
||||
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
||||
] ++ stdenv.lib.optionals enableManpages [
|
||||
"-DCLANG_INCLUDE_DOCS=ON"
|
||||
"-DLLVM_ENABLE_SPHINX=ON"
|
||||
"-DSPHINX_OUTPUT_MAN=ON"
|
||||
"-DSPHINX_OUTPUT_HTML=OFF"
|
||||
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
|
||||
];
|
||||
|
||||
patches = [ ./purity.patch ];
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
|
||||
-e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
|
||||
lib/Driver/ToolChains/*.cpp
|
||||
|
||||
# Patch for standalone doc building
|
||||
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
|
||||
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
|
||||
'';
|
||||
|
||||
outputs = [ "out" "lib" "python" ];
|
||||
|
||||
# Clang expects to find LLVMgold in its own prefix
|
||||
postInstall = ''
|
||||
if [ -e ${llvm}/lib/LLVMgold.so ]; then
|
||||
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
|
||||
fi
|
||||
|
||||
ln -sv $out/bin/clang $out/bin/cpp
|
||||
|
||||
# Move libclang to 'lib' output
|
||||
moveToOutput "lib/libclang.*" "$lib"
|
||||
substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang."
|
||||
|
||||
mkdir -p $python/bin $python/share/clang/
|
||||
mv $out/bin/{git-clang-format,scan-view} $python/bin
|
||||
if [ -e $out/bin/set-xcode-analyzer ]; then
|
||||
mv $out/bin/set-xcode-analyzer $python/bin
|
||||
fi
|
||||
mv $out/share/clang/*.py $python/share/clang
|
||||
rm $out/bin/c-index-test
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru = {
|
||||
isClang = true;
|
||||
inherit llvm;
|
||||
} // stdenv.lib.optionalAttrs stdenv.targetPlatform.isLinux {
|
||||
inherit gcc;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "clang-manpages-${version}";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-clang-man
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/man/man1
|
||||
# Manually install clang manpage
|
||||
cp docs/man/*.1 $out/share/man/man1/
|
||||
'';
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta.description = "man page for Clang ${version}";
|
||||
});
|
||||
in self
|
||||
30
pkgs/development/compilers/llvm/7/clang/purity.patch
Normal file
30
pkgs/development/compilers/llvm/7/clang/purity.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001
|
||||
From: Will Dietz <w@wdtz.org>
|
||||
Date: Thu, 18 May 2017 11:56:12 -0500
|
||||
Subject: [PATCH] "purity" patch for 5.0
|
||||
|
||||
---
|
||||
lib/Driver/ToolChains/Gnu.cpp | 7 -------
|
||||
1 file changed, 7 deletions(-)
|
||||
|
||||
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,
|
||||
if (!Args.hasArg(options::OPT_static)) {
|
||||
if (Args.hasArg(options::OPT_rdynamic))
|
||||
CmdArgs.push_back("-export-dynamic");
|
||||
-
|
||||
- if (!Args.hasArg(options::OPT_shared)) {
|
||||
- const std::string Loader =
|
||||
- D.DyldPrefix + ToolChain.getDynamicLinker(Args);
|
||||
- CmdArgs.push_back("-dynamic-linker");
|
||||
- CmdArgs.push_back(Args.MakeArgString(Loader));
|
||||
- }
|
||||
}
|
||||
|
||||
CmdArgs.push_back("-o");
|
||||
--
|
||||
2.11.0
|
||||
|
||||
33
pkgs/development/compilers/llvm/7/compiler-rt-codesign.patch
Normal file
33
pkgs/development/compilers/llvm/7/compiler-rt-codesign.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001
|
||||
From: Will Dietz <w@wdtz.org>
|
||||
Date: Tue, 19 Sep 2017 13:13:06 -0500
|
||||
Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that
|
||||
needs it
|
||||
|
||||
---
|
||||
cmake/Modules/AddCompilerRT.cmake | 8 ------
|
||||
test/asan/CMakeLists.txt | 52 ---------------------------------------
|
||||
test/tsan/CMakeLists.txt | 47 -----------------------------------
|
||||
3 files changed, 107 deletions(-)
|
||||
|
||||
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
|
||||
index bc5fb9ff7..b64eb4246 100644
|
||||
--- a/cmake/Modules/AddCompilerRT.cmake
|
||||
+++ b/cmake/Modules/AddCompilerRT.cmake
|
||||
@@ -210,14 +210,6 @@ function(add_compiler_rt_runtime name type)
|
||||
set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
|
||||
set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")
|
||||
endif()
|
||||
- if(APPLE)
|
||||
- # Ad-hoc sign the dylibs
|
||||
- add_custom_command(TARGET ${libname}
|
||||
- POST_BUILD
|
||||
- COMMAND codesign --sign - $<TARGET_FILE:${libname}>
|
||||
- WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}
|
||||
- )
|
||||
- endif()
|
||||
endif()
|
||||
install(TARGETS ${libname}
|
||||
ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}
|
||||
2.14.1
|
||||
|
||||
37
pkgs/development/compilers/llvm/7/compiler-rt.nix
Normal file
37
pkgs/development/compilers/llvm/7/compiler-rt.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ stdenv, version, fetch, cmake, python, llvm, libcxxabi }:
|
||||
with stdenv.lib;
|
||||
stdenv.mkDerivation rec {
|
||||
name = "compiler-rt-${version}";
|
||||
inherit version;
|
||||
src = fetch "compiler-rt" "1mkhqvs8cxbfmprkzwyq7lmnzr1sv45znzf0arbgb19crzipzv5x";
|
||||
|
||||
nativeBuildInputs = [ cmake python llvm ];
|
||||
buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
|
||||
|
||||
configureFlags = [
|
||||
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
|
||||
];
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
patches = [
|
||||
./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
|
||||
] ++ optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch;
|
||||
|
||||
# TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
|
||||
# to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
|
||||
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
|
||||
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
|
||||
# a flag and turn the flag off during the stdenv build.
|
||||
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
substituteInPlace cmake/config-ix.cmake \
|
||||
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
|
||||
'';
|
||||
|
||||
# Hack around weird upsream RPATH bug
|
||||
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
ln -s "$out/lib"/*/* "$out/lib"
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
}
|
||||
92
pkgs/development/compilers/llvm/7/default.nix
Normal file
92
pkgs/development/compilers/llvm/7/default.nix
Normal file
@@ -0,0 +1,92 @@
|
||||
{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook
|
||||
, libxml2, python, isl, fetchurl, overrideCC, wrapCCWith
|
||||
, buildLlvmTools # tools, but from the previous stage, for cross
|
||||
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
||||
}:
|
||||
|
||||
let
|
||||
release_version = "7.0.0";
|
||||
version = release_version; # differentiating these is important for rc's
|
||||
|
||||
fetch = name: sha256: fetchurl {
|
||||
url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
clang-tools-extra_src = fetch "clang-tools-extra" "1glxl7bnr4k3j16s8xy8r9cl0llyg524f50591g1ig23ij65lz4k";
|
||||
|
||||
tools = stdenv.lib.makeExtensible (tools: let
|
||||
callPackage = newScope (tools // { inherit stdenv cmake libxml2 python isl release_version version fetch; });
|
||||
mkExtraBuildCommands = cc: ''
|
||||
rsrc="$out/resource-root"
|
||||
mkdir "$rsrc"
|
||||
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 ''
|
||||
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
|
||||
'';
|
||||
in {
|
||||
|
||||
llvm = callPackage ./llvm.nix { };
|
||||
|
||||
clang-unwrapped = callPackage ./clang {
|
||||
inherit clang-tools-extra_src;
|
||||
};
|
||||
|
||||
llvm-manpages = lowPrio (tools.llvm.override {
|
||||
enableManpages = true;
|
||||
python = pkgs.python; # don't use python-boot
|
||||
});
|
||||
|
||||
clang-manpages = lowPrio (tools.clang-unwrapped.override {
|
||||
enableManpages = true;
|
||||
python = pkgs.python; # don't use python-boot
|
||||
});
|
||||
|
||||
libclang = tools.clang-unwrapped.lib;
|
||||
|
||||
clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang;
|
||||
|
||||
libstdcxxClang = wrapCCWith rec {
|
||||
cc = tools.clang-unwrapped;
|
||||
extraPackages = [
|
||||
libstdcxxHook
|
||||
targetLlvmLibraries.compiler-rt
|
||||
];
|
||||
extraBuildCommands = mkExtraBuildCommands cc;
|
||||
};
|
||||
|
||||
libcxxClang = wrapCCWith rec {
|
||||
cc = tools.clang-unwrapped;
|
||||
extraPackages = [
|
||||
targetLlvmLibraries.libcxx
|
||||
targetLlvmLibraries.libcxxabi
|
||||
targetLlvmLibraries.compiler-rt
|
||||
];
|
||||
extraBuildCommands = mkExtraBuildCommands cc;
|
||||
};
|
||||
|
||||
lld = callPackage ./lld.nix {};
|
||||
|
||||
lldb = callPackage ./lldb.nix {};
|
||||
});
|
||||
|
||||
libraries = stdenv.lib.makeExtensible (libraries: let
|
||||
callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python isl release_version version fetch; });
|
||||
in {
|
||||
|
||||
compiler-rt = callPackage ./compiler-rt.nix {};
|
||||
|
||||
stdenv = overrideCC stdenv buildLlvmTools.clang;
|
||||
|
||||
libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
|
||||
|
||||
libcxx = callPackage ./libc++ {};
|
||||
|
||||
libcxxabi = callPackage ./libc++abi.nix {};
|
||||
|
||||
openmp = callPackage ./openmp.nix {};
|
||||
});
|
||||
|
||||
in { inherit tools libraries; } // libraries // tools
|
||||
50
pkgs/development/compilers/llvm/7/libc++/default.nix
Normal file
50
pkgs/development/compilers/llvm/7/libc++/default.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{ lib, stdenv, fetch, cmake, python, libcxxabi, fixDarwinDylibNames, version }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "libc++-${version}";
|
||||
|
||||
src = fetch "libcxx" "1w1l472p03csgz76p70pn9yk7h0nw5hj1av44ysnakigp8jjcd4v";
|
||||
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxxabi.src}
|
||||
export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
|
||||
'';
|
||||
|
||||
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
|
||||
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
|
||||
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
patchShebangs utils/cat_files.py
|
||||
'';
|
||||
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python;
|
||||
|
||||
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
|
||||
"-DLIBCXX_LIBCPPABI_VERSION=2"
|
||||
"-DLIBCXX_CXX_ABI=libcxxabi"
|
||||
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
linkCxxAbi = stdenv.isLinux;
|
||||
|
||||
setupHooks = [
|
||||
../../../../../build-support/setup-hooks/role.bash
|
||||
./setup-hook.sh
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxx.llvm.org/;
|
||||
description = "A new implementation of the C++ standard library, targeting C++11";
|
||||
license = with stdenv.lib.licenses; [ ncsa mit ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
6
pkgs/development/compilers/llvm/7/libc++/setup-hook.sh
Normal file
6
pkgs/development/compilers/llvm/7/libc++/setup-hook.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
# See pkgs/build-support/setup-hooks/role.bash
|
||||
getHostRole
|
||||
|
||||
linkCxxAbi="@linkCxxAbi@"
|
||||
export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1"
|
||||
export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}"
|
||||
49
pkgs/development/compilers/llvm/7/libc++abi.nix
Normal file
49
pkgs/development/compilers/llvm/7/libc++abi.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "libc++abi-${version}";
|
||||
|
||||
src = fetch "libcxxabi" "0pr4xfx61r5mwmvhg4j9pb6df6vvha1gyf6rwkm14x9rzxcwficv";
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
|
||||
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxx.src}
|
||||
unpackFile ${llvm.src}
|
||||
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export TRIPLE=x86_64-apple-darwin
|
||||
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
|
||||
'';
|
||||
|
||||
installPhase = if stdenv.isDarwin
|
||||
then ''
|
||||
for file in lib/*.dylib; do
|
||||
# this should be done in CMake, but having trouble figuring out
|
||||
# the magic combination of necessary CMake variables
|
||||
# if you fancy a try, take a look at
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
install_name_tool -id $out/$file $file
|
||||
done
|
||||
make install
|
||||
install -d 755 $out/include
|
||||
install -m 644 ../include/*.h $out/include
|
||||
''
|
||||
else ''
|
||||
install -d -m 755 $out/include $out/lib
|
||||
install -m 644 lib/libc++abi.so.1.0 $out/lib
|
||||
install -m 644 ../include/cxxabi.h $out/include
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxxabi.llvm.org/;
|
||||
description = "A new implementation of low level support for a standard C++ library";
|
||||
license = with stdenv.lib.licenses; [ ncsa mit ];
|
||||
maintainers = with stdenv.lib.maintainers; [ vlstill ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
32
pkgs/development/compilers/llvm/7/lld.nix
Normal file
32
pkgs/development/compilers/llvm/7/lld.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, libxml2
|
||||
, llvm
|
||||
, version
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "lld-${version}";
|
||||
|
||||
src = fetch "lld" "173z50vx5mlsaiqmbz7asxy2297z4xivrfxrdfncvx23wp2lgkzv";
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ llvm libxml2 ];
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = ''
|
||||
moveToOutput include "$dev"
|
||||
moveToOutput lib "$dev"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "The LLVM Linker";
|
||||
homepage = http://lld.llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
||||
56
pkgs/development/compilers/llvm/7/lldb.nix
Normal file
56
pkgs/development/compilers/llvm/7/lldb.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, zlib
|
||||
, ncurses
|
||||
, swig
|
||||
, which
|
||||
, libedit
|
||||
, libxml2
|
||||
, llvm
|
||||
, clang-unwrapped
|
||||
, python
|
||||
, version
|
||||
, darwin
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "lldb-${version}";
|
||||
|
||||
src = fetch "lldb" "0cmah36ybyfws0z2ikq9fqn5k4kvjci7vgk97ddx4xwrwkzdixkz";
|
||||
|
||||
postPatch = ''
|
||||
# Fix up various paths that assume llvm and clang are installed in the same place
|
||||
sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \
|
||||
cmake/modules/LLDBStandalone.cmake
|
||||
sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \
|
||||
cmake/modules/LLDBStandalone.cmake
|
||||
sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \
|
||||
cmake/modules/LLDBStandalone.cmake
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake python which swig ];
|
||||
buildInputs = [ ncurses zlib libedit libxml2 llvm ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
|
||||
|
||||
CXXFLAGS = "-fno-rtti";
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/man/man1
|
||||
cp ../docs/lldb.1 $out/share/man/man1/
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A next-generation high-performance debugger";
|
||||
homepage = http://llvm.org/;
|
||||
license = licenses.ncsa;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
26
pkgs/development/compilers/llvm/7/llvm-outputs.patch
Normal file
26
pkgs/development/compilers/llvm/7/llvm-outputs.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
|
||||
index 94d426b..37f7794 100644
|
||||
--- a/tools/llvm-config/llvm-config.cpp
|
||||
+++ b/tools/llvm-config/llvm-config.cpp
|
||||
@@ -333,6 +333,21 @@ int main(int argc, char **argv) {
|
||||
ActiveIncludeOption = "-I" + ActiveIncludeDir;
|
||||
}
|
||||
|
||||
+ /// Nix-specific multiple-output handling: override ActiveLibDir if --link-shared
|
||||
+ if (!IsInDevelopmentTree) {
|
||||
+ bool WantShared = true;
|
||||
+ for (int i = 1; i < argc; ++i) {
|
||||
+ StringRef Arg = argv[i];
|
||||
+ if (Arg == "--link-shared")
|
||||
+ WantShared = true;
|
||||
+ else if (Arg == "--link-static")
|
||||
+ WantShared = false; // the last one wins
|
||||
+ }
|
||||
+
|
||||
+ if (WantShared)
|
||||
+ ActiveLibDir = std::string("@lib@") + "/lib" + LLVM_LIBDIR_SUFFIX;
|
||||
+ }
|
||||
+
|
||||
/// We only use `shared library` mode in cases where the static library form
|
||||
/// of the components provided are not available; note however that this is
|
||||
/// skipped if we're run from within the build dir. However, once installed,
|
||||
174
pkgs/development/compilers/llvm/7/llvm.nix
Normal file
174
pkgs/development/compilers/llvm/7/llvm.nix
Normal file
@@ -0,0 +1,174 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, python
|
||||
, libffi
|
||||
, libbfd
|
||||
, libpfm
|
||||
, libxml2
|
||||
, ncurses
|
||||
, version
|
||||
, release_version
|
||||
, zlib
|
||||
, debugVersion ? false
|
||||
, enableManpages ? false
|
||||
, enableSharedLibraries ? true
|
||||
, enableWasm ? true
|
||||
, enablePFM ? !stdenv.isDarwin
|
||||
}:
|
||||
|
||||
let
|
||||
src = fetch "llvm" "08p27wv1pr9ql2zc3f3qkkymci46q7myvh8r5ijippnbwr2gihcb";
|
||||
|
||||
# Used when creating a version-suffixed symlink of libLLVM.dylib
|
||||
shortVersion = with stdenv.lib;
|
||||
concatStringsSep "." (take 1 (splitString "." release_version));
|
||||
in stdenv.mkDerivation (rec {
|
||||
name = "llvm-${version}";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile ${src}
|
||||
mv llvm-${version}* llvm
|
||||
sourceRoot=$PWD/llvm
|
||||
'';
|
||||
|
||||
outputs = [ "out" "python" ]
|
||||
++ stdenv.lib.optional enableSharedLibraries "lib";
|
||||
|
||||
nativeBuildInputs = [ cmake python ]
|
||||
++ stdenv.lib.optional enableManpages python.pkgs.sphinx;
|
||||
|
||||
buildInputs = [ libxml2 libffi ]
|
||||
++ stdenv.lib.optional enablePFM libpfm; # exegesis
|
||||
|
||||
propagatedBuildInputs = [ ncurses zlib ];
|
||||
|
||||
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
substituteInPlace cmake/modules/AddLLVM.cmake \
|
||||
--replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir INSTALL_NAME_DIR "$lib/lib")" \
|
||||
--replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' ""
|
||||
''
|
||||
# Patch llvm-config to return correct library path based on --link-{shared,static}.
|
||||
+ stdenv.lib.optionalString (enableSharedLibraries) ''
|
||||
substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
|
||||
patch -p1 < ./llvm-outputs.patch
|
||||
'' + ''
|
||||
# FileSystem permissions tests fail with various special bits
|
||||
substituteInPlace unittests/Support/CMakeLists.txt \
|
||||
--replace "Path.cpp" ""
|
||||
rm unittests/Support/Path.cpp
|
||||
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
patch -p1 -i ${../TLI-musl.patch}
|
||||
substituteInPlace unittests/Support/CMakeLists.txt \
|
||||
--replace "add_subdirectory(DynamicLibrary)" ""
|
||||
rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
|
||||
'' + ''
|
||||
patchShebangs test/BugPoint/compile-custom.ll.py
|
||||
'';
|
||||
|
||||
# hacky fix: created binaries need to be run before installation
|
||||
preBuild = ''
|
||||
mkdir -p $out/
|
||||
ln -sv $PWD/lib $out
|
||||
'';
|
||||
|
||||
cmakeFlags = with stdenv; [
|
||||
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
|
||||
"-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
|
||||
"-DLLVM_BUILD_TESTS=ON"
|
||||
"-DLLVM_ENABLE_FFI=ON"
|
||||
"-DLLVM_ENABLE_RTTI=ON"
|
||||
|
||||
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
|
||||
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
|
||||
"-DTARGET_TRIPLE=${stdenv.hostPlatform.config}"
|
||||
|
||||
"-DLLVM_ENABLE_DUMP=ON"
|
||||
]
|
||||
++ stdenv.lib.optional enableSharedLibraries
|
||||
"-DLLVM_LINK_LLVM_DYLIB=ON"
|
||||
++ stdenv.lib.optionals enableManpages [
|
||||
"-DLLVM_BUILD_DOCS=ON"
|
||||
"-DLLVM_ENABLE_SPHINX=ON"
|
||||
"-DSPHINX_OUTPUT_MAN=ON"
|
||||
"-DSPHINX_OUTPUT_HTML=OFF"
|
||||
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
|
||||
]
|
||||
++ stdenv.lib.optional (!isDarwin)
|
||||
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
|
||||
++ stdenv.lib.optionals (isDarwin) [
|
||||
"-DLLVM_ENABLE_LIBCXX=ON"
|
||||
"-DCAN_TARGET_i386=false"
|
||||
]
|
||||
++ stdenv.lib.optional enableWasm
|
||||
"-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly"
|
||||
;
|
||||
|
||||
postBuild = ''
|
||||
rm -fR $out
|
||||
|
||||
paxmark m bin/{lli,llvm-rtdyld}
|
||||
paxmark m unittests/ExecutionEngine/MCJIT/MCJITTests
|
||||
paxmark m unittests/ExecutionEngine/Orc/OrcJITTests
|
||||
paxmark m unittests/Support/SupportTests
|
||||
paxmark m bin/lli-child-target
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $python/share
|
||||
mv $out/share/opt-viewer $python/share/opt-viewer
|
||||
''
|
||||
+ stdenv.lib.optionalString enableSharedLibraries ''
|
||||
moveToOutput "lib/libLLVM-*" "$lib"
|
||||
moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
|
||||
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
|
||||
''
|
||||
+ stdenv.lib.optionalString (stdenv.isDarwin && enableSharedLibraries) ''
|
||||
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
|
||||
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
|
||||
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
|
||||
'';
|
||||
|
||||
doCheck = stdenv.isLinux && (!stdenv.isi686);
|
||||
|
||||
checkTarget = "check-all";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru.src = src;
|
||||
|
||||
meta = {
|
||||
description = "Collection of modular and reusable compiler and toolchain technologies";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ];
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "llvm-manpages-${version}";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-llvm-man
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [];
|
||||
|
||||
installPhase = ''
|
||||
make -C docs install
|
||||
'';
|
||||
|
||||
postPatch = null;
|
||||
postInstall = null;
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta.description = "man pages for LLVM ${version}";
|
||||
})
|
||||
25
pkgs/development/compilers/llvm/7/openmp.nix
Normal file
25
pkgs/development/compilers/llvm/7/openmp.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, llvm
|
||||
, perl
|
||||
, version
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "openmp-${version}";
|
||||
|
||||
src = fetch "openmp" "1zrqlaxr954sp8lcr7g8m0z0pr8xyq4i6p11x6gcamjm5xijnrih";
|
||||
|
||||
nativeBuildInputs = [ cmake perl ];
|
||||
buildInputs = [ llvm ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "Components required to build an executable OpenMP program";
|
||||
homepage = http://openmp.llvm.org/;
|
||||
license = stdenv.lib.licenses.mit;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
||||
412
pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch
Normal file
412
pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch
Normal file
@@ -0,0 +1,412 @@
|
||||
From f7a253f8f85d0f49df6b73996737a3e84ac64236 Mon Sep 17 00:00:00 2001
|
||||
From: Will Dietz <w@wdtz.org>
|
||||
Date: Mon, 24 Sep 2018 11:17:25 -0500
|
||||
Subject: [PATCH] Ported to 7.0, taken from gentoo-musl project.
|
||||
|
||||
------
|
||||
Ported to compiler-rt-sanitizers-5.0.0. Taken from
|
||||
|
||||
https://gist.githubusercontent.com/pwaller/2337f3290f12634cad3e3730cff0a6c1/raw/83c87a8585e2f9662494db5662e5361beb093c26/nongnu.patch
|
||||
Signed-off-by: Jory A. Pratt <anarchy@gentoo.org>
|
||||
|
||||
Taken from gentoo-musl project, with a few additional minor fixes.
|
||||
---
|
||||
lib/asan/asan_linux.cc | 4 +-
|
||||
lib/interception/interception_linux.cc | 2 +-
|
||||
lib/interception/interception_linux.h | 2 +-
|
||||
lib/msan/msan_linux.cc | 2 +-
|
||||
lib/sanitizer_common/sanitizer_allocator.cc | 2 +-
|
||||
.../sanitizer_common_interceptors_ioctl.inc | 4 +-
|
||||
.../sanitizer_common_syscalls.inc | 2 +-
|
||||
lib/sanitizer_common/sanitizer_linux.cc | 8 +++-
|
||||
.../sanitizer_linux_libcdep.cc | 10 ++---
|
||||
lib/sanitizer_common/sanitizer_platform.h | 6 +++
|
||||
.../sanitizer_platform_interceptors.h | 4 +-
|
||||
.../sanitizer_platform_limits_posix.cc | 37 +++++++++++--------
|
||||
lib/tsan/rtl/tsan_platform_linux.cc | 2 +-
|
||||
13 files changed, 51 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
|
||||
index 625f32d40..73cf77aca 100644
|
||||
--- a/lib/asan/asan_linux.cc
|
||||
+++ b/lib/asan/asan_linux.cc
|
||||
@@ -46,7 +46,7 @@
|
||||
#include <link.h>
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS
|
||||
+#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU
|
||||
#include <ucontext.h>
|
||||
extern "C" void* _DYNAMIC;
|
||||
#elif SANITIZER_NETBSD
|
||||
@@ -139,7 +139,7 @@ void AsanApplyToGlobals(globals_op_fptr op, const void *needle) {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
-#if SANITIZER_ANDROID
|
||||
+#if SANITIZER_ANDROID || SANITIZER_NONGNU
|
||||
// FIXME: should we do anything for Android?
|
||||
void AsanCheckDynamicRTPrereqs() {}
|
||||
void AsanCheckIncompatibleRT() {}
|
||||
diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
|
||||
index 26bfcd8f6..529b234f7 100644
|
||||
--- a/lib/interception/interception_linux.cc
|
||||
+++ b/lib/interception/interception_linux.cc
|
||||
@@ -43,7 +43,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
|
||||
}
|
||||
|
||||
// Android and Solaris do not have dlvsym
|
||||
-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
|
||||
+#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU
|
||||
void *GetFuncAddrVer(const char *func_name, const char *ver) {
|
||||
return dlvsym(RTLD_NEXT, func_name, ver);
|
||||
}
|
||||
diff --git a/lib/interception/interception_linux.h b/lib/interception/interception_linux.h
|
||||
index 942c25609..24a4d5080 100644
|
||||
--- a/lib/interception/interception_linux.h
|
||||
+++ b/lib/interception/interception_linux.h
|
||||
@@ -36,7 +36,7 @@ void *GetFuncAddrVer(const char *func_name, const char *ver);
|
||||
(::__interception::uptr) & WRAP(func))
|
||||
|
||||
// Android, Solaris and OpenBSD do not have dlvsym
|
||||
-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
|
||||
+#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU
|
||||
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
|
||||
(::__interception::real_##func = (func##_f)( \
|
||||
unsigned long)::__interception::GetFuncAddrVer(#func, symver))
|
||||
diff --git a/lib/msan/msan_linux.cc b/lib/msan/msan_linux.cc
|
||||
index 385a650c4..6e30a8ce9 100644
|
||||
--- a/lib/msan/msan_linux.cc
|
||||
+++ b/lib/msan/msan_linux.cc
|
||||
@@ -13,7 +13,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "sanitizer_common/sanitizer_platform.h"
|
||||
-#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
|
||||
+#if SANITIZER_FREEBSD || (SANITIZER_LINUX && !SANITIZER_NONGNU) || SANITIZER_NETBSD
|
||||
|
||||
#include "msan.h"
|
||||
#include "msan_report.h"
|
||||
diff --git a/lib/sanitizer_common/sanitizer_allocator.cc b/lib/sanitizer_common/sanitizer_allocator.cc
|
||||
index 6bfd5e5ee..048f6154f 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_allocator.cc
|
||||
+++ b/lib/sanitizer_common/sanitizer_allocator.cc
|
||||
@@ -27,7 +27,7 @@ const char *SecondaryAllocatorName = "LargeMmapAllocator";
|
||||
|
||||
// ThreadSanitizer for Go uses libc malloc/free.
|
||||
#if SANITIZER_GO || defined(SANITIZER_USE_MALLOC)
|
||||
-# if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+# if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
extern "C" void *__libc_malloc(uptr size);
|
||||
# if !SANITIZER_GO
|
||||
extern "C" void *__libc_memalign(uptr alignment, uptr size);
|
||||
diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
|
||||
index 2d633c173..b6eb23116 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
|
||||
+++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
|
||||
@@ -104,7 +104,7 @@ static void ioctl_table_fill() {
|
||||
_(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX
|
||||
+#if SANITIZER_LINUX && !SANITIZER_NONGNU
|
||||
// Conflicting request ids.
|
||||
// _(CDROMAUDIOBUFSIZ, NONE, 0);
|
||||
// _(SNDCTL_TMR_CONTINUE, NONE, 0);
|
||||
@@ -365,7 +365,7 @@ static void ioctl_table_fill() {
|
||||
_(VT_WAITACTIVE, NONE, 0);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
// _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
|
||||
_(CYGETDEFTHRESH, WRITE, sizeof(int));
|
||||
_(CYGETDEFTIMEOUT, WRITE, sizeof(int));
|
||||
diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc
|
||||
index 469c8eb7e..24f87867d 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_common_syscalls.inc
|
||||
+++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc
|
||||
@@ -2038,7 +2038,7 @@ POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) {
|
||||
}
|
||||
}
|
||||
|
||||
-#if !SANITIZER_ANDROID
|
||||
+#if !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
PRE_SYSCALL(prlimit64)(long pid, long resource, const void *new_rlim,
|
||||
void *old_rlim) {
|
||||
if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz);
|
||||
diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc
|
||||
index 96d6c1eff..9e2b7fb9d 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_linux.cc
|
||||
+++ b/lib/sanitizer_common/sanitizer_linux.cc
|
||||
@@ -541,13 +541,13 @@ const char *GetEnv(const char *name) {
|
||||
#endif
|
||||
}
|
||||
|
||||
-#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD
|
||||
+#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_NONGNU
|
||||
extern "C" {
|
||||
SANITIZER_WEAK_ATTRIBUTE extern void *__libc_stack_end;
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if !SANITIZER_GO && !SANITIZER_FREEBSD && !SANITIZER_NETBSD && \
|
||||
+#if (!SANITIZER_GO || SANITIZER_NONGNU) && !SANITIZER_FREEBSD && !SANITIZER_NETBSD && \
|
||||
!SANITIZER_OPENBSD
|
||||
static void ReadNullSepFileToArray(const char *path, char ***arr,
|
||||
int arr_size) {
|
||||
@@ -590,6 +590,10 @@ static void GetArgsAndEnv(char ***argv, char ***envp) {
|
||||
#elif SANITIZER_NETBSD
|
||||
*argv = __ps_strings->ps_argvstr;
|
||||
*envp = __ps_strings->ps_envstr;
|
||||
+#elif SANITIZER_NONGNU
|
||||
+ static const int kMaxArgv = 2000, kMaxEnvp = 2000;
|
||||
+ ReadNullSepFileToArray("/proc/self/cmdline", argv, kMaxArgv);
|
||||
+ ReadNullSepFileToArray("/proc/self/environ", envp, kMaxEnvp);
|
||||
#else // SANITIZER_FREEBSD
|
||||
#if !SANITIZER_GO
|
||||
if (&__libc_stack_end) {
|
||||
diff --git a/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
|
||||
index 4962ff832..438f94dbe 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_linux_libcdep.cc
|
||||
+++ b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
|
||||
@@ -179,7 +179,7 @@ __attribute__((unused)) static bool GetLibcVersion(int *major, int *minor,
|
||||
}
|
||||
|
||||
#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && \
|
||||
- !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS
|
||||
+ !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS && !SANITIZER_NONGNU
|
||||
static uptr g_tls_size;
|
||||
|
||||
#ifdef __i386__
|
||||
@@ -261,7 +261,7 @@ void InitTlsSize() { }
|
||||
#if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) || \
|
||||
defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__) || \
|
||||
defined(__arm__)) && \
|
||||
- SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+ SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
// sizeof(struct pthread) from glibc.
|
||||
static atomic_uintptr_t thread_descriptor_size;
|
||||
|
||||
@@ -426,7 +426,7 @@ int GetSizeFromHdr(struct dl_phdr_info *info, size_t size, void *data) {
|
||||
|
||||
#if !SANITIZER_GO
|
||||
static void GetTls(uptr *addr, uptr *size) {
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
# if defined(__x86_64__) || defined(__i386__) || defined(__s390__)
|
||||
*addr = ThreadSelf();
|
||||
*size = GetTlsSize();
|
||||
@@ -470,7 +470,7 @@ static void GetTls(uptr *addr, uptr *size) {
|
||||
#elif SANITIZER_OPENBSD
|
||||
*addr = 0;
|
||||
*size = 0;
|
||||
-#elif SANITIZER_ANDROID
|
||||
+#elif SANITIZER_ANDROID || SANITIZER_NONGNU
|
||||
*addr = 0;
|
||||
*size = 0;
|
||||
#elif SANITIZER_SOLARIS
|
||||
@@ -486,7 +486,7 @@ static void GetTls(uptr *addr, uptr *size) {
|
||||
#if !SANITIZER_GO
|
||||
uptr GetTlsSize() {
|
||||
#if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NETBSD || \
|
||||
- SANITIZER_OPENBSD || SANITIZER_SOLARIS
|
||||
+ SANITIZER_OPENBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU
|
||||
uptr addr, size;
|
||||
GetTls(&addr, &size);
|
||||
return size;
|
||||
diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h
|
||||
index d81e25580..e10680ac8 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_platform.h
|
||||
+++ b/lib/sanitizer_common/sanitizer_platform.h
|
||||
@@ -208,6 +208,12 @@
|
||||
# define SANITIZER_SOLARIS32 0
|
||||
#endif
|
||||
|
||||
+#if defined(__linux__) && !defined(__GLIBC__)
|
||||
+# define SANITIZER_NONGNU 1
|
||||
+#else
|
||||
+# define SANITIZER_NONGNU 0
|
||||
+#endif
|
||||
+
|
||||
#if defined(__myriad2__)
|
||||
# define SANITIZER_MYRIAD2 1
|
||||
#else
|
||||
diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
|
||||
index f95539a73..6c53b3415 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
|
||||
+++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
|
||||
@@ -39,7 +39,7 @@
|
||||
# include "sanitizer_platform_limits_solaris.h"
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
# define SI_LINUX_NOT_ANDROID 1
|
||||
#else
|
||||
# define SI_LINUX_NOT_ANDROID 0
|
||||
@@ -322,7 +322,7 @@
|
||||
#define SANITIZER_INTERCEPT_ETHER_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID)
|
||||
#define SANITIZER_INTERCEPT_SHMCTL \
|
||||
(SI_NETBSD || SI_OPENBSD || SI_SOLARIS || \
|
||||
- ((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && \
|
||||
+ ((SI_FREEBSD || SI_LINUX_NOT_ANDROID || SANITIZER_NONGNU) && \
|
||||
SANITIZER_WORDSIZE == 64)) // NOLINT
|
||||
#define SANITIZER_INTERCEPT_RANDOM_R SI_LINUX_NOT_ANDROID
|
||||
#define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_POSIX
|
||||
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
index 54da635d7..2f6ff69c3 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
#include "sanitizer_platform.h"
|
||||
|
||||
+// Workaround musl <--> linux conflicting definition of 'struct sysinfo'
|
||||
+#define _LINUX_SYSINFO_H
|
||||
+
|
||||
#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC
|
||||
// Tests in this file assume that off_t-dependent data structures match the
|
||||
// libc ABI. For example, struct dirent here is what readdir() function (as
|
||||
@@ -138,12 +141,14 @@ typedef struct user_fpregs elf_fpregset_t;
|
||||
|
||||
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
#include <glob.h>
|
||||
-#include <obstack.h>
|
||||
+# if !SANITIZER_NONGNU
|
||||
+# include <obstack.h>
|
||||
+# endif
|
||||
#include <mqueue.h>
|
||||
-#include <net/if_ppp.h>
|
||||
-#include <netax25/ax25.h>
|
||||
-#include <netipx/ipx.h>
|
||||
-#include <netrom/netrom.h>
|
||||
+#include <linux/if_ppp.h>
|
||||
+#include <linux/ax25.h>
|
||||
+#include <linux/ipx.h>
|
||||
+#include <linux/netrom.h>
|
||||
#if HAVE_RPC_XDR_H
|
||||
# include <rpc/xdr.h>
|
||||
#elif HAVE_TIRPC_RPC_XDR_H
|
||||
@@ -251,7 +256,7 @@ namespace __sanitizer {
|
||||
unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
|
||||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
// Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
|
||||
// has been removed from glibc 2.28.
|
||||
#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
|
||||
@@ -322,7 +327,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr));
|
||||
unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
|
||||
#endif
|
||||
|
||||
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
||||
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
int glob_nomatch = GLOB_NOMATCH;
|
||||
int glob_altdirfunc = GLOB_ALTDIRFUNC;
|
||||
#endif
|
||||
@@ -416,7 +421,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
|
||||
unsigned struct_termios_sz = sizeof(struct termios);
|
||||
unsigned struct_winsize_sz = sizeof(struct winsize);
|
||||
|
||||
-#if SANITIZER_LINUX
|
||||
+#if SANITIZER_LINUX && !SANITIZER_NONGNU
|
||||
unsigned struct_arpreq_sz = sizeof(struct arpreq);
|
||||
unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf);
|
||||
unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession);
|
||||
@@ -466,7 +471,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
|
||||
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
|
||||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
|
||||
unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
|
||||
#if EV_VERSION > (0x010000)
|
||||
@@ -834,7 +839,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
|
||||
unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE;
|
||||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
|
||||
unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
|
||||
unsigned IOCTL_CYGETMON = CYGETMON;
|
||||
@@ -989,7 +994,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr);
|
||||
CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
|
||||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
|
||||
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
||||
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
CHECK_TYPE_SIZE(glob_t);
|
||||
CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
|
||||
CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
|
||||
@@ -1023,6 +1028,7 @@ CHECK_TYPE_SIZE(iovec);
|
||||
CHECK_SIZE_AND_OFFSET(iovec, iov_base);
|
||||
CHECK_SIZE_AND_OFFSET(iovec, iov_len);
|
||||
|
||||
+#if !SANITIZER_NONGNU
|
||||
CHECK_TYPE_SIZE(msghdr);
|
||||
CHECK_SIZE_AND_OFFSET(msghdr, msg_name);
|
||||
CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen);
|
||||
@@ -1036,6 +1042,7 @@ CHECK_TYPE_SIZE(cmsghdr);
|
||||
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
|
||||
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
|
||||
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
|
||||
+#endif
|
||||
|
||||
#ifndef __GLIBC_PREREQ
|
||||
#define __GLIBC_PREREQ(x, y) 0
|
||||
@@ -1145,7 +1152,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
|
||||
|
||||
CHECK_TYPE_SIZE(ether_addr);
|
||||
|
||||
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
||||
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
CHECK_TYPE_SIZE(ipc_perm);
|
||||
# if SANITIZER_FREEBSD
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, key);
|
||||
@@ -1206,7 +1213,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
|
||||
CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX
|
||||
+#if SANITIZER_LINUX && !SANITIZER_NONGNU
|
||||
COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo));
|
||||
#endif
|
||||
|
||||
@@ -1256,7 +1263,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE);
|
||||
COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE));
|
||||
CHECK_SIZE_AND_OFFSET(FILE, _flags);
|
||||
CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr);
|
||||
@@ -1275,7 +1282,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain);
|
||||
CHECK_SIZE_AND_OFFSET(FILE, _fileno);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk));
|
||||
CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit);
|
||||
CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev);
|
||||
diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc
|
||||
index de989b780..51a97b554 100644
|
||||
--- a/lib/tsan/rtl/tsan_platform_linux.cc
|
||||
+++ b/lib/tsan/rtl/tsan_platform_linux.cc
|
||||
@@ -294,7 +294,7 @@ void InitializePlatform() {
|
||||
// This is required to properly "close" the fds, because we do not see internal
|
||||
// closes within glibc. The code is a pure hack.
|
||||
int ExtractResolvFDs(void *state, int *fds, int nfd) {
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
int cnt = 0;
|
||||
struct __res_state *statp = (struct __res_state*)state;
|
||||
for (int i = 0; i < MAXNS && cnt < nfd; i++) {
|
||||
--
|
||||
2.19.0
|
||||
|
||||
@@ -90,6 +90,7 @@ stdenv.mkDerivation (args // rec {
|
||||
'';
|
||||
|
||||
platforms = with platforms; linux ++ darwin;
|
||||
broken = stdenv.isAarch64 && !stdenv.lib.versionAtLeast version "4.06";
|
||||
};
|
||||
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, makeWrapper, fetchFromGitHub, ocaml, findlib, jbuilder
|
||||
{ stdenv, makeWrapper, fetchFromGitHub, ocaml, findlib, dune
|
||||
, menhir, merlin_extend, ppx_tools_versioned, utop
|
||||
}:
|
||||
|
||||
@@ -15,14 +15,14 @@ stdenv.mkDerivation rec {
|
||||
|
||||
propagatedBuildInputs = [ menhir merlin_extend ppx_tools_versioned ];
|
||||
|
||||
buildInputs = [ makeWrapper ocaml findlib jbuilder utop menhir ];
|
||||
buildInputs = [ makeWrapper ocaml findlib dune utop menhir ];
|
||||
|
||||
buildFlags = [ "build" ]; # do not "make tests" before reason lib is installed
|
||||
|
||||
installPhase = ''
|
||||
for p in reason rtop
|
||||
do
|
||||
${jbuilder.installPhase} $p.install
|
||||
${dune.installPhase} $p.install
|
||||
done
|
||||
|
||||
wrapProgram $out/bin/rtop \
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "sbcl-${version}";
|
||||
version = "1.4.7";
|
||||
version = "1.4.10";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/project/sbcl/sbcl/${version}/${name}-source.tar.bz2";
|
||||
sha256 = "1wmxly94pn8527092hyzg5mq58mg7qlc46nm31f268wb2dm67rvm";
|
||||
sha256 = "1j9wb608pkihpwgzl4qvnr4jl6mb7ngfqy559pxnvmnn1zlyfklh";
|
||||
};
|
||||
|
||||
patchPhase = ''
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
}:
|
||||
|
||||
let
|
||||
v_major = "4.1";
|
||||
version = "${v_major}-RELEASE";
|
||||
version_friendly = "${v_major}";
|
||||
v_base = "4.1.3";
|
||||
version = "${v_base}-RELEASE";
|
||||
version_friendly = "${v_base}";
|
||||
|
||||
tag = "refs/tags/swift-${version}";
|
||||
fetch = { repo, sha256, fetchSubmodules ? false }:
|
||||
@@ -58,7 +58,7 @@ let
|
||||
};
|
||||
llvm = fetch {
|
||||
repo = "swift-llvm";
|
||||
sha256 = "03558f5zbchqvdabi3x9ahyz4xkmj7w69gazivz372832lgr9zfh";
|
||||
sha256 = "0q5cv4iydm8c1kcax32573y3q2cbpihwgj5aa8ws1fnpy4jvq934";
|
||||
};
|
||||
compilerrt = fetch {
|
||||
repo = "swift-compiler-rt";
|
||||
@@ -70,7 +70,7 @@ let
|
||||
};
|
||||
lldb = fetch {
|
||||
repo = "swift-lldb";
|
||||
sha256 = "09x3d3bc6rn9g6jpi3fb120c4r2carsmqla4bq4scjrs0867jz9m";
|
||||
sha256 = "1d0pa7xm289bjb6r52hkkmlngkqkwbwgixnmm30bin2q18mkxk7s";
|
||||
};
|
||||
llbuild = fetch {
|
||||
repo = "swift-llbuild";
|
||||
@@ -86,7 +86,7 @@ let
|
||||
};
|
||||
foundation = fetch {
|
||||
repo = "swift-corelibs-foundation";
|
||||
sha256 = "06pbhb7wg4q5qgprhiyzbqy6hssga7xxjclhlh81gd6rvfd6bxvw";
|
||||
sha256 = "1bhrag63rmz41bg2g6ap01qrdpq37hislgf5hg6myy2v69q7mahx";
|
||||
};
|
||||
libdispatch = fetch {
|
||||
repo = "swift-corelibs-libdispatch";
|
||||
@@ -95,7 +95,7 @@ let
|
||||
};
|
||||
swift = fetch {
|
||||
repo = "swift";
|
||||
sha256 = "1flvr12bg8m4k44yq0xy9qrllv5rpxgxisjgbpakk5p3myfsx7ky";
|
||||
sha256 = "1ydx11pkvaasgjbr29lnha0lpnak758gd5l0aqzmp3q6mcyvfm7a";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -287,6 +287,7 @@ stdenv.mkDerivation rec {
|
||||
# Swift doesn't support 32bit Linux, unknown on other platforms.
|
||||
platforms = platforms.linux;
|
||||
badPlatforms = platforms.i686;
|
||||
broken = stdenv.isAarch64; # 2018-09-04, never built on Hydra
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user