[linux-sh:03277] Re: gcc-3.4.1

R Vijay <[email protected]> Tue, 6 Jul 2004 07:55:57 -0700 (PDT)
Newsgroups gmane.linux.ports.sh.general,gmane.linux.ports.sh.devel
Message-ID <[email protected]>
Hi,
 
Thanks a lot for the check up steps!  I downloaded gcc-3.4.0 today and tried to compile gcc with following steps
 
$./configure --target=sh --host=i386 --program-prefix=/opt/sh-linux- 
$make
 
After that i m getting error as below
 
as: .....unrecognized option '--big'
 
I think i m messed up with gcc 3.2.3 ! is there any patch to be  applied for 3.4?
 
Thanks for support!
Best Regards,
Vijay

Kaz Kojima <[email protected]> wrote:
R Vijay wrote:
> At present i m using sh-linux-gcc version 3.2.3 and while compiling 'busybox' statically i encountered following error related to '__udivsi3_i4' and '__sdivsi3_i4' undeclared identifier and i believe that those are related to integer division.

It looks that your gcc's configuration or installation problem.
Those symbols should come from libgcc.a for sh4. So it looks
the possibility is

(a) your libgcc.a is broken

or

(b) your busybox wasn't linked with correct libgcc.a

You could run sh-linux-gcc -v to know where your libgcc.a is in.
For my cross sh4-unknown-linux-gcc returns

$ sh4-unknown-linux-gnu-gcc -v
Reading specs from /usr/local/lib/gcc/sh4-unknown-linux-gnu/3.4.0/specs
Configured with: ../../ORIG/gcc-3.4/configure --host=i686-pc-linux-gnu --target=sh4-unknown-linux-gnu --enable-languages=c,c++,java --enable-shared --enable-threads=no --enable-libjava --enable-__cxa_atexit --with-ld=/usr/local/bin/sh4-unknown-linux-gnu-ld --disable-checking --with-sysroot=/exp/ldroot
Thread model: single
gcc version 3.4.0 20040305 (prerelease)

My libgcc.a is in the same directory which specs file is in, i.e.
/usr/local/lib/gcc/sh4-unknown-linux-gnu/3.4.0/.

$ ls /usr/local/lib/gcc/sh4-unknown-linux-gnu/3.4.0/
crtbegin.o crtbeginT.o crtendS.o install-tools libgcc_eh.a specs
crtbeginS.o crtend.o include libgcc.a libgcov.a

If you use the multi-libed sh-linux-gcc, then the list of such directory
is like as following:

crt1.o crti.o libgcov.a m4-single-only
crtbegin.o crtn.o m2 ml
crtbeginS.o include m2e specs
crtend.o install-tools m4
crtendS.o libgcc.a m4-single

In that case, your correct libgcc.a is ml/m4/libgcc.a. The -m4 option
of the gcc selects it. You could test your libgcc.a with
sh-linux-nm or sumsuch:

$ sh4-unknown-linux-gnu-nm /usr/local/lib/gcc/sh4-unknown-linux-gnu/3.4.0/libgcc.a | grep __udivsi3_i4
00000000 T __udivsi3_i4
U __udivsi3_i4
U __udivsi3_i4
U __udivsi3_i4
U __udivsi3_i4
U __udivsi3_i4

'T' means __udivsi3_i4 is defined in a .text section in libgcc.a.

For (b), you could run the sh-linux-gcc with -v and -Wl,--verbose
option and look the link phase in detail. It'll report you that
what libraries are used when linking the program.
Hope this helps.

BTW, please write to the list rather than private mail. Sharing
information would be nice and important.

Regards,
kaz


		
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.