pie specs patch

Robert Connolly robert at linuxfromscratch.org
Wed Nov 21 20:27:59 PST 2007


On Wednesday November 21 2007 08:51:16 pm Heiko Zuerker wrote:
> Hey,
>
> The section of the gcc-4.1.2-fpie-1.patch I copied at the end of the
> email, seems to cause problems with some packages (beyond the standard
> HLFS build).
> The most recent one I had trouble with is open-vm-tools (
> http://sourceforge.net/project/showfiles.php?group_id=204462&package_id=244
>023&release_id=555776 ).
> Unfortunately right now I don't recall the other packages which had the
> same problem.
>
> This is the error:
> checkvm.c: In function `getVersion':
> checkvm.c:80: error: can't find a register in class `BREG' while reloading
> `asm'
> make[1]: *** [checkvm.o] Error 1

The 'BREG' is from non-pic assembly code. Often these packages have patches, 
or there's a ./configure option to disable some of the assembly (mmx is the 
most common problem). If I remember correctly, the nasm assembler also causes 
the 'BREG'.

> You'll have to compile it with
> ./configure --prefix=/usr --without-x
> make CC="gcc -U_FORTIFY_SOURCE" LDFLAGS=-liconv

I don't know why you would need the -U_FORTIFY_SOURCE here.

> What does this part of the patch do?
>
> --
>
> Regards
>   Heiko Zuerker
>   http://www.devil-linux.org
>
> --- gcc-4.1.2.orig/gcc/common.opt	2006-05-17 18:38:58.000000000 +0000
> +++ gcc-4.1.2/gcc/common.opt	2007-06-10 12:52:38.000000000 +0000
> @@ -639,7 +639,7 @@
>  Generate position-independent code if possible (large mode)
>
>  fPIE
> -Common Report Var(flag_pie,2)
> +Common Report Var(flag_pie,2) Init(2)
>  Generate position-independent code for executables if possible (large
> mode)
>
>  fpic

This enables default -fPIE. The gcc specs replace it with -fPIC for libraries. 
This is what is causing your error. You can disable it with -fno-PIE.

robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/hlfs-dev/attachments/20071121/90a4701e/attachment.sig>


More information about the hlfs-dev mailing list