Hello World and 405GP with my gcc cross compiling.

3 messages, 3 authors, 2001-01-19 · open the first message on its own page

Hello World and 405GP with my gcc cross compiling.

From: Hua Ji <hidden>
Date: 2001-01-17 22:31:55

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/

Re: Hello World and 405GP with my gcc cross compiling.

From: Grant Erickson <hidden>
Date: 2001-01-17 22:41:39

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/

Re: Hello World and 405GP with my gcc cross compiling.

From: Peter Ryser <hidden>
Date: 2001-01-19 01:49:54

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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help