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

closure-size: chntpw broken, due to static libc being split out? #11474

Closed
deepfire opened this issue Dec 5, 2015 · 1 comment
Closed

closure-size: chntpw broken, due to static libc being split out? #11474

deepfire opened this issue Dec 5, 2015 · 1 comment
Labels
6.topic: closure size The final size of a derivation, including its dependencies

Comments

@deepfire
Copy link
Contributor

deepfire commented Dec 5, 2015

Where does one read about the new rules of engagement in the closure-size?

It appears as if chntpw fails because a static variant of libc is no longer included:

gcc -DUSEOPENSSL -g -I. -I/usr/include -Wall -o chntpw chntpw.o ntreg.o edlib.o libsam.o -L/usr/lib64
gcc -static -DUSEOPENSSL -g -I. -I/usr/include -Wall -o chntpw.static chntpw.o ntreg.o edlib.o libsam.o -L/usr/lib64
/nix/store/2nk952dds3mrpz3spny7d2rzsl0b14fd-binutils-2.23.1-dev/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Makefile:40: recipe for target 'chntpw.static' failed
make: *** [chntpw.static] Error 1
builder for ‘/nix/store/7x301a8m6i31j44qzdbkl1qzwj2q9nfb-chntpw-140201.drv’ failed with exit code 2

How do I feed chntpw a static libc?

@vcunat vcunat added the 6.topic: closure size The final size of a derivation, including its dependencies label Dec 5, 2015
@vcunat
Copy link
Member

vcunat commented Dec 5, 2015

When I do, I'm getting a linking error.

gcc -DUSEOPENSSL -g -I. -I/usr/include -Wall -o chntpw chntpw.o ntreg.o edlib.o libsam.o -L/usr/lib64
/nix/store/2nk952dds3mrpz3spny7d2rzsl0b14fd-binutils-2.23.1-dev/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/nix/store/cpsjnimypd5n9hyd4mlma8lv4afd0ypj-glibc-2.21-static/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
diff --git a/pkgs/tools/security/chntpw/default.nix b/pkgs/tools/security/chntpw/default.nix
index 814fb0e..ebeb58f 100644
--- a/pkgs/tools/security/chntpw/default.nix
+++ b/pkgs/tools/security/chntpw/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1k1cxsj0221dpsqi5yibq2hr7n8xywnicl8yyaicn91y8h2hkqln";
   };

-  buildInputs = [ unzip ];
+  buildInputs = [ unzip stdenv.cc.libc.static ];

   patches = [
     ./00-chntpw-build-arch-autodetect.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: closure size The final size of a derivation, including its dependencies
Projects
None yet
Development

No branches or pull requests

2 participants