Skip to content

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

Closed

Description

@deepfire

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?

Activity

  1. added
    6.topic: closure size
    on Dec 5, 2015
  2. vcunat commented on Dec 5, 2015

    @vcunat
    Member

    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
  3. added a commit that references this issue on Jan 20, 2016
    d130116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.topic: closure size

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions