------- Additional Comments From joseph at codesourcery dot com 2005-05-13 13:17 ------- Subject: Re: New: gcc 4.0.0 assumes all i386-pc-solaris2.10 platforms have 64-bit processors
On Fri, 13 May 2005, Daniel dot Davies at xerox dot com wrote: > I've been trying to build GCC 4.0.0 on an ordinary Intel PC running Solaris > 2.10. The base compiler is gcc3.4.2 from Sun's Companion CD. I'm using > binutils-2.16 and fetched bison 2.0 (though that probably wasn't necessary). You haven't given a proper bug report explaining what you did, i.e. the specific commands used; instead you've just given your guesses as to the problems being in GCC whereas some appear to be in your configuration. Try using the configuration recommended at http://gcc.gnu.org/install/specific.html (notes added after the 4.0.0 release), i.e. configure --with-gnu-as --with-as=/usr/sfw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld. Building with GNU ld may or may not work and building with Sun ld but more recent GNU as than that included with the system runs into problems because of inadequate COMDAT support in the linker. > GCC 4.0.0 assumes all i386-pc-solaris2.10 boxes have 64-bit processors. The > problems occur when you try to build libcpp. First, you get problems because > the new xgcc generates 64-bit opcodes which the assembler can't assemble and > a You should be using an assembler capable of assembling both 32-bit and 64-bit code. Try /usr/sfw/bin/gas. The new xgcc should be defaulting to 32-bit. I don't think the new xgcc should be building libcpp at all until toplevel bootstrap is on by default. It is a design feature of this port that the compiler can run on a 32-bit-only box and build 64-bit binaries with -m64. It may not be strictly required that the compiler will *build* on such boxes and still be able to build both 32-bit and 64-bit binaries, but in general trying to execute code as part of multilib configuration tests may be a bug; if you run into 64-bit runtime library configure tests trying to execute 64-bit binaries, give a more specific report of that problem. > This problem arises because uname won't tell you whether the current platform > has a 32-bit or 64-bit processor. isalist can (sort of) in that it lists > "amd64" as one of the instruction sets supported when running on 64-bit > platforms. The modifications shown below should probably look for instruction > sets other than "amd64". I have not tested the fix described below on a real > 64-bit platform because I don't have one. I found out about "amd64" by > asking a > friend what happened when he typed "isalist" on his 64-bit Solaris box. The configuration should not depend on commands like isalist. Remember that it is a design feature of GCC that almost all configurations can be built as cross-compilers. The target i386-pc-solaris2.10 should mean the same thing everywhere regardless of features of your host; if doing a native build on a 32-bit-only system, the only restriction should be the configuration of the -m64 multilibs can't execute 64-bit code. You can of course configure with --disable-multilib if you don't want the facility to build 64-bit binaries at all. HOST_WIDE_INT being 64 bits should cause no problems for a 32-bit-only compiler, other than being slightly less efficient. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21542