[Clfs-support] problem report for 3.0.0 beta 1 PowerPC SysVInit instructions

Dave Gomboc dave_gomboc at acm.org
Wed Sep 10 12:39:01 PDT 2014


Going back through my scripting of the CLFS instructions to date, I
did find a couple of earlier problems, but they did not resolve this
issue (though they would have caused later failures).

Invoking "readelf -h /cross-tools/lib/libgmp.so.10.2.0" yields

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           Intel 80386
  Version:                           0x1
  Entry point address:               0xa060
  Start of program headers:          52 (bytes into file)
  Start of section headers:          462736 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         6
  Size of section headers:           40 (bytes)
  Number of section headers:         30
  Section header string table index: 27

On the other hand, examining with "readelf -h
/usr/lib/x86_64-linux-gnu/libgmp.so.10.0.5" (the gmp that is built
into the system that we do not actually want to find and use) instead
yields

ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x96c0
  Start of program headers:          64 (bytes into file)
  Start of section headers:          454520 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         6
  Size of section headers:           64 (bytes)
  Number of section headers:         27
  Section header string table index: 26

>From the config.log, I captured the configuration test program that
caused failure and saved it as conftest.c:

/* confdefs.h */
#define PACKAGE_NAME "isl"
#define PACKAGE_TARNAME "isl"
#define PACKAGE_VERSION "0.12.2"
#define PACKAGE_STRING "isl 0.12.2"
#define PACKAGE_BUGREPORT "isl-development at googlegroups.com"
#define PACKAGE_URL ""
#define PACKAGE "isl"
#define VERSION "0.12.2"
#define GCC_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
#define HAVE___ATTRIBUTE__ 1
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
/* end confdefs.h.  */


int
main ()
{
return main ();
  ;
  return 0;
}


Now, compiling the above program using the command found in the
configure yields the error as expected:

$ gcc -o conftest -O3 -fomit-frame-pointer -malign-double
-fstrict-aliasing -ffast-math -I/cross-tools/include
-L/cross-tools/lib -Wl,-rpath,/cross-tools/lib conftest.c -lgmp  -lgmp
/usr/bin/ld: skipping incompatible /cross-tools/lib/libgmp.so when
searching for -lgmp
/usr/bin/ld: cannot find -lgmp
/usr/bin/ld: skipping incompatible /cross-tools/lib/libgmp.so when
searching for -lgmp
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status

However, if I explicitly add in an "-m32" switch as so:

$ gcc -o conftest -O3 -fomit-frame-pointer -malign-double
-fstrict-aliasing -ffast-math -I/cross-tools/include
-L/cross-tools/lib -Wl,-rpath,/cross-tools/lib conftest.c -lgmp  -lgmp

then /cross-tools/lib/libgmp.so is no longer considered to be
incompatbile, so the link succeeds, and a conftest executable is
produced.

My guess is that the installation of libgmp under /cross-tools/lib is
fine, and further, that the test failed without using -m32 confirms
that the system gmp was not found.

I know you mentioned that you have built the cross-tools many times.
Did any of those times (recently) happen to use 64-bit Debian Wheezy
(7.6) as the host operating system?  Perhaps I have improperly
configured this system versus what CLFS expects?  The existing install
is the minimal one (no X desktop, for instance) that the OS allows +
openssh + this additional configuration:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install bash bash-completion libbash --assume-yes
sudo apt-get install binutils binutils-dev binutils-multiarch --assume-yes
sudo apt-get install bison libbison-dev:amd64 libbison-dev:i386 --assume-yes
sudo apt-get install bzip2 coreutils diffutils findutils gawk --assume-yes
sudo apt-get install gcc g++ gcc-multilib g++-multilib lib32gcc1
libgcc1:amd64 libgcc1:i386 --assume-yes
sudo apt-get install libc6:amd64 libc6:i386 --assume-yes
sudo apt-get install grep gzip make --assume-yes
sudo apt-get install ncurses-base ncurses-bin libncurses5:amd64
libncurses5:i386 libncurses5-dev libncursesw5:amd64 libncursesw5:i386
libncursesw5-dev lib32ncurses5 lib32ncurses5-dev lib32ncursesw5
lib32ncursesw5-dev --assume-yes
sudo apt-get install patch sed tar texinfo xz-utils --assume-yes

As an attempted workaround, I am going to try out a 32-bit Debian
Wheezy to avoid any 32-bit/64-bit host compilation issues that might
be present.

Dave Gomboc


On 9 September 2014 19:06, William Harrington <kb0iic at berzerkula.org> wrote:
[snipped original email]
>
> The problem is no compatible gmp library was found.
>
> The output of my configure for the cross-tools is:
> checking which gmp to use... system
> checking gmp.h usability... yes
> checking gmp.h presence... yes
> checking for gmp.h... yes
> checking for main in -lgmp… yes
>
>
> At this point it doesn’t matter which target the build is, as this is building cross-tools for the host to run with the build toolchain for the target.
>
> Somehow, GMP has not been installed properly. Check the commands and make sure steps to build the cross-tools are being done properly. I’ve built the cross-tools plenty of times without encountering this type of issue.
>
> Sincerely,
>
> William Harrington



More information about the Clfs-support mailing list