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

pkgsStatic.openssl_3_0 fails to build #160756

Closed
nioncode opened this issue Feb 18, 2022 · 4 comments
Closed

pkgsStatic.openssl_3_0 fails to build #160756

nioncode opened this issue Feb 18, 2022 · 4 comments
Labels

Comments

@nioncode
Copy link
Member

Describe the bug

Building pkgsStatic.openssl_3_0 fails.

Steps To Reproduce

nix-build '<nixpkgs>' -A pkgsStatic.openssl_3_0

After a while, it fails with:

/nix/store/nxk5pcwfv32hfg62klgbzq8gcfg7zjrj-x86_64-unknown-linux-musl-binutils-2.35.2/bin/x86_64-unknown-linux-musl-ld: /nix/store/g51rj8086vryr242nsn6hh7lfdlmf9mb-x86_64-unknown-linux-musl-stage-final-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/nix/store/nxk5pcwfv32hfg62klgbzq8gcfg7zjrj-x86_64-unknown-linux-musl-binutils-2.35.2/bin/x86_64-unknown-linux-musl-ld: /nix/store/g51rj8086vryr242nsn6hh7lfdlmf9mb-x86_64-unknown-linux-musl-stage-final-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/crtend.o: relocation R_X86_64_32 against `.ctors' can not be used when making a shared object; recompile with -fPIC

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.99, NixOS, 21.11 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.16`
 - channels(root): `"nixos-21.11.336020.2128d0aa28e, unstable-20.09pre228384.c27e54de99d, nixos-unstable-20.09pre222244.22a3bf9fb9e"`
 - channels(nion): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@superherointj
Copy link
Contributor

superherointj commented Sep 9, 2022

My notes:

From IRC:

heat: you're linking against a static crtbegin. that is not correct (in this case, you seem to be making a shared lib or a pie executable)
dalias: for some reason you're linking the wrong crt startfiles
heat: I would take a look at i.e alpine's PKGBUILD and see what they're doing, and compare that with nix

https://askubuntu.com/questions/530617/how-to-make-a-static-binary-of-coreutils

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/openssl/default.nix#L115

@robx
Copy link
Contributor

robx commented Sep 19, 2022

This seems to have been fixed in the meantime.

$ nix build nixpkgs#openssl_3_0
$ ldd result-bin/bin/openssl
	not a dynamic executable

@robx
Copy link
Contributor

robx commented Sep 19, 2022

(via c6de1d4)

@superherointj
Copy link
Contributor

Thanks. It is building for me as .#pkgsStatic.openssl_3_0. I'll close this then.

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

No branches or pull requests

4 participants