public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target
@ 2004-08-09 11:24 nitins2 at kpitcummins dot com
  2004-08-09 15:45 ` [Bug c/16932] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: nitins2 at kpitcummins dot com @ 2004-08-09 11:24 UTC (permalink / raw)
  To: gcc-bugs

Hi,
I am getting following error while compiling the code for sh-coff little endian.

*********************test.c***************************
int main()
{
	printf("\nHello\n");
	return 0;
}
********************************************************************************
****************
Error comes for targets sh2/sh2e/sh3/sh3e.
command line 
>sh-coff-gcc -ml -m2 test.c
>sh-coff-gcc -ml -m2e test.c
>sh-coff-gcc -ml -m3 test.c
>sh-coff-gcc -ml -m3e test.c

*****************error text****************************************
../sh-coff/lib/libc.a(mprec.o)(.text+0x988):mprec.c: undefined reference to 
`__ashiftrt_r4_20'
****************************************************************************
If call to "printf" is removed from test code the error disappears.

I am using toolchain built from snapshots
1)gcc-3.4-20040730
2)newlib-1.12.0 CVS dated 07 July 2004
3)binutils-2.15

Same error is not observed in GCC-3.5-20040801 snapshot.

Kindly suggest how to solve this problem.

Thanks in advance.

Nitin Shah,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools were released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- 
           Summary: Compilation error for sh-coff-gcc little endian target
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nitins2 at kpitcummins dot com
                CC: anilp1 at kpitcummins dot com,gcc-bugs at gcc dot gnu
                    dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh-unknown-coff


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
@ 2004-08-09 15:45 ` pinskia at gcc dot gnu dot org
  2004-08-09 15:46 ` [Bug target/16932] " pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-09 15:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-09 15:45 -------
*** Bug 16933 has been marked as a duplicate of this bug. ***

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
  2004-08-09 15:45 ` [Bug c/16932] " pinskia at gcc dot gnu dot org
@ 2004-08-09 15:46 ` pinskia at gcc dot gnu dot org
  2004-08-09 16:21 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-09 15:46 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
            Summary|Compilation error for sh-   |Compilation error for sh-
                   |coff-gcc little endian      |coff-gcc little endian
                   |target                      |target


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
  2004-08-09 15:45 ` [Bug c/16932] " pinskia at gcc dot gnu dot org
  2004-08-09 15:46 ` [Bug target/16932] " pinskia at gcc dot gnu dot org
@ 2004-08-09 16:21 ` pinskia at gcc dot gnu dot org
  2004-08-13 12:11 ` nitins2 at kpitcummins dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-09 16:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-09 16:21 -------
Note that means the function is not being included in libgcc.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (2 preceding siblings ...)
  2004-08-09 16:21 ` pinskia at gcc dot gnu dot org
@ 2004-08-13 12:11 ` nitins2 at kpitcummins dot com
  2004-08-14  1:45 ` wilson at specifixinc dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: nitins2 at kpitcummins dot com @ 2004-08-13 12:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nitins2 at kpitcummins dot com  2004-08-13 12:11 -------
Hi,
Can anybody guide me on how to fix above mentioned bug ?
I am able to compile same code for little endian targets -m4/-m4-single/-m4-
single-only.

Thanks in advance.

Nitin Shah,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools were released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (3 preceding siblings ...)
  2004-08-13 12:11 ` nitins2 at kpitcummins dot com
@ 2004-08-14  1:45 ` wilson at specifixinc dot com
  2004-08-18 13:02 ` nitins2 at kpitcummins dot com
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: wilson at specifixinc dot com @ 2004-08-14  1:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at specifixinc dot com  2004-08-14 01:45 -------
Subject: Re:  Compilation error for sh-coff-gcc little endian
 target

nitins2 at kpitcummins dot com wrote:
> Can anybody guide me on how to fix above mentioned bug ?
> I am able to compile same code for little endian targets -m4/-m4-single/-m4-
> single-only.

