[lfs-support] Please consider adding --with-gcc-arch=native in libffi configure

Bruce Dubbs bruce.dubbs at gmail.com
Tue Jul 3 13:19:22 PDT 2018


On 07/03/2018 02:51 PM, Don Cross wrote:
> 
> 
> On Tue, Jul 3, 2018 at 12:40 PM Bruce Dubbs <bruce.dubbs at gmail.com 
> <mailto:bruce.dubbs at gmail.com>> wrote:
> 
>     On 06/29/2018 07:32 PM, Don Cross wrote:
>      > I wasn't sure whether to send this to lfs-support or lfs-dev.
>     Since I'm
>      > not a developer on LFS, I guessed the former. Apologies if my
>     guess is
>      > unhelpful.
>      >
>      > I built LFS using jhalfs and the 8.2 version of the book on a
>     machine
>      > with an Intel G860 processor. The configure script for libffi
>     guessed
>      > wrong about the processor's capabilities, causing Python 3 to
>     crash with
>      > an invalid instruction exception.
>      >
>      > I fixed this by changing the jhalfs script 115_libffi to let gcc
>      > determine the architecture rather than the configure script itself:
>      >
>      > ./configure --prefix=/usr --disable-static --with-gcc-arch=native
> 
>     In the libffi source directory, can you pelease tell us what the output
>     of ./config.guess
> 
>     In my case it is x86_64-unknown-linux-gnu.
> 
>         -- Bruce
> 
> 
> Hi Bruce, I see the same thing:
> 
> don at neptune:/sources/libffi-3.2.1 $ ./config.guess
> x86_64-unknown-linux-gnu
> 
> However, I believe the smoking gun is in the output of ./configure when 
> I leave out the --with-gcc-arch=native.  If I diff the output of 
> ./configure without that native option (bad.txt) against the output with 
> that option (good.txt) I get:
> 
> don at neptune:/sources/libffi-3.2.1 $ ./configure --prefix=/usr 
> --disable-static > bad.txt
> don at neptune:/sources/libffi-3.2.1 $ ./configure --prefix=/usr 
> --disable-static --with-gcc-arch=native > good.txt
> don at neptune:/sources/libffi-3.2.1 $ diff bad.txt good.txt
> 106,110c106,108
> < checking for x86 cpuid 0 output... d:756e6547:6c65746e:49656e69
> < checking for x86 cpuid 1 output... 206a7:2100800:d9ae3bf:bfebfbff
> < checking whether C compiler accepts -march=corei7-avx... yes
> < checking for gcc architecture flag... -march=corei7-avx
> < checking whether C compiler accepts -O3 -fomit-frame-pointer 
> -fstrict-aliasing -ffast-math -march=corei7-avx... yes
> ---
>  > checking whether C compiler accepts -march=native... yes
>  > checking for gcc architecture flag... -march=native
>  > checking whether C compiler accepts -O3 -fomit-frame-pointer 
> -fstrict-aliasing -ffast-math -march=native... yes
> 
> I'm not sure how ./configure comes up with corei7-avx, but the Intel 
> G860 does not support Advanced Vector eXtension instructions.
> 
> I think --with-gcc-arch=native is going to give the vast number of LFS 
> builders the correct output. If they are cross-compiling, they are going 
> to have to go through the pain of figuring out the target architecture 
> settings anyway, so they will be no worse off.

Thanks, that helps.   I'll continue my investigation.  there is a lot 
going on in LFS right now so I will be making multiple updates in the 
next few days.

   -- Bruce



More information about the lfs-support mailing list