Skip to content

llvmPackages_15: missing libffi.so.8 at runtime #214282

@nektro

Description

@nektro

Steps To Reproduce

Steps to reproduce the behavior:

  1. trying to build https://github.com/ziglang/zig.git from source
  2. mkdir build && cd build
  3. cmake ..
  4. make install
with import <nixpkgs> {};

pkgs.mkShell {
  nativeBuildInputs = with pkgs; [
    cmake
    gdb
    libxml2
    ninja
    qemu
    wasmtime
    zlib
  ] ++ (with llvmPackages_15; [
    clang
    clang-unwrapped
    lld
    llvm
  ]);

  hardeningDisable = [ "all" ];
}

Build log

[nix-shell:~/src/zig/build]$ cmake ..
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/1y8i61anhs9hh1g5x3zw2fvdbivwixzg-gcc-wrapper-11.3.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/1y8i61anhs9hh1g5x3zw2fvdbivwixzg-gcc-wrapper-11.3.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring zig version 0.11.0-dev.1465+d64dd75e3
-- Found llvm: -lLLVM-15;-lrt;-ldl;-lm;-lz;-ltinfo;-lxml2 (Required is at least version "15") 
-- Found clang: /nix/store/yws5gcxdm5sdq5wrldh2bj47vb0i0nv8-clang-15.0.7-lib/lib/libclang-cpp.so.15 (Required is at least version "15") 
-- Found lld: /nix/store/nzacynck36m2fkl4p8m7m4jx78dcg7hs-lld-15.0.7-lib/lib/liblldMinGW.a;/nix/store/nzacynck36m2fkl4p8m7m4jx78dcg7hs-lld-15.0.7-lib/lib/liblldELF.a;/nix/store/nzacynck36m2fkl4p8m7m4jx78dcg7hs-lld-15.0.7-lib/lib/liblldCOFF.a;/nix/store/nzacynck36m2fkl4p8m7m4jx78dcg7hs-lld-15.0.7-lib/lib/liblldWasm.a;/nix/store/nzacynck36m2fkl4p8m7m4jx78dcg7hs-lld-15.0.7-lib/lib/liblldMachO.a;/nix/store/nzacynck36m2fkl4p8m7m4jx78dcg7hs-lld-15.0.7-lib/lib/liblldCommon.a (Required is at least version "15") 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/meghan/src/zig/build

