GMP 6.0.0a on AMD A8-6600K

Kevin Buckley kevin.m.buckley at gmail.com
Wed Apr 8 10:55:23 UTC 2015


This may turn out to be more of an "any clues" than a bug report
although GMP 6.0.0a did fail to build THREE TIMES for my set of
circumstances, so here goes.

Started out loooking at building a Linux From Scratch (LFS) system
using their most recent stable (ver 7.7) instructions.

http://www.linuxfromscratch.org/lfs/view/stable/


To quickly summarise, LFS is a two stage build where an initial
environment is created with enough "tools" to perfom a system
build isolated from the host, which is then chroot-ed into so
as to perform the "system" build.


I am using an Ubuntu 12.04 dom0, running a CentOS 6.6 Xen domU
as the host OS for the LFS build, with the CPU underlying
everything being an AMD A8-6600K.


The LFS "tools" build comprises these main parts

Linux-3.19 API Headers
Glibc-2.21
Binutils-2.25
GMP-6.0.0a
MPFR-3.1.2
MPC-1.0.2
GCC-4.9.2

however  in the "tools" phase, the three "GCC supporting" packages;
GMP, MPFR and MPC, are  all unpacked and built inside of the GCC
build, resulting in a compiled GCC that reports as:


# gcc -v
Reading specs from /tools/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/tools/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.9.2/configure --prefix=/tools \
 --with-local-prefix=/tools --with-native-system-header-dir=/tools/include \
 --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib \
 --disable-bootstrap --disable-libgomp
Thread model: posix
gcc version 4.9.2 (GCC)


When building GMP inside the LFS chroot, the configure ends with

  Version:           GNU MP 6.0.0
  Host type:         piledriver-unknown-linux-gnu
  ABI:               64
  Install prefix:    /usr
  Compiler:          gcc -std=gnu99
  Static libraries:  yes
  Shared libraries:  yes

and the compilation of the first test that fails

/usr/src/gmp/gmp-6.0.0/tests/mpn/t-get_d

shows as:

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../tests     \
 -O2 -pedantic -fomit-frame-pointer -m64 -mtune=bdver2 -march=bdver2 \
 -c t-get_d.c


Trying to build the GMP source within the CentOS 6 LFS host (so outside
the LFS chroot environment) shows

# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man \
 --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla \
 --enable-bootstrap --enable-shared --enable-threads=posix \
 --enable-checking=release --with-system-zlib --enable-__cxa_atexit \
 --disable-libunwind-exceptions --enable-gnu-unique-object \
 --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk \
 --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre \
 --enable-libgcj-multifile --enable-java-maintainer-mode \
 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib \
 --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 \
 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)

Configure (different --prefix to avoid trashing the host) ends with

  Version:           GNU MP 6.0.0
  Host type:         piledriver-unknown-linux-gnu
  ABI:               64
  Install prefix:    /usr/local
  Compiler:          gcc -std=gnu99
  Static libraries:  yes
  Shared libraries:  yes

and the first test to fail (as above) gets built as

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../tests     \
 -O2 -pedantic -fomit-frame-pointer -m64 -mtune=bdver2 -march=bdver2 \
 -c t-get_d.c

so using the same flags as the LFS-built compiler


Interestingly, for me anyway, is the attempt to build on the Xen VM
host, the Ubuntu 12.04 environment

Here we see

# gcc -v                                        Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v \
 --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' \
 --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs \
 --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr \
 --program-suffix=-4.6 --enable-shared --enable-linker-build-id \
 --with-system-zlib --libexecdir=/usr/lib --without-included-gettext \
 --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 \
 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu \
 --enable-libstdcxx-debug --enable-libstdcxx-time=yes \
 --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror \
 --with-arch-32=i686 --with-tune=generic --enable-checking=release \
 --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

Configure (different --prefix to avoid trashing the host) ends with

  Version:           GNU MP 6.0.0
  Host type:         piledriver-unknown-linux-gnu
  ABI:               64
  Install prefix:    /usr/local
  Compiler:          gcc -std=gnu99
  Static libraries:  yes
  Shared libraries:  yes

however, the first test to fail (as above) gets built as

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../tests     \
 -O2 -pedantic -fomit-frame-pointer -m64 -mtune=bdver1 -march=bdver1 \
 -c t-get_d.c



Note that the Ubuntu 12.04 box, the "bare metal host" uses these flags

-mtune=bdver1 -march=bdver1

whereas the CentOS 6.6 VM is using

-mtune=bdver2 -march=bdver2


The whole thing has sure got me beat but that last bit seems weirder
still!

All I know is, I can't seem to run successful tests of GMP 6.0.0a in
three different environments, albeit with two of them "nested "

Is it a bug?

If it isn't, what have I missed?


Happy to send on any, or all, of the three sets of configure, make and
gmp-check-log, assuming I'm not missing something really simple, which
is why I haven't attached anything in this initial flaging up of the issue,
because I find it hard to believe I haven't missed something obvious.

Kevin Buckley


More information about the gmp-bugs mailing list