I'm trying to patch Perl in order to address CVE-2016-2381 [0]. It would be nice to use a graft for this since a change to Perl will cause ~2700 rebuilds. I started from the current tip of the master branch (eb8065cd2). Building Perl gave me x2p2biyybcb2wac77qz9468asc5fm48i-perl-5.22.1. Then, I applied the attached patch and rebuilt, yielding jwdnhrv84spf400yfqqvsq2vsrpww7nk-perl-5.22.1. Next, I built perl-carp-clan, just to see if something would build with Perl. Okay. Next, I tried to build apr. Since Perl is a run-time dependency, I thought it would be easy to confirm that the graft was being applied. OpenSSL is not in the dependency graph. But, it tries to rebuild Perl (I had already built the grafted version) and fails as in the attached build log. Here is the tail of the log, although I think there are signs that something is wrong much earlier: --- Checking your choice of C compiler and flags for coherency... I've tried to compile and run the following simple program: #include int main() { printf("Ok\n"); return(0); } I used the command: gcc -o try -O2 -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/gnu/store/hkwl20n5ca87bczjrlv8b8vfm26vcrxy-glibc-bootstrap-0/include -fstack-protector -L/gnu/store/hkwl20n5ca87bczjrlv8b8vfm26vcrxy-glibc-bootstrap-0/lib try.c -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ./try and I got the following output: /gnu/store/5d1ax083qv01jsi07ldm29dspbxcb1lb-binutils-bootstrap-0/bin/ld: cannot find /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.18/lib/libpthread.so.0 /gnu/store/5d1ax083qv01jsi07ldm29dspbxcb1lb-binutils-bootstrap-0/bin/ld: cannot find /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.18/lib/libpthread_nonshared.a collect2: error: ld returned 1 exit status I can't compile the test program. (The supplied flags or libraries might be incorrect.) You have a BIG problem. Shall I abort Configure [y] Ok. Stopping Configure. phase `configure' failed after 0.7 seconds builder for `/gnu/store/izhqpd3hj0g2qsvdvbll2p1nkpgvymbb-perl-5.22.1.drv' failed with exit code 1 @ build-failed /gnu/store/izhqpd3hj0g2qsvdvbll2p1nkpgvymbb-perl-5.22.1.drv - 1 builder for `/gnu/store/izhqpd3hj0g2qsvdvbll2p1nkpgvymbb-perl-5.22.1.drv' failed with exit code 1 cannot build derivation `/gnu/store/r5fx0sdw93rq87pdv0yfi0wfc5y6xc5v-apr-1.5.2.drv': 1 dependencies couldn't be built guix build: error: build failed: build of `/gnu/store/r5fx0sdw93rq87pdv0yfi0wfc5y6xc5v-apr-1.5.2.drv' failed --- [0] https://www.debian.org/security/2016/dsa-3501