Hi, I'm using OpenBSD 4.0 i386 and I'm having some difficulties with
crunchgen. Your assistance would be appreciated.
-I've used basically the same conf file and method on a FreeBSD
system (so I must be doing something right).
-I've reduced the conf to include 1 binary - the simpler the better.
Under /usr/local/src (which is empty apart from the conf). Here's a
transcript of what I'm trying to do.
# cat cat.conf
srcdirs /usr/src/bin
progs cat
libs -lc
#crunchgen cat.conf
Run "make -f cat.mk objs exe" to build crunched binary.
# make -f cat.mk objs
cd /usr/src/bin/cat && exec make -f Makefile cat.o
cc -O2 -pipe -c cat.c
# make -f cat.mk exe
cc -O2 -pipe -c cat.c
echo "int _crunched_cat_stub(int argc, char **argv, char **envp)
{return main(argc,argv,envp);}" >cat_stub.c
cc -O2 -pipe -c cat_stub.c
ld -dc -r -o cat.lo cat_stub.o /usr/src/bin/cat/cat.o
crunchide -k __crunched_cat_stub cat.lo
cc -static -o cat cat.o cat.lo -L/usr/lib -lc
cat.o(.data+0x4): undefined reference to `_crunched_cat_stub'
collect2: ld returned 1 exit status
*** Error code 1
Stop in /usr/local/src (line 10 of cat.mk).