remove a small amount of LLVM bloat

Also avoids libffi.dll dependency on Windows.
This commit is contained in:
Sebastien Bourdeauducq 2021-12-08 17:41:34 +08:00
parent ddb4c548ae
commit 3f73896477
5 changed files with 8 additions and 22 deletions

View File

@ -47,7 +47,7 @@
src = self;
inherit cargoSha256;
nativeBuildInputs = [ pkgs.python3 llvm-nac3 ];
buildInputs = [ pkgs.python3 pkgs.libffi pkgs.libxml2 llvm-nac3 ];
buildInputs = [ pkgs.python3 llvm-nac3 ];
cargoBuildFlags = [ "--package" "nac3artiq" ];
cargoTestFlags = [ "--package" "nac3ast" "--package" "nac3parser" "--package" "nac3core" "--package" "nac3artiq" ];
installPhase =
@ -68,7 +68,7 @@
src = self;
inherit cargoSha256;
nativeBuildInputs = [ pkgs.zip ];
buildInputs = [ pkgs-mingw.libffi pkgs-mingw.zlib ];
buildInputs = [ pkgs-mingw.zlib ];
configurePhase =
''
export PYO3_CONFIG_FILE=${pyo3-mingw-config}
@ -109,8 +109,6 @@
cargo
cargo-insta
rustc
libffi
libxml2
clippy
(python3.withPackages(ps: [ ps.numpy ]))
];

View File

@ -4,21 +4,13 @@
, fetchpatch
, cmake
, python3
, libffi
, libbfd
, libpfm
, libxml2
, ncurses
, zlib
, llvmPackages_12
, debugVersion ? false
, enableManpages ? false
, enableSharedLibraries ? (!stdenv.hostPlatform.isStatic && !stdenv.targetPlatform.isMinGW)
, enablePFM ? !(stdenv.isDarwin
|| stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245
|| stdenv.isAarch32 # broken for the armv7l builder
|| stdenv.targetPlatform.isMinGW
)
, enableSharedLibraries ? false
, enablePolly ? false
}:
@ -59,8 +51,7 @@ in stdenv.mkDerivation (rec {
nativeBuildInputs = [ cmake python3 ]
++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ];
buildInputs = [ libxml2 libffi ]
++ optional enablePFM libpfm; # exegesis
buildInputs = [ ];
propagatedBuildInputs = optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ ncurses ]
++ [ zlib ];
@ -128,13 +119,10 @@ in stdenv.mkDerivation (rec {
cmakeFlags = with stdenv; [
"-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/"
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
"-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
"-DLLVM_BUILD_TESTS=${if stdenv.targetPlatform.isMinGW then "OFF" else "ON"}"
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_ENABLE_RTTI=ON"
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_ENABLE_DUMP=ON"
"-DLLVM_ENABLE_UNWIND_TABLES=OFF"
"-DLLVM_TARGETS_TO_BUILD=X86;ARM;RISCV"
] ++ optionals enableSharedLibraries [
"-DLLVM_LINK_LLVM_DYLIB=ON"

View File

@ -19,4 +19,4 @@ nac3core = { path = "../nac3core" }
git = "https://github.com/TheDan64/inkwell"
branch = "master"
default-features = false
features = ["llvm12-0", "target-x86", "target-arm", "target-riscv"]
features = ["llvm12-0", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"]

View File

@ -17,7 +17,7 @@ nac3parser = { path = "../nac3parser" }
git = "https://github.com/TheDan64/inkwell"
branch = "master"
default-features = false
features = ["llvm12-0", "target-x86", "target-arm", "target-riscv"]
features = ["llvm12-0", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"]
[dev-dependencies]
test-case = "1.2.0"

View File

@ -13,4 +13,4 @@ nac3core = { path = "../nac3core" }
git = "https://github.com/TheDan64/inkwell"
branch = "master"
default-features = false
features = ["llvm12-0", "target-x86", "target-arm", "target-riscv"]
features = ["llvm12-0", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"]