Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crystalStatic doesn't build on x86-linux #19

Open
rbishop opened this issue Feb 8, 2024 · 1 comment
Open

crystalStatic doesn't build on x86-linux #19

rbishop opened this issue Feb 8, 2024 · 1 comment

Comments

@rbishop
Copy link
Collaborator

rbishop commented Feb 8, 2024

Fails due to undefined references. It seems to be trying to use musl instead of libc on my machine

error: builder for '/nix/store/1x5ms4d6dnf92bv992534chxvr7k222q-check-crystal-static-x86_64-unknown-linux-musl-1.11.2.drv' failed with exit code 1;
       last 6 log lines:
       > /nix/store/0gi4vbw1qfjncdl95a9ply43ymd6aprm-binutils-2.40/bin/ld: /nix/store/6wfpsbqw40awg87x05h7c3fm26vdlvir-libevent-static-x86_64-unknown-linux-musl-2.1.12/lib/libevent.a(evutil.o): in function `evutil_getenv_':
       > (.text+0x2ca5): undefined reference to `issetugid'
       > /nix/store/0gi4vbw1qfjncdl95a9ply43ymd6aprm-binutils-2.40/bin/ld: /nix/store/38zmyyxnqgw5cpxa83gmwvy4acjyr2k4-boehm-gc-static-x86_64-unknown-linux-musl-8.2.2/lib/libgc.a(os_dep.o): in function `GC_find_limit_with_bound':
       > (.text+0xc74): undefined reference to `sigsetjmp'
       > collect2: error: ld returned 1 exit status
       > Error: execution of command failed with exit status 1: gcc "${@}" -o /build/.crystal/crystal-run-eval.tmp  -rdynamic -L/nix/store/38zmyyxnqgw5cpxa83gmwvy4acjyr2k4-boehm-gc-static-x86_64-unknown-linux-musl-8.2.2/lib -L/nix/store/vdh847lbm49x56gxg02582vy8mcmpybh-gmp-with-cxx-static-x86_64-unknown-linux-musl-6.3.0/lib -L/nix/store/6wfpsbqw40awg87x05h7c3fm26vdlvir-libevent-static-x86_64-unknown-linux-musl-2.1.12/lib -L/nix/store/vpnsiap6kdzq0r71m0v9gaa8wwyawr33-libffi-static-x86_64-unknown-linux-musl-3.4.4/lib -L/nix/store/wmxp34wwc7j3lw4fwl50h6vpznhlqljs-libxml2-static-x86_64-unknown-linux-musl-2.12.3-unstable-2023-12-14/lib -L/nix/store/1b39nmcnl43y25iykv6shx6vn04rsl8a-libyaml-static-x86_64-unknown-linux-musl-0.2.5/lib -L/nix/store/i3b5b73wmd7z9yq4gg77r0a0vqplx41a-openssl-static-x86_64-unknown-linux-musl-3.0.12/lib -L/nix/store/d2j05qn5w25q4zgnbr0wqlhck91416bs-pcre2-static-x86_64-unknown-linux-musl-10.42/lib -L/nix/store/jvkmzfyri69xi8b30g0zi53hr8am67vz-zlib-static-x86_64-unknown-linux-musl-1.3/lib -lpcre2-8 -lgc -lpthread -levent -lrt -lpthread -ldl
@rbishop
Copy link
Collaborator Author

rbishop commented Feb 8, 2024

An issue could be that it is still dynamically linked, at least for libc

~/c/crunchy-nixpkgs ❯❯❯ nix build .\#crystalStatic                                                                                                                                 downgrade-llvm-15 ✱ ◼
~/c/crunchy-nixpkgs ❯❯❯ file result/bin/crystal                                                                                                                                    downgrade-llvm-15 ✱ ◼
result/bin/crystal: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/ka137y1kby5x1v0wknzzfgzack4156yc-musl-static-x86_64-unknown-linux-musl-1.2.3/lib/ld-musl-x86_64.so.1, not stripped
~/c/crunchy-nixpkgs ❯❯❯ ldd result/bin/crystal                                                                                                                                     downgrade-llvm-15 ✱ ◼
        linux-vdso.so.1 (0x00007ffd0fde4000)
        libc.so => /nix/store/ka137y1kby5x1v0wknzzfgzack4156yc-musl-static-x86_64-unknown-linux-musl-1.2.3/lib/libc.so (0x00007f5bafba2000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant