diff --git a/flake.nix b/flake.nix index 2e923844..8a3a6422 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 d4bd8095..b29da307 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 17264dea..efc6815f 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 ba250dc9..6e18eea8 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 d3943ecb..aea8c6dd 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 ef1a2971..a632357e 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 [