From 675c46816a736ac43662c25a13e5c01c192741be Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 28 Oct 2020 20:19:50 -0400 Subject: [PATCH 1/4] Explicitly use llvm-as-10 --- ci/install-ci-libraries.sh | 3 --- compiler/builtins/build.rs | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ci/install-ci-libraries.sh b/ci/install-ci-libraries.sh index 6ac397c10d..ae7e92be0f 100755 --- a/ci/install-ci-libraries.sh +++ b/ci/install-ci-libraries.sh @@ -65,6 +65,3 @@ apt-get install -y clang-$LLVM_VERSION lldb-$LLVM_VERSION lld-$LLVM_VERSION clan wget -c https://ziglang.org/builds/zig-linux-x86_64-0.6.0+0088efc4b.tar.xz --no-check-certificate tar -xf zig-linux-x86_64-0.6.0+0088efc4b.tar.xz ln -s "$PWD/zig-linux-x86_64-0.6.0+0088efc4b/zig" /usr/local/bin/zig - -# symlink llvm tools -ln -s /usr/bin/llvm-as-10 /usr/local/bin/llvm-as diff --git a/compiler/builtins/build.rs b/compiler/builtins/build.rs index 19291ae333..711b7e4252 100644 --- a/compiler/builtins/build.rs +++ b/compiler/builtins/build.rs @@ -62,7 +62,7 @@ fn main() { let dest_bc = dest_bc_path.to_str().expect("Invalid dest bc path"); println!("Compiling bitcode to: {}", dest_bc); - run_command("llvm-as", &[dest_ll, "-o", dest_bc]); + run_command("llvm-as-10", &[dest_ll, "-o", dest_bc]); println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed={}", src_path_str); From a3dcf4aa59de616075c5b9c44423d8e82b2ffa1e Mon Sep 17 00:00:00 2001 From: Jared Ramirez Date: Wed, 28 Oct 2020 18:17:58 -0700 Subject: [PATCH 2/4] Add llvm-as alias --- .envrc | 2 ++ nix/bin/llvm-as-10 | 2 ++ shell.nix | 4 ++++ 3 files changed, 8 insertions(+) create mode 100755 nix/bin/llvm-as-10 diff --git a/.envrc b/.envrc index 45097a203e..f887c7beec 100644 --- a/.envrc +++ b/.envrc @@ -152,3 +152,5 @@ validate_version() { } use_nix -s shell.nix + +PATH_add nix/bin diff --git a/nix/bin/llvm-as-10 b/nix/bin/llvm-as-10 new file mode 100755 index 0000000000..65839a9b5a --- /dev/null +++ b/nix/bin/llvm-as-10 @@ -0,0 +1,2 @@ +#!/bin/sh +llvm-as "$@" diff --git a/shell.nix b/shell.nix index ffcdeb2d37..acad5882e0 100644 --- a/shell.nix +++ b/shell.nix @@ -52,5 +52,9 @@ let in pkgs.mkShell { buildInputs = inputs ++ darwin-frameworks; LLVM_SYS_100_PREFIX = "${llvm}"; + shellHook = '' + alias llvm-as-10="llvm-as" + export S=$SHELL + ''; } From 710d1ad6296f3bdd87e1f321fb89a21c8e493344 Mon Sep 17 00:00:00 2001 From: Jared Ramirez Date: Wed, 28 Oct 2020 18:20:56 -0700 Subject: [PATCH 3/4] Add llvm-as alias to nix shell rather then direnv --- .envrc | 2 -- shell.nix | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.envrc b/.envrc index f887c7beec..45097a203e 100644 --- a/.envrc +++ b/.envrc @@ -152,5 +152,3 @@ validate_version() { } use_nix -s shell.nix - -PATH_add nix/bin diff --git a/shell.nix b/shell.nix index acad5882e0..581e75b012 100644 --- a/shell.nix +++ b/shell.nix @@ -54,7 +54,7 @@ in pkgs.mkShell { LLVM_SYS_100_PREFIX = "${llvm}"; shellHook = '' alias llvm-as-10="llvm-as" - export S=$SHELL + export PATH="$PATH:$PWD/nix/bin" ''; } From 2bbd33bc1a989140463cf2db83a366c9fe53b3eb Mon Sep 17 00:00:00 2001 From: Jared Ramirez Date: Wed, 28 Oct 2020 18:22:54 -0700 Subject: [PATCH 4/4] Fix nix shell hook; Add comment --- shell.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 581e75b012..94386b1d82 100644 --- a/shell.nix +++ b/shell.nix @@ -52,8 +52,9 @@ let in pkgs.mkShell { buildInputs = inputs ++ darwin-frameworks; LLVM_SYS_100_PREFIX = "${llvm}"; + + # Aliases don't work cross shell, so we do this shellHook = '' - alias llvm-as-10="llvm-as" export PATH="$PATH:$PWD/nix/bin" ''; }