Problem with static compilation

Timo Kamph timo at kamph.org
Sun Feb 27 03:15:05 PST 2005


pinotj at club-internet.fr wrote:
> Hi,
>
> I built again HLFS, everything is fine (nls) except the fact I cannot statically compile new software.
>
> Example for aespipe:
>
>  gcc  -nointl -static -o aespipe aespipe.o aes.o md5.o sha512.o rmd160.o
>  /usr/bin/ld: cannot find -lc
>  collect2: ld returned 1 exit status
>  make: *** [aespipe] Error 1
>
> Doesn't depend of -pie or -no-pie.
>
> Is it a spec problem ? Did I forget something ?
>

No, it's the expected behavior. The HLFS team decided to link everything
dynamically. To enforce this (allmost) all static libraries are removed
(or not even build) during the HLFS build. That is why your linker
complains about the missing libc.a.

It's not a bug, it's a feature ;-)


	Timo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxfromscratch.org/pipermail/hlfs-dev/attachments/20050227/45ab3488/attachment.sig>


More information about the hlfs-dev mailing list