DT_TEXTREL and zlib

Robert Connolly robert at linuxfromscratch.org
Mon Nov 2 14:39:46 PST 2009

On Monday November 2 2009 04:59:20 pm deant at hawaii.rr.com wrote:
> On Mon Nov 2 10:35:59 MST 2009 Robert Connolly wrote:
> > Are you using CFLAGS? This shouldn't happen because GCC should be using
> > -fPIC. For a workaround, add -fPIC to zlib's Makefile. And pay attention
> > to see if this happens with other packages.
> No, I wasn't using a CFLAGS environment variable.
> I was working under the assumption that the first sed in
> gcc_pass1.txt made -fPIC the default behavior, although I
> now notice that that change is absent from the pass2
> compiler, which is actually the one used to build zlib
> Am I supposed to start the pass2 compiler build "on
> top of" the pass1 compiler sources?  (Ie with the fPIC
> and VERSUFFIX changes?)

No. Separate clean sources. GCC pass2 has an fPIE patch, which also uses -fPIC 
when building libraries. That patch also 
adds --warn-shared-textrel --fatal-warnings, which is causing your error.

Zlib's Makefile uses -fPIC, unless you have set CFLAGS. So it doesn't make 
sense that you would get textrel. Can you show the log of the Zlib build 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/hlfs-dev/attachments/20091102/2abae46f/attachment.sig>

More information about the hlfs-dev mailing list