./config fails for CodeSourcery arm-none-eabi-* toolchain

Franz TRIERWEILER franz.trierweiler.ingenieur at gmail.com
Thu Jan 20 11:19:12 CET 2011


Hi,

First, thanks to welcome me on this mailing list. It is the first time I
have posted.

I am trying to configure and make gmplib for a STM32 (ARM Cortex M3 target).
For this purpose, I use a bare metal toolchain from CodeSourcery.

All my cross gcc tools are like this:

arm-none-eabi-addr2line  arm-none-eabi-gprof
arm-none-eabi-ar         arm-none-eabi-ld
arm-none-eabi-as         arm-none-eabi-nm
arm-none-eabi-c++        arm-none-eabi-objcopy
arm-none-eabi-c++filt    arm-none-eabi-objdump
arm-none-eabi-cpp        arm-none-eabi-ranlib
arm-none-eabi-elfedit    arm-none-eabi-readelf
arm-none-eabi-g++        arm-none-eabi-run
arm-none-eabi-gcc        arm-none-eabi-size
arm-none-eabi-gcc-4.5.1  arm-none-eabi-sprite
arm-none-eabi-gcov       arm-none-eabi-strings
arm-none-eabi-gdb        arm-none-eabi-strip
arm-none-eabi-gdbtui

I am working on a Ubuntu 10.10 workstation.

I have searched in gmp-man-5.0.1.pdf for the configuration options and
looked into the discussion list for potential tips regarding cross
compiling.

Here is my configure command line:

./configure --host=arm-none-eabi
CC=/home/imaclinux/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc
CPP="/home/imaclinux/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc"
LD=/home/imaclinux/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-ld
AR=/home/imaclinux/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-ar
RANLIB=/home/imaclinux/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-ranlib

I have forced the CC, CPP, etcc options because when I only
set --host=arm-none-eabi then the compiler is not properly set and the
native gcc is used and it fails when trying to assemble ARM assembler code.

This configure command fails like this:

configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... arm-none-eabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for arm-none-eabi-strip... arm-none-eabi-strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=standard
checking whether
/home/imaclinux/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc is
gcc... yes
checking compiler
/home/imaclinux/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc -O2
-pedantic -fomit-frame-pointer ... no, mpn_lshift_com optimization 2
configure: error: could not find a working compiler, see config.log for
details


If I look into details in the config.log, I can see an error during a try
made by the configure tool:

configure:5289: $? = 1
failed program was:
/* The following is mis-compiled by Intel ia-64 icc version 1.8 under
    "icc -O3",  After several calls, the function writes parial garbage to
    the result vector.  Perhaps relates to the chk.a.nc insn.  This code
needs
    to be run to show the problem, but that's fine, the offending cc is a
    native-only compiler so we don't have to worry about cross compiling.
 */

#if ! defined (__cplusplus)
#include <stdlib.h>
void
lshift_com (rp, up, n, cnt)
  unsigned long *rp;
  unsigned long *up;
  long n;
  unsigned cnt;
{
  unsigned long high_limb, low_limb;
  unsigned tnc;
  long i;
  up += n;
  rp += n;
  tnc = 8 * sizeof (unsigned long) - cnt;
  low_limb = *--up;
  high_limb = low_limb << cnt;
  for (i = n - 1; i != 0; i--)
    {
      low_limb = *--up;
      *--rp = ~(high_limb | (low_limb >> tnc));
      high_limb = low_limb << cnt;
    }
  *--rp = ~high_limb;
}
int
main ()
{
  unsigned long *r, *r2;
  unsigned long a[88 + 1];
  long i;
  for (i = 0; i < 88 + 1; i++)
    a[i] = ~0L;
  r = malloc (10000 * sizeof (unsigned long));
  r2 = r;
  for (i = 0; i < 528; i += 22)
    {
      lshift_com (r2, a,
  i / (8 * sizeof (unsigned long)) + 1,
  i % (8 * sizeof (unsigned long)));
      r2 += 88 + 1;
    }
  if (r[2048] != 0 || r[2049] != 0 || r[2050] != 0 || r[2051] != 0 ||
      r[2052] != 0 || r[2053] != 0 || r[2054] != 0)
    abort ();
  return 0;
}
#else
int
main ()
{
  return 0;
}
#endif

configure:5443: result: no, mpn_lshift_com optimization 2
configure:5681: error: could not find a working compiler, see config.log for
details


I must admit I do not really know what is wrong - I just suppose that the
compiler is not able to perform something required and relating
to mpn_lshift_com optimization.

Before going into details, I would like to know if someone already tried to
configure and make gmplib with this toolchain and if this error is common to
other cross toolchains.

Regards,
Franz


More information about the gmp-discuss mailing list