compiling gcc-4.0.2 on solaris 9
(NOTE: I originally posted this to gcc-help, but only got one response that the sender said they had posted a similar posting a while back and got no responses. So, I am reposting the below to gcc in hopes that this might be a better place to post this question.) I am on: SunOS hostname 5.9 Generic_118558-14 sun4u sparc SUNW,Sun-Blade-1500. I try to do a bootstrap with the following using gnu make 3.80: mkdir objectdir;cd objectdir CC="cc -xildoff -xarch=v9" export CC ../gcc-4.0.2/configure gmake bootstrap I get the following errors: stage1/xgcc -Bstage1/ -B/usr/local/sparc-sun-solaris2.9/bin/ -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -DHAVE_CONFIG_H -DGENERATOR_FILE -o build/genmodes \ build/genmodes.o build/errors.o ../build-sparc-sun-solaris2.9/libiberty/libiberty.a ld: warning: file ../build-sparc-sun-solaris2.9/libiberty/libiberty.a(hashtab.o): wrong ELF class: ELFCLASS64 Undefined first referenced symbol in file htab_create_alloc build/genmodes.o htab_find build/genmodes.o xcalloc build/genmodes.o htab_hash_stringbuild/genmodes.o htab_find_slot build/genmodes.o xmalloc build/genmodes.o xstrdup build/genmodes.o ld: fatal: Symbol referencing errors. No output written to build/genmodes collect2: ld returned 1 exit status make[2]: *** [build/genmodes] Error 1 make[2]: Leaving directory `/export/home/src/net/gnu/odir/gcc' make[1]: *** [stage2_build] Error 2 make[1]: Leaving directory `/export/home/src/net/gnu/odir/gcc' make: *** [bootstrap] Error 2 I am new to the sun environment, so any help would be appreciated. Thanks!
RE: compiling gcc-4.0.2 on solaris 9
Thanks to everyone for the information below. I have change the CC to cc only. So, now the script is: CC=cc export CC ../gcc-4.0.2/configure gmake bootstrap and I get the errors: checking for sparc-sun-solaris2.9-gcc... no checking for gcc... no checking for sparc-sun-solaris2.9-cc... no checking for cc... cc checking for suffix of object files... o checking whether we are using the GNU C compiler... no checking whether cc accepts -g... yes checking for cc option to accept ANSI C... none needed checking how to run the C preprocessor... cc -E checking whether cc understands -c and -o together... yes checking for an ANSI C-conforming const... yes checking for inline... inline checking whether byte ordering is bigendian... cross-compiling... unknown checking to probe for byte ordering... cc: Warning: option -2 passed to ld "conftest.c", line 4: warning: initializer does not fit or is out of range: 35283 "conftest.c", line 4: warning: initializer does not fit or is out of range: 58339 "conftest.c", line 4: warning: initializer does not fit or is out of range: 34195 "conftest.c", line 4: warning: initializer does not fit or is out of range: 38341 "conftest.c", line 4: warning: initializer does not fit or is out of range: 35268 "conftest.c", line 4: warning: initializer does not fit or is out of range: 38273 "conftest.c", line 5: warning: initializer does not fit or is out of range: 49865 "conftest.c", line 5: warning: initializer does not fit or is out of range: 51077 "conftest.c", line 5: warning: initializer does not fit or is out of range: 38340 "conftest.c", line 5: warning: initializer does not fit or is out of range: 35201 "conftest.c", line 5: warning: initializer does not fit or is out of range: 38370 "conftest.c", line 5: warning: initializer does not fit or is out of range: 43234 guessing bigendian ... unknown configure: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian make[1]: *** [configure-target-libiberty] Error 1 make[1]: Leaving directory `/export/home/src/net/gnu/odir' make: *** [bootstrap] Error 2 This is all somewhat after the line of "Comparing stage2 and stage3 of the compiler". Also, the ask why I was using the flags I was. The only reference I found to sparc where the sparcv9-*-solaris2* which sent me to sparc64-*-solaris2* on install/specific. html. Should I have been looking somewhere else? Thanks everyone for the help you have given to one who is not too familiar with compiler work. Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Botcazou Sent: Friday, November 18, 2005 6:06 PM To: Joe Buck Cc: gcc@gcc.gnu.org; Douglas B. Jones Subject: Re: compiling gcc-4.0.2 on solaris 9 > Although the compiler's executable is composed of 32-bit code, it can > generate 32 or 64 bit code, which is what I meant by "both compilers". Ah! Indeed, but you're going to further confuse the readers. :-) I think the best terminology is "32-bit multilib compiler" for sparc-sun-solaris and "64-bit multilib compiler" for sparc64-sun-solaris. -- Eric Botcazou
RE: compiling gcc-4.0.2 on solaris 9
Ok, here is my script (note I am in a directory with only the script below when I execute the script below): CC=cc /export/home/src/net/gnu/gcc-4.0.2/configure gmake bootstrap>make_err 2>&1 I get the exact same errors (at least as far as I see). Also, I had actually looked at the two links below (for Solaris), but they appeared to be more from earlier than Solaris 9 and for the most part for earlier versions of the compiler (3.x series). Once again, I appreciate all the help you all give! Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Botcazou Sent: Monday, November 21, 2005 4:25 PM To: [EMAIL PROTECTED] Cc: gcc@gcc.gnu.org Subject: Re: compiling gcc-4.0.2 on solaris 9 > CC to cc only. So, now the script is: > > CC=cc > export CC > ../gcc-4.0.2/configure > gmake bootstrap Do not export CC and do not use a relative path: CC=cc $absolute_path/configure ... > Also, the ask why I was using the flags I was. The only reference I found > to sparc where the sparcv9-*-solaris2* which sent me to sparc64-*-solaris2* > on install/specific. html. Should I have been looking somewhere else? http://gcc.gnu.org/install/specific.html#sparc-sun-solaris2 http://gcc.gnu.org/install/specific.html#sparc-sun-solaris27 -- Eric Botcazou
RE: compiling gcc-4.0.2 on solaris 9
I put: printenv CC echo $CC which cc in the script and only got output for the which cmd as /opt/SUNWspro/bin/cc. I even reran the script with CC not set, just to make sure. Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Botcazou Sent: Tuesday, November 22, 2005 12:42 PM To: [EMAIL PROTECTED] Cc: gcc@gcc.gnu.org Subject: Re: compiling gcc-4.0.2 on solaris 9 > Ok, here is my script (note I am in a directory with only the > script below when I execute the script below): > > CC=cc /export/home/src/net/gnu/gcc-4.0.2/configure > gmake bootstrap>make_err 2>&1 > > I get the exact same errors (at least as far as I see). The target libiberty is not supposed to be built with the bootstrap compiler. Please verify that CC is not set in your environment. -- Eric Botcazou
RE: compiling gcc-4.0.2 on solaris 9
configure shell: /bin/sh gnu make: GNU Make 3.80 Although I had #!/bin/sh at the beginning, it was taking my SHELL as tcsh. I have stuck in (via notes) SHELL=/bin/ksh;export SHELL and I am rebuilding it right now. Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Botcazou Sent: Tuesday, November 22, 2005 1:25 PM To: [EMAIL PROTECTED] Cc: gcc@gcc.gnu.org Subject: Re: compiling gcc-4.0.2 on solaris 9 > I put: > > printenv CC > echo $CC > which cc > > in the script and only got output for the which cmd as > /opt/SUNWspro/bin/cc. I even reran the script with CC not set, just to make > sure. Thanks! Hum... let's try the basic checks then: - what is your configure shell? - what is your version of GNU make? -- Eric Botcazou
RE: compiling gcc-4.0.2 on solaris 9
Ok, just recompiled with the shell as /bin/ksh and CC not defined and got the same errors as last time? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Douglas B. Jones Sent: Tuesday, November 22, 2005 1:36 PM To: gcc@gcc.gnu.org Subject: RE: compiling gcc-4.0.2 on solaris 9 configure shell: /bin/sh gnu make: GNU Make 3.80 Although I had #!/bin/sh at the beginning, it was taking my SHELL as tcsh. I have stuck in (via notes) SHELL=/bin/ksh;export SHELL and I am rebuilding it right now. Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Botcazou Sent: Tuesday, November 22, 2005 1:25 PM To: [EMAIL PROTECTED] Cc: gcc@gcc.gnu.org Subject: Re: compiling gcc-4.0.2 on solaris 9 > I put: > > printenv CC > echo $CC > which cc > > in the script and only got output for the which cmd as > /opt/SUNWspro/bin/cc. I even reran the script with CC not set, just to make > sure. Thanks! Hum... let's try the basic checks then: - what is your configure shell? - what is your version of GNU make? -- Eric Botcazou
RE: compiling gcc-4.0.2 on solaris 9
It is 4325 lines, should I just email it to you instead of the whole group? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Botcazou Sent: Tuesday, November 22, 2005 3:00 PM To: [EMAIL PROTECTED] Cc: gcc@gcc.gnu.org Subject: Re: compiling gcc-4.0.2 on solaris 9 > Although I had #!/bin/sh at the beginning, it was taking my > SHELL as tcsh. I have stuck in (via notes) SHELL=/bin/ksh;export SHELL > and I am rebuilding it right now. Thanks! Could you post the config.log file of the target libiberty? -- Eric Botcazou
RE: compiling gcc-4.0.2 on solaris 9
On its' way. Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Botcazou Sent: Tuesday, November 22, 2005 3:22 PM To: [EMAIL PROTECTED] Cc: gcc@gcc.gnu.org Subject: Re: compiling gcc-4.0.2 on solaris 9 > It is 4325 lines, should I just email it to you instead > of the whole group? Yes, compressed. -- Eric Botcazou