test_real_width static assertion failure while cross building gcc-4.9 for x32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please Cc me in replies.

As part of the rebootstrap[1] project, I am trying to cross build
gcc-4.9 for x32. This fails with the following message:

| g++ -c -DIN_GCC     -DGENERATOR_FILE -I. -Ibuild -I../../src/gcc -I../../src/gcc/build -I../../src/gcc/../include  -I../../src/gcc/../libcpp/include  \
|         -o build/genpreds.o ../../src/gcc/genpreds.c
| In file included from ../../src/gcc/rtl.h:26:0,
|                  from ../../src/gcc/genpreds.c:27:
| ../../src/gcc/real.h:76:76: error: size of array 'test_real_width' is negative
|    [sizeof (REAL_VALUE_TYPE) <= REAL_WIDTH * sizeof (HOST_WIDE_INT) ? 1 : -1];
|                                                                             ^
| Makefile:2356: recipe for target 'build/genpreds.o' failed

The sources used are Debian gcc-4.9 4.9.2-10 sources, which should
mostly correspond to svn revision r218987 on branch gcc-4_9-branch. In
this build, the build architecture is amd64. The host and target
architectures are set to x32.  An x32 cross compiler is built and
installed from the same sources.

Looking at the gcc/real.h header in question, I am wondering whether the
various architectures are somehow mixed in unfortunate ways. We can see
that the build arch (amd64) compiler is used. The struct real_value
(which lives behind REAL_VALUE_TYPE) has an "unsigned long sig[SIGSZ];"
member. The SIGSZ macro is #defined as (SIGNIFICAND_BITS /
HOST_BITS_PER_LONG). HOST_BITS_PER_LONG becomes 32. Thus I am wondering
whether the code handles the case where build arch sizeof(long) > host
arch sizeof(long) correctly.

Of course, this can be a red herring and some other aspects of my build
may be wrong. I also note that an earlier attempt of cross building
Debian gcc-4.9 4.9.0-1 (which corresponds to svn revision r209695) did
not exhibit this issue. What other aspects should I check with my build
environment?

Thanks for considering

Helmut

[1] http://wiki.debian.org/HelmutGrohne/rebootstrap



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux