chapter 5: zlib and LDFLAGS="-s"

Gerard Beekmans gerard at linuxfromscratch.org
Mon May 5 13:05:33 PDT 2003


Heya,

1) For starters, why is zlib needed in chapter 5.

2) make LDFLAGS="-s" causes a compile error here. When compiling the example 
program, the necessary -lz options aren't passed. They are part of the 
LDFLAGS var and it gets overridden with the -s value.

With LDFLAGS set:

gcc -O2 -pipe -DHAVE_UNISTD_H -DUSE_MMAP -o example example.o -s
example.o: In function `test_compress':
example.o(.text+0x32): undefined reference to `compress'

Without it set:

gcc -O2 -pipe -DHAVE_UNISTD_H -DUSE_MMAP -o example example.o -L. -lz


-- 
Gerard Beekmans
http://linuxfromscratch.org

/* Linux Consultant --- OSDN / DevChannel *
 * Technical Writer --- CheapBytes        */

/* If Linux doesn't have the solution, you have the wrong problem */

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list