about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-11-03 00:07:04 +0000
committerGitHub <noreply@github.com>2021-11-03 00:07:04 +0000
commit890e555b5281717248ed2949b68156e7f34f9f59 (patch)
tree9cf8fbef7316bb76e699284d0f5defe121ab0b1d /pkgs/development/compilers
parentcf8d67294b5d22dc3676a78d329cbb1db33c1578 (diff)
parent2a9336b426753b1f948bed19c97f07b0f081be46 (diff)
Merge master into haskell-updates
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/asl/Makefile-nixos.def31
-rw-r--r--pkgs/development/compilers/asl/default.nix57
-rw-r--r--pkgs/development/compilers/rust/1_45.nix54
-rw-r--r--pkgs/development/compilers/rust/1_55.nix3
-rw-r--r--pkgs/development/compilers/rust/default.nix3
-rw-r--r--pkgs/development/compilers/rust/rustc.nix7
6 files changed, 98 insertions, 57 deletions
diff --git a/pkgs/development/compilers/asl/Makefile-nixos.def b/pkgs/development/compilers/asl/Makefile-nixos.def
new file mode 100644
index 0000000000000..0f41510733c18
--- /dev/null
+++ b/pkgs/development/compilers/asl/Makefile-nixos.def
@@ -0,0 +1,31 @@
+# -------------------------------------------------------------------------
+# choose your compiler (must be ANSI-compliant!) and linker command, plus
+# any additionally needed flags
+
+OBJDIR = .objdir/
+CC = cc
+CFLAGS = -g -fomit-frame-pointer -Wall
+HOST_OBJEXTENSION = .o
+LD = $(CC)
+LDFLAGS =
+HOST_EXEXTENSION =
+
+# no cross build
+
+TARG_OBJDIR = $(OBJDIR)
+TARG_CC = $(CC)
+TARG_CFLAGS = $(CFLAGS)
+TARG_OBJEXTENSION = $(HOST_OBJEXTENSION)
+TARG_LD = $(LD)
+TARG_LDFLAGS = $(LDFLAGS)
+TARG_EXEXTENSION = $(HOST_EXEXTENSION)
+
+# -------------------------------------------------------------------------
+# directories where binaries, includes, and manpages should go during
+# installation
+
+BINDIR = @bindir@
+INCDIR = @incdir@
+MANDIR = @mandir@
+LIBDIR = @libdir@
+DOCDIR = @docdir@
diff --git a/pkgs/development/compilers/asl/default.nix b/pkgs/development/compilers/asl/default.nix
new file mode 100644
index 0000000000000..981dde1e7a733
--- /dev/null
+++ b/pkgs/development/compilers/asl/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, stdenv
+, fetchzip
+, buildDocs? false, tex
+}:
+
+stdenv.mkDerivation rec {
+  pname = "asl";
+  version = "142-bld211";
+
+  src = fetchzip {
+    name = "${pname}-${version}";
+    url = "http://john.ccac.rwth-aachen.de:8000/ftp/as/source/c_version/asl-current-${version}.tar.bz2";
+    hash = "sha256-Sbm16JX7kC/7Ws7YgNBUXNqOCl6u+RXgfNjTODhCzSM=";
+  };
+
+  nativeBuildInputs = lib.optional buildDocs [ tex ];
+
+  postPatch = lib.optionalString (!buildDocs) ''
+    substituteInPlace Makefile --replace "all: binaries docs" "all: binaries"
+  '';
+
+  dontConfigure = true;
+
+  preBuild = ''
+    bindir="${placeholder "out"}/bin" \
+    docdir="${placeholder "out"}/doc/asl" \
+    incdir="${placeholder "out"}/include/asl" \
+    libdir="${placeholder "out"}/lib/asl" \
+    mandir="${placeholder "out"}/share/man" \
+    substituteAll ${./Makefile-nixos.def} Makefile.def
+    mkdir -p .objdir
+  '';
+
+  hardenedDisable = [ "all" ];
+
+  # buildTargets = [ "binaries" "docs" ];
+
+  meta = with lib; {
+    homepage = "http://john.ccac.rwth-aachen.de:8000/as/index.html";
+    description = "Portable macro cross assembler";
+    longDescription = ''
+      AS is a portable macro cross assembler for a variety of microprocessors
+      and -controllers. Though it is mainly targeted at embedded processors and
+      single-board computers, you also find CPU families in the target list that
+      are used in workstations and PCs.
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
+# TODO: multiple outputs
+# TODO: cross-compilation support
+# TODO: customize TeX input
+# TODO: report upstream about `mkdir -p .objdir/`
+# TODO: suggest upstream about building docs as an option
diff --git a/pkgs/development/compilers/rust/1_45.nix b/pkgs/development/compilers/rust/1_45.nix
deleted file mode 100644
index 2c695f1844dc6..0000000000000
--- a/pkgs/development/compilers/rust/1_45.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-# New rust versions should first go to staging.
-# Things to check after updating:
-# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
-#    i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
-#    This testing can be also done by other volunteers as part of the pull
-#    request review, in case platforms cannot be covered.
-# 2. The LLVM version used for building should match with rust upstream.
-# 3. Firefox and Thunderbird should still build on x86_64-linux.
-
-{ stdenv, lib
-, buildPackages
-, newScope, callPackage
-, CoreFoundation, Security, SystemConfiguration
-, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
-, makeRustPlatform
-, llvmPackages_5, llvm_10
-} @ args:
-
-import ./default.nix {
-  rustcVersion = "1.45.2";
-  rustcSha256 = "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp";
-
-  llvmSharedForBuild = pkgsBuildBuild.llvmPackages_10.libllvm.override { enableSharedLibraries = true; };
-  llvmSharedForHost = pkgsBuildHost.llvmPackages_10.libllvm.override { enableSharedLibraries = true; };
-  llvmSharedForTarget = pkgsBuildTarget.llvmPackages_10.libllvm.override { enableSharedLibraries = true; };
-
-  llvmBootstrapForDarwin = llvmPackages_5;
-
-  # For use at runtime
-  llvmShared = llvm_10.override { enableSharedLibraries = true; };
-
-  # Note: the version MUST be one version prior to the version we're
-  # building
-  bootstrapVersion = "1.44.1";
-
-  # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
-  bootstrapHashes = {
-    i686-unknown-linux-gnu = "e69689b0a1b66599cf83e7dd54f839419007e44376195e93e301a3175da3d854";
-    x86_64-unknown-linux-gnu = "a41df89a461a580536aeb42755e43037556fba2e527dd13a1e1bb0749de28202";
-    x86_64-unknown-linux-musl = "7eeef2b7488ee96015db10bc52c43f6e023debc9a955ccb8efb382522bf35be9";
-    arm-unknown-linux-gnueabihf = "ea18ccdfb62a153c2d43d013fdec56993cc9267f1cdc6f3834df8a2b9b468f08";
-    armv7-unknown-linux-gnueabihf = "d44294732cf268ea84908f1135f574ab9489132a332eaa9d5bda547374b15d54";
-    aarch64-unknown-linux-gnu = "a2d74ebeec0b6778026b6c37814cdc91d14db3b0d8b6d69d036216f4d9cf7e49";
-    x86_64-apple-darwin = "a5464e7bcbce9647607904a4afa8362382f1fc55d39e7bbaf4483ac00eb5d56a";
-    powerpc64le-unknown-linux-gnu = "22deeca259459db31065af7c862fcab7fbfb623200520c65002ed2ba93d87ad2";
-  };
-
-  selectRustPackage = pkgs: pkgs.rust_1_45;
-
-  rustcPatches = [
-  ];
-}
-
-(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_5" "llvm_10" ])
diff --git a/pkgs/development/compilers/rust/1_55.nix b/pkgs/development/compilers/rust/1_55.nix
index edd1f538e398a..85a8b65b11a1e 100644
--- a/pkgs/development/compilers/rust/1_55.nix
+++ b/pkgs/development/compilers/rust/1_55.nix
@@ -32,6 +32,9 @@ import ./default.nix {
   # For use at runtime
   llvmShared = llvm_12.override { enableSharedLibraries = true; };
 
+  # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox
+  llvmPackagesForBuild = pkgsBuildBuild.llvmPackages_12;
+
   # Note: the version MUST be one version prior to the version we're
   # building
   bootstrapVersion = "1.54.0";
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index 7912055db6247..59420477119c6 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -10,6 +10,7 @@
 , llvmSharedForBuild
 , llvmSharedForHost
 , llvmSharedForTarget
+, llvmPackagesForBuild # Exposed through rustc for LTO in Firefox
 }:
 { stdenv, lib
 , buildPackages
@@ -85,7 +86,7 @@
         version = rustcVersion;
         sha256 = rustcSha256;
         inherit enableRustcDev;
-        inherit llvmShared llvmSharedForBuild llvmSharedForHost llvmSharedForTarget;
+        inherit llvmShared llvmSharedForBuild llvmSharedForHost llvmSharedForTarget llvmPackagesForBuild;
 
         patches = rustcPatches;
 
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index dae9440924094..187127cfbfb39 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
-, llvmShared, llvmSharedForBuild, llvmSharedForHost, llvmSharedForTarget
+, llvmShared, llvmSharedForBuild, llvmSharedForHost, llvmSharedForTarget, llvmPackagesForBuild
 , fetchurl, file, python3
 , darwin, cmake, rust, rustPlatform
 , pkg-config, openssl
@@ -174,7 +174,10 @@ in stdenv.mkDerivation rec {
 
   requiredSystemFeatures = [ "big-parallel" ];
 
-  passthru.llvm = llvmShared;
+  passthru = {
+    llvm = llvmShared;
+    llvmPackages = llvmPackagesForBuild;
+  };
 
   meta = with lib; {
     homepage = "https://www.rust-lang.org/";