Trying to cross-build a native gcc into a ROOT for ARM (I tried armv6j-hardfloat-linux-gnueabi and armv7a-hardfloat-linux-gnueabi) on x86_64-pc-linux-gnu results in the following error... ../../gcc/real.h: error: size of array `test_real_width' is negative This is not a new problem and I have found several people reporting the problem over the past 10 years. Back then, the problem was actually reversed as people were trying to build for SPARC64 on x86. The URL above is a more recent example like mine. In the SPARC64 case, it was suggested to use a 64-bit compiler. In the ARM case, it was suggested to use -m32. I think gcc should be able to deal with this properly but these suggestions are certainly easier. I was able to build for both the ARM targets by simply setting CFLAGS_FOR_BUILD="-m32". It would be nice if toolchain.eclass did this automatically but I can't think of a good general way to achieve it. Any ideas?
It's probably worth mentioning that I just hit the equivalent problem with Python 3... LONG_BIT definition appears wrong for platform (bad gcc/glibc config?) And I was able to workaround it in the same manner, applying -m32 to CFLAGS and LDFLAGS in the "cross-configure" step. A proper solution would be very helpful.
Aha, just found a much better fix in Python's case. I'll file a separate bug report for that.
1) Please post your `emerge --info' output in a comment. 2) Please attach the entire build log to this bug report.
Never mind. I decided to make doubly sure that it wasn't my own cross-building scripts causing the problem and it turns out it was. I try not to do anything too outlandish but it turns out merely setting CONFIG_SITE to some value breaks it, even if you set it to /usr/share/config.site, which is what it uses by default. Very odd. Please close this as invalid. Sorry for the noise.