Use -v and/or -Wl,--verbose to make sure the link command line is OK, 
and that the right libgcc is being linked in.

Use objdump and/or nm to look at libgcc to make sure it is OK.

Look at the gcc sources to see where __ashiftrt_r4_20 is defined, and go 
forwards from there to make sure it ended up in libgcc.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (4 preceding siblings ...)
  2004-08-14  1:45 ` wilson at specifixinc dot com
@ 2004-08-18 13:02 ` nitins2 at kpitcummins dot com
  2004-08-20  3:29 ` wilson at specifixinc dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: nitins2 at kpitcummins dot com @ 2004-08-18 13:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nitins2 at kpitcummins dot com  2004-08-18 13:01 -------
Hi,
The libgcc library for little endian target which is used by linker is correct, 
which has been 
verified using -Wl,--verbose as suggested.
I have extracted "_ashiftrt.o" from correct libgcc library and separately 
linked with my
test file. This builds without any error.
The symbols for which the error comes are present in same "_ashiftrt.o", which 
is verified 
using sh-coff-nm utility.

Can anybody suggest why linker gives undefined references for symbols 
from "_ashiftrt.o" though 
symbols are already present in "_ashiftrt.o" ?

Thanks in advance.
Regards,
Nitin Shah,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools were released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (5 preceding siblings ...)
  2004-08-18 13:02 ` nitins2 at kpitcummins dot com
@ 2004-08-20  3:29 ` wilson at specifixinc dot com
  2004-08-20 13:48 ` nitins2 at kpitcummins dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: wilson at specifixinc dot com @ 2004-08-20  3:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at specifixinc dot com  2004-08-20 03:29 -------
Subject: Re:  Compilation error for sh-coff-gcc little endian
 target

nitins2 at kpitcummins dot com wrote:
> Can anybody suggest why linker gives undefined references for symbols 
> from "_ashiftrt.o" though 
> symbols are already present in "_ashiftrt.o" ?

Check the link order of libraries.  A function is brought in from a 
library only if there is an undefined reference to it at the point where 
the library is linked in.  If you have cross references between libgcc 
and libc, then you may have to specify them multiple times to resolve 
all undefined functions, e.g.
   -lc -lgcc -lc -lgcc
There are linker options to simplify this, --start-group --end-group.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (6 preceding siblings ...)
  2004-08-20  3:29 ` wilson at specifixinc dot com
@ 2004-08-20 13:48 ` nitins2 at kpitcummins dot com
  2004-08-21  1:53 ` wilson at specifixinc dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: nitins2 at kpitcummins dot com @ 2004-08-20 13:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nitins2 at kpitcummins dot com  2004-08-20 13:48 -------
Hi,
Link order of libraries is as required.
I have tried suggested options but still the problem is not resolved.

We also tried following steps on libgcc.a from ../ml/m2,
1) sh-coff-ranlib libgcc.a
2) sh-coff-nm -s libgcc.a > error.txt 2>&1

Following error is observed in error.txt,

sh-coff-nm: _ashiftrt.o: File format is ambiguous
sh-coff-nm: Matching formats: coff-shl coff-shl-small

Why it is giving error ? Is it taking big endian format ?
Please comment.

Thanks in advance.

Nitin Shah,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools were released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (7 preceding siblings ...)
  2004-08-20 13:48 ` nitins2 at kpitcummins dot com
