linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Hello World and 405GP with my gcc cross compiling.
@ 2001-01-17 22:31 Hua Ji
  2001-01-17 22:41 ` Grant Erickson
  2001-01-19  1:49 ` Peter Ryser
  0 siblings, 2 replies; 3+ messages in thread
From: Hua Ji @ 2001-01-17 22:31 UTC (permalink / raw)
  To: 'crossgcc@sources.redhat.com'; +Cc: linuxppc-embedded


Thanks for all feedback. Please review my current postion.

----------------------
cannot find entry symbol _start; defaulting to 01800074
/var/tmp/ccAEuQ8q.o: In function `ppctest':
/var/tmp/ccAEuQ8q.o(.text+0x20): undefined reference to `printf'
GNU ld version 2.9.1 (with BFD 2.9.1)
  Supported emulations:
   elf32ppc
----------------------

My current position is:

I have no problem for creating the object file, say, HelloWorld.o by using
my
gcc for powerpc-elf under a solaris. And then I moved the object file from
solaris to a PC and
used the IBM High c/C++ linker to link my Helloworld.o with the sample
"usr_samp"
codes provided by IBM 405GP reference kit. It works fine after being loaded
with
the tftp... In other words, it is running on my 405GP reference board and
print out my
inserted "hello world..."!

So, my conclusion is: my gcc for powerpc-elf works, at least for creating
object file part.

Now, why I can't direct creat the executable file but get the above compain?
Looks like
it can't find correct libc codes, for example, the __start and printf symbol
and so on.

What my environment is: I used newlib to creat my libc.a. However, I am not
sure if my native
gcc use gnulic or newlib. does this matter?

Any clue, folks,

Hua

Attached is information I copied from my 405gp board terminal
----
---------------------------
Transfer Complete ...
Loaded successfully ...
Entry point at 0x26898 ...
Pinging host to select baud rate (press any key to quit).
  trying 56000
SLIP not active.

*****Hello World from Hua JI!
*****This is a test for gcc for powerpc

Hello 405GP user!

Your ROM Monitor version is : 1.13

Your 405GP Evaluation Board has 134217728 bytes of SDRAM installed.
Processor speed is 200MHz
PLB speed is       100MHz.
PCI speed is       33MHz.

Your built-in Ethernet controller's network address is :  0004ace31112
Your PCI Ethernet controller's network address is      :  000000000000

usr_samp done!
---------------------------


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

* Re: Hello World and 405GP with my gcc cross compiling.
  2001-01-17 22:31 Hello World and 405GP with my gcc cross compiling Hua Ji
@ 2001-01-17 22:41 ` Grant Erickson
  2001-01-19  1:49 ` Peter Ryser
  1 sibling, 0 replies; 3+ messages in thread
From: Grant Erickson @ 2001-01-17 22:41 UTC (permalink / raw)
  To: Hua Ji; +Cc: 'crossgcc@sources.redhat.com', linuxppc-embedded


On Wed, 17 Jan 2001, Hua Ji wrote:
> My current position is:
>
> I have no problem for creating the object file, say, HelloWorld.o by
> using my gcc for powerpc-elf under a solaris.
>
> And then I moved the object file from solaris to a PC and used the IBM
> High c/C++ linker to link my Helloworld.o with the sample "usr_samp"
> codes provided by IBM 405GP reference kit. It works fine after being
> loaded with the tftp... In other words, it is running on my 405GP
> reference board and print out my inserted "hello world..."!

I never had much luck linking GCC generated objects with IBM's High C/C++
linker and libraries.

I think your effort would be better invested if you grabbed the Hard Hard
Linux kernel for the 405GP from MontaVista and set-up an associated NFS
root disk and attempted your development from there.

If you follow the instructions at:

	http://www.borg.umn.edu/~grant/Linux/cross.html

The applications you create will run with Monta Vista's kernel and NFS
root file system.

> So, my conclusion is: my gcc for powerpc-elf works, at least for
> creating object file part.
>
> Now, why I can't direct creat the executable file but get the above
> compain? Looks like it can't find correct libc codes, for example, the
> __start and printf symbol and so on.
>
> What my environment is: I used newlib to creat my libc.a. However, I
> am not sure if my native gcc use gnulic or newlib. does this matter?
>
> Any clue, folks,

--
 Grant Erickson                       University of Minnesota Alumni
  o mail:erick205@umn.edu                                 1996 BSEE
  o http://www.umn.edu/~erick205                          1998 MSEE


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

* Re: Hello World and 405GP with my gcc cross compiling.
  2001-01-17 22:31 Hello World and 405GP with my gcc cross compiling Hua Ji
  2001-01-17 22:41 ` Grant Erickson
@ 2001-01-19  1:49 ` Peter Ryser
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Ryser @ 2001-01-19  1:49 UTC (permalink / raw)
  To: Hua Ji; +Cc: 'crossgcc@sources.redhat.com', linuxppc-embedded


Try the following:

${prefix}/bin/${target}-gcc -g -c hello.c
${prefix}/bin/${target}-ld -o hello ${prefix}/${target}/lib/crt0.o hello.o -lc
-lg

- Peter


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2001-01-19  1:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-17 22:31 Hello World and 405GP with my gcc cross compiling Hua Ji
2001-01-17 22:41 ` Grant Erickson
2001-01-19  1:49 ` Peter Ryser

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 NNTP newsgroup(s).