From 2e6fc4cfe54214eb715e5c57ee9a36efdaafa10a Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 22 Apr 2022 19:18:35 +0100 Subject: [PATCH] [tmp] nix: Switch to aarch64-darwin --- flake.nix | 15 ++++++++------- nac3artiq/Cargo.toml | 2 +- nac3core/Cargo.toml | 2 +- nac3core/src/codegen/irrt/irrt.c | 7 +------ nac3standalone/Cargo.toml | 2 +- nix/llvm/default.nix | 2 +- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 2e9238440..8a3a6422c 100644 --- a/flake.nix +++ b/flake.nix @@ -5,9 +5,9 @@ outputs = { self, nixpkgs }: let - pkgs = import nixpkgs { system = "x86_64-linux"; }; + pkgs = import nixpkgs { system = "aarch64-darwin"; }; in rec { - packages.x86_64-linux = rec { + packages.aarch64-darwin = rec { llvm-nac3 = pkgs.callPackage ./nix/llvm {}; nac3artiq = pkgs.python3Packages.toPythonModule ( pkgs.rustPlatform.buildRustPackage rec { @@ -142,25 +142,26 @@ packages.x86_64-w64-mingw32 = import ./nix/windows { inherit pkgs; }; - devShell.x86_64-linux = pkgs.mkShell { + devShell.aarch64-darwin = pkgs.mkShell { name = "nac3-dev-shell"; buildInputs = with pkgs; [ # build dependencies - packages.x86_64-linux.llvm-nac3 + packages.aarch64-darwin.llvm-nac3 llvmPackages_13.clang-unwrapped # IRRT pkgs.llvmPackages_13.llvm.out # IRRT + libiconv cargo rustc # runtime dependencies lld_13 - (packages.x86_64-linux.python3-mimalloc.withPackages(ps: [ ps.numpy ])) + (packages.aarch64-darwin.python3-mimalloc.withPackages(ps: [ ps.numpy ])) # development tools cargo-insta clippy rustfmt ]; }; - devShells.x86_64-linux.msys2 = pkgs.mkShell { + devShells.aarch64-darwin.msys2 = pkgs.mkShell { name = "nac3-dev-shell-msys2"; buildInputs = with pkgs; [ curl @@ -171,7 +172,7 @@ }; hydraJobs = { - inherit (packages.x86_64-linux) llvm-nac3 nac3artiq nac3artiq-pgo; + inherit (packages.aarch64-darwin) llvm-nac3 nac3artiq nac3artiq-pgo; llvm-nac3-msys2 = packages.x86_64-w64-mingw32.llvm-nac3; nac3artiq-msys2 = packages.x86_64-w64-mingw32.nac3artiq; nac3artiq-msys2-pkg = packages.x86_64-w64-mingw32.nac3artiq-pkg; diff --git a/nac3artiq/Cargo.toml b/nac3artiq/Cargo.toml index d4bd80951..b29da3074 100644 --- a/nac3artiq/Cargo.toml +++ b/nac3artiq/Cargo.toml @@ -19,7 +19,7 @@ nac3core = { path = "../nac3core" } git = "https://github.com/nbaksalyar/inkwell.git" branch = "llvm14" default-features = false -features = ["llvm14-0", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"] +features = ["llvm14-0", "target-aarch64", "target-arm", "target-riscv", "no-libffi-linking"] [features] init-llvm-profile = [] diff --git a/nac3core/Cargo.toml b/nac3core/Cargo.toml index 17264deac..efc6815fa 100644 --- a/nac3core/Cargo.toml +++ b/nac3core/Cargo.toml @@ -15,7 +15,7 @@ nac3parser = { path = "../nac3parser" } git = "https://github.com/nbaksalyar/inkwell.git" branch = "llvm14" default-features = false -features = ["llvm14-0", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"] +features = ["llvm14-0", "target-aarch64", "target-arm", "target-riscv", "no-libffi-linking"] [dev-dependencies] test-case = "1.2.0" diff --git a/nac3core/src/codegen/irrt/irrt.c b/nac3core/src/codegen/irrt/irrt.c index ba250dc9a..6e18eea84 100644 --- a/nac3core/src/codegen/irrt/irrt.c +++ b/nac3core/src/codegen/irrt/irrt.c @@ -1,9 +1,4 @@ -typedef _ExtInt(8) int8_t; -typedef unsigned _ExtInt(8) uint8_t; -typedef _ExtInt(32) int32_t; -typedef unsigned _ExtInt(32) uint32_t; -typedef _ExtInt(64) int64_t; -typedef unsigned _ExtInt(64) uint64_t; +#include "stdint.h" # define MAX(a, b) (a > b ? a : b) # define MIN(a, b) (a > b ? b : a) diff --git a/nac3standalone/Cargo.toml b/nac3standalone/Cargo.toml index d3943ecb5..aea8c6dda 100644 --- a/nac3standalone/Cargo.toml +++ b/nac3standalone/Cargo.toml @@ -13,4 +13,4 @@ nac3core = { path = "../nac3core" } git = "https://github.com/nbaksalyar/inkwell.git" branch = "llvm14" default-features = false -features = ["llvm14-0", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"] +features = ["llvm14-0", "target-aarch64", "target-arm", "target-riscv", "no-libffi-linking"] diff --git a/nix/llvm/default.nix b/nix/llvm/default.nix index ef1a2971b..a632357eb 100644 --- a/nix/llvm/default.nix +++ b/nix/llvm/default.nix @@ -115,7 +115,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_ENABLE_THREADS=OFF" "-DLLVM_INCLUDE_BENCHMARKS=OFF" "-DLLVM_BUILD_TOOLS=OFF" - "-DLLVM_TARGETS_TO_BUILD=X86;ARM;RISCV" + "-DLLVM_TARGETS_TO_BUILD=host;ARM;RISCV" ] ++ optionals enableSharedLibraries [ "-DLLVM_LINK_LLVM_DYLIB=ON" ] ++ optionals enableManpages [