[nix-shell:~/src/zig/build]$ make install
[  5%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_llvm.cpp.o
[ 10%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_llvm-ar.cpp.o
[ 15%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang.cpp.o
[ 20%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_driver.cpp.o
[ 25%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_cc1_main.cpp.o
[ 30%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_cc1as_main.cpp.o
[ 35%] Building CXX object CMakeFiles/zigcpp.dir/src/windows_sdk.cpp.o
[ 40%] Linking CXX static library zigcpp/libzigcpp.a
[ 40%] Built target zigcpp
[ 45%] Building C object CMakeFiles/zig-wasm2c.dir/stage1/wasm2c.c.o
[ 50%] Linking C executable zig-wasm2c
[ 50%] Built target zig-wasm2c
[ 55%] Converting /home/meghan/src/zig/stage1/zig1.wasm to /home/meghan/src/zig/build/zig1.c
[ 60%] Building C object CMakeFiles/zig1.dir/zig1.c.o
[ 65%] Building C object CMakeFiles/zig1.dir/stage1/wasi.c.o
[ 70%] Linking C executable zig1
[ 70%] Built target zig1
[ 75%] Running zig1.wasm to produce /home/meghan/src/zig/build/zig2.c
[ 80%] Running zig1.wasm to produce /home/meghan/src/zig/build/compiler_rt.c
[ 85%] Building C object CMakeFiles/zig2.dir/zig2.c.o
/home/meghan/src/zig/build/zig2.c: In function ‘crypto_blake3_Output_chainingValue’:
/home/meghan/src/zig/build/zig2.c:2576006: warning: ‘crypto_blake3_CompressGeneric_compress’ reading 64 bytes from a region of size 32 [-Wstringop-overread]
2576006 |  t11 = crypto_blake3_CompressGeneric_compress(t2, t4, t6, t8, t10);
        | 
/home/meghan/src/zig/build/zig2.c:2576006: note: referencing argument 2 of type ‘const zig_u32 * const’ {aka ‘const unsigned int * const’}
/home/meghan/src/zig/build/zig2.c:2736956: note: in a call to function ‘crypto_blake3_CompressGeneric_compress’
2736956 | static zig_T_tuple_7b_5b16_5du32_7d_60048 crypto_blake3_CompressGeneric_compress(zig_u32 const a0[zig_const_arr zig_as_u64(8)], zig_u32 const a1[zig_const_arr zig_as_u64(16)], zig_u32 const a2, zig_u64 const a3, zig_u8 const a4) {
        | 
/home/meghan/src/zig/build/zig2.c: In function ‘crypto_blake3_ChunkState_update’:
/home/meghan/src/zig/build/zig2.c:2576184: warning: ‘crypto_blake3_CompressGeneric_compress’ reading 64 bytes from a region of size 32 [-Wstringop-overread]
2576184 |     t27 = crypto_blake3_CompressGeneric_compress(t17, t11, zig_as_u32(64), t4, t26);
        | 
/home/meghan/src/zig/build/zig2.c:2576184: note: referencing argument 2 of type ‘const zig_u32 * const’ {aka ‘const unsigned int * const’}
/home/meghan/src/zig/build/zig2.c:2736956: note: in a call to function ‘crypto_blake3_CompressGeneric_compress’
2736956 | static zig_T_tuple_7b_5b16_5du32_7d_60048 crypto_blake3_CompressGeneric_compress(zig_u32 const a0[zig_const_arr zig_as_u64(8)], zig_u32 const a1[zig_const_arr zig_as_u64(16)], zig_u32 const a2, zig_u64 const a3, zig_u8 const a4) {
        | 
/home/meghan/src/zig/build/zig2.c: In function ‘crypto_blake3_Output_rootOutputBytes’:
/home/meghan/src/zig/build/zig2.c:2576339: warning: ‘crypto_blake3_CompressGeneric_compress’ reading 64 bytes from a region of size 32 [-Wstringop-overread]
2576339 |    t19 = crypto_blake3_CompressGeneric_compress(t9, t11, t13, t18, t17);
        | 
/home/meghan/src/zig/build/zig2.c:2576339: note: referencing argument 2 of type ‘const zig_u32 * const’ {aka ‘const unsigned int * const’}
/home/meghan/src/zig/build/zig2.c:2736956: note: in a call to function ‘crypto_blake3_CompressGeneric_compress’
2736956 | static zig_T_tuple_7b_5b16_5du32_7d_60048 crypto_blake3_CompressGeneric_compress(zig_u32 const a0[zig_const_arr zig_as_u64(8)], zig_u32 const a1[zig_const_arr zig_as_u64(16)], zig_u32 const a2, zig_u64 const a3, zig_u8 const a4) {
        | 
[ 90%] Building C object CMakeFiles/zig2.dir/compiler_rt.c.o
[ 95%] Linking CXX executable zig2
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: warning: libffi.so.8, needed by /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so, not found (try using -rpath or -rpath-link)
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_prep_cif@LIBFFI_BASE_8.0'
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_type_sint16@LIBFFI_BASE_8.0'
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_type_float@LIBFFI_BASE_8.0'
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_type_sint32@LIBFFI_BASE_8.0'
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_type_sint64@LIBFFI_BASE_8.0'
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_type_pointer@LIBFFI_BASE_8.0'
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_type_sint8@LIBFFI_BASE_8.0'
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_call@LIBFFI_BASE_8.0'
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_type_void@LIBFFI_BASE_8.0'
/nix/store/r2b9k28c6aghczpqfvh71y9xavm7rr68-binutils-2.39/bin/ld: /nix/store/vzcrnrflmclrh1780f9fh7dr164pisbg-llvm-15.0.7-lib/lib/libLLVM-15.so: undefined reference to `ffi_type_double@LIBFFI_BASE_8.0'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/zig2.dir/build.make:975: zig2] Error 1
make[1]: *** [CMakeFiles/Makefile2:170: CMakeFiles/zig2.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[meghan@nixos:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.82, NixOS, 22.05 (Quokka), 22.05.4498.5cb48ea3c19`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(root): `"nixos-22.05, nixos-hardware"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
[meghan@nixos:~]$ nix-instantiate -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz --eval -E '(import <nixpkgs> {}).lib.version'
"23.05pre-git"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions