public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Fail to compile file with profile for mips system using cross-compiling
@ 2005-09-29 21:25 Aaron Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Aaron Chen @ 2005-09-29 21:25 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

With a new version of gcrtl.o, I can now compiled the application now.
Thanx for pointing out it.

Aaron
-----Original Message-----
From: Ian Lance Taylor [mailto:ian@airs.com] 
Sent: Thursday, September 29, 2005 10:52 AM
To: Aaron Chen
Cc: gcc-help@gcc.gnu.org
Subject: Re: Fail to compile file with profile for mips system using
cross-compiling

"Aaron Chen" <AaronC@tridentmicro.com> writes:

> The steps to reproduce the error:
> 1.mips_lexra_fp_be-gcc -c -pg -g test.c
> 2.mips_lexra_fp_be-gcc -pg -o test test.o
> 
> Then get the following error messages:
> ######
> /projects/mips/lexra_fp_be/bin/../target/usr/lib/gcrt1.o: In function
`__gmon_start__':
> gmon-start.c(.text+0xb8): undefined reference to `_start'
> collect2: ld returned 1 exit status
> #######

In general profiling requires library support.  gcc will do its best
to set up the profiling call, but if you don't have the right support
in the library and the OS it will fail.  In particular the gcrt1.o
file did not come from gcc.  Sorry I can't be more helpful.

Ian

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

* Re: Fail to compile file with profile for mips system using cross-compiling
  2005-09-29  5:00 Aaron Chen
@ 2005-09-29 17:52 ` Ian Lance Taylor
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 2005-09-29 17:52 UTC (permalink / raw)
  To: Aaron Chen; +Cc: gcc-help

"Aaron Chen" <AaronC@tridentmicro.com> writes:

> The steps to reproduce the error:
> 1.mips_lexra_fp_be-gcc -c -pg -g test.c
> 2.mips_lexra_fp_be-gcc -pg -o test test.o
> 
> Then get the following error messages:
> ######
> /projects/mips/lexra_fp_be/bin/../target/usr/lib/gcrt1.o: In function `__gmon_start__':
> gmon-start.c(.text+0xb8): undefined reference to `_start'
> collect2: ld returned 1 exit status
> #######

In general profiling requires library support.  gcc will do its best
to set up the profiling call, but if you don't have the right support
in the library and the OS it will fail.  In particular the gcrt1.o
file did not come from gcc.  Sorry I can't be more helpful.

Ian

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

* Fail to compile file with profile for mips system using cross-compiling
@ 2005-09-29  5:00 Aaron Chen
  2005-09-29 17:52 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Aaron Chen @ 2005-09-29  5:00 UTC (permalink / raw)
  To: gcc-help

Hi all,
   I have met the following issue when compile application with mips system. The test .c file is 

#include <stdio.h>

int main(int argc, char **argv){
    int i = 5;
    int j = 0;

    printf("\nHello World!, i is %x, j is %x\n", i, j);
}
...

The steps to reproduce the error:
1.mips_lexra_fp_be-gcc -c -pg -g test.c
2.mips_lexra_fp_be-gcc -pg -o test test.o

Then get the following error messages:
######
/projects/mips/lexra_fp_be/bin/../target/usr/lib/gcrt1.o: In function `__gmon_start__':
gmon-start.c(.text+0xb8): undefined reference to `_start'
collect2: ld returned 1 exit status
#######

I googled such issue and find many guys face the same problem but less answers are found or the solutions cannot work. Also, I have tried to add "-static" option , just as some guys mentioned else where but still failed.

What I should point out is that such compiling can work on x86 system. And failed on a mips-cross-compiling system. 

The configuration of my pc is : mips-cross-compiling tool chain, mips-gcc 2.95.3, mips-ld 2.10.91.  The kernel is 2.6.9-1.667, Fedora 3.

Any ideas on this issue?

Thanx.

Aaron
 
 

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

end of thread, other threads:[~2005-09-29 21:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-29 21:25 Fail to compile file with profile for mips system using cross-compiling Aaron Chen
  -- strict thread matches above, loose matches on Subject: below --
2005-09-29  5:00 Aaron Chen
2005-09-29 17:52 ` Ian Lance Taylor

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).