@ 2004-08-21  1:53 ` wilson at specifixinc dot com
  2004-12-10  3:17 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: wilson at specifixinc dot com @ 2004-08-21  1:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at specifixinc dot com  2004-08-21 01:53 -------
Subject: Re:  Compilation error for sh-coff-gcc little endian
 target

nitins2 at kpitcummins dot com wrote:
> sh-coff-nm: _ashiftrt.o: File format is ambiguous
> sh-coff-nm: Matching formats: coff-shl coff-shl-small

Maybe it is a binutils problem then.  It could be a problem with coff 
header flags not getting set right for the target.

This might be a good time to learn how binutils works.  Start debugging 
gas/ld/nm to see how they set and use coff header flags.  Start by using 
grep to find where the nm error message is coming from, and then work 
backwards from there to figure out what the problem is.

Another possible solution here is to stop using coff.  coff is obsolete. 
So few people care about it anymore (excluding the MS Windows guys of 
course) that there is really no point to using it, and no point to 
fixing problems with it.  You are probably better off if you remove the 
sh-coff configure support rather than trying to figure out what is wrong 
and fixing it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (8 preceding siblings ...)
  2004-08-21  1:53 ` wilson at specifixinc dot com
@ 2004-12-10  3:17 ` pinskia at gcc dot gnu dot org
  2004-12-10  6:06 ` nitins2 at kpitcummins dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-10  3:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-10 03:17 -------
Does this work on the mainline?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (9 preceding siblings ...)
  2004-12-10  3:17 ` pinskia at gcc dot gnu dot org
@ 2004-12-10  6:06 ` nitins2 at kpitcummins dot com
  2004-12-10 13:39 ` pinskia at gcc dot gnu dot org
  2004-12-13  9:21 ` nitins2 at kpitcummins dot com
  12 siblings, 0 replies; 14+ messages in thread
From: nitins2 at kpitcummins dot com @ 2004-12-10  6:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nitins2 at kpitcummins dot com  2004-12-10 06:06 -------
Hi,
Bug is not observed in GCC 4.0 mainline snapshot dated October 03, 2004.

Regards,
Nitin Shah,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools were released on October 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (10 preceding siblings ...)
  2004-12-10  6:06 ` nitins2 at kpitcummins dot com
@ 2004-12-10 13:39 ` pinskia at gcc dot gnu dot org
  2004-12-13  9:21 ` nitins2 at kpitcummins dot com
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-10 13:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-10 13:39 -------
So lets close it as fixed for 4.0.0 then.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug target/16932] Compilation error for sh-coff-gcc little endian target
  2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
                   ` (11 preceding siblings ...)
  2004-12-10 13:39 ` pinskia at gcc dot gnu dot org
@ 2004-12-13  9:21 ` nitins2 at kpitcummins dot com
  12 siblings, 0 replies; 14+ messages in thread
From: nitins2 at kpitcummins dot com @ 2004-12-13  9:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nitins2 at kpitcummins dot com  2004-12-13 09:21 -------
Hi,
Though this bug is fixed in mainline 4.0 but not yet fixed in branch 3.4.3. 
Can anybody guide us on how to fix the bug in branch 3.4.3 ?

Thanks in advance.

Nitin Shah,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools were released on October 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16932


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-12-13  9:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-09 11:24 [Bug c/16932] New: Compilation error for sh-coff-gcc little endian target nitins2 at kpitcummins dot com
2004-08-09 15:45 ` [Bug c/16932] " pinskia at gcc dot gnu dot org
2004-08-09 15:46 ` [Bug target/16932] " pinskia at gcc dot gnu dot org
2004-08-09 16:21 ` pinskia at gcc dot gnu dot org
2004-08-13 12:11 ` nitins2 at kpitcummins dot com
2004-08-14  1:45 ` wilson at specifixinc dot com
2004-08-18 13:02 ` nitins2 at kpitcummins dot com
2004-08-20  3:29 ` wilson at specifixinc dot com
2004-08-20 13:48 ` nitins2 at kpitcummins dot com
2004-08-21  1:53 ` wilson at specifixinc dot com
2004-12-10  3:17 ` pinskia at gcc dot gnu dot org
2004-12-10  6:06 ` nitins2 at kpitcummins dot com
2004-12-10 13:39 ` pinskia at gcc dot gnu dot org
2004-12-13  9:21 ` nitins2 at kpitcummins dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).