This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: newbie : cross compiler for powerpc from linux i686 RH7.2


Vishwas,
Most of your errors should be resolved in the linker command file, which
leads me to believe you are not using one.  _start is usually defined in the
file crt0.o or something similar.  See the linker switch -T.

Dennis

-----Original Message-----
From: crossgcc-owner@sources.redhat.com
[mailto:crossgcc-owner@sources.redhat.com]On Behalf Of
Vishwas.More@nokia.com
Sent: Wednesday, September 11, 2002 12:57 PM
To: crossgcc@sources.redhat.com
Cc: Vishwas.More@nokia.com
Subject: newbie : cross compiler for powerpc from linux i686 RH7.2


Hi gurus

sorry for this question ( you must have seen it many times ).. but even
after going thru the CrossGCC and lists i am having problems getting a cross
compiled gcc for powerpc from a linux Red hat 7.2 host..

I dont get any compilation errors during the build steps ( i  have given the
steps in the end of this mail ) :
but when i try to compile a simple printf hello program
i get a LOT of errors :
-------------------------------------
vmore@EFS_VW2[133] >) powerpc-eabi-gcc hello.c
/usr/vmore/gnutools/cross-power-eabi-tools/target/powerpc-eabi/bin/ld:
warning: cannot find entry symbol _start; defaulting to 01800074
/tmp/ccnaV6fl.o: In function `main':
/tmp/ccnaV6fl.o(.text+0x24): undefined reference to `printf'
/usr/vmore/gnutools/cross-power-eabi-tools/target/lib/gcc-lib/powerpc-eabi/2
.95.3/libgcc.a(eabi.o)(.got2+0x8): undefined reference to `__SDATA_START__'
/usr/vmore/gnutools/cross-power-eabi-tools/target/lib/gcc-lib/powerpc-eabi/2
.95.3/libgcc.a(eabi.o)(.got2+0xc): undefined reference to `__SBSS_END__'
/usr/vmore/gnutools/cross-power-eabi-tools/target/lib/gcc-lib/powerpc-eabi/2
.95.3/libgcc.a(eabi.o)(.got2+0x14): undefined reference to
`__SDATA2_START__'
/usr/vmore/gnutools/cross-power-eabi-tools/target/lib/gcc-lib/powerpc-eabi/2
.95.3/libgcc.a(eabi.o)(.got2+0x18): undefined reference to `__SBSS2_END__'
/usr/vmore/gnutools/cross-power-eabi-tools/target/lib/gcc-lib/powerpc-eabi/2
.95.3/libgcc.a(eabi-ctors.o): In function `__do_global_ctors':
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.text+
0x1e): undefined reference to `__CTOR_END__'
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.text+
0x26): undefined reference to `__CTOR_LIST__'
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.text+
0x2a): undefined reference to `__CTOR_LIST__'
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.text+
0x2e): undefined reference to `__CTOR_END__'
/usr/vmore/gnutools/cross-power-eabi-tools/target/lib/gcc-lib/powerpc-eabi/2
.95.3/libgcc.a(eabi-ctors.o): In function `__do_global_dtors':
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.text+
0xae): undefined reference to `__DTOR_LIST__'
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.text+
0xb6): undefined reference to `__DTOR_END__'
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.text+
0xba): undefined reference to `__DTOR_END__'
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.text+
0xbe): undefined reference to `__DTOR_LIST__'
/usr/vmore/gnutools/cross-power-eabi-tools/target/lib/gcc-lib/powerpc-eabi/2
.95.3/libgcc.a(eabi-ctors.o): In function `__do_global_ctors':
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.sdata
+0x0): undefined reference to `__init'
/usr/vmore/gnutools/cross-power-eabi-tools/build/gcc/gcc/eabi-ctors.c(.sdata
+0x4): undefined reference to `__fini'
collect2: ld returned 1 exit status
vmore@EFS_VW2[134] >)
-----------------------------------


I think i am screwing up something with the libraries, but anyways here is
what i have done..

TOOLS used :

binutils-2.13.90.0.4.tar  , gcc-2.95.3.tar , newlib-1.9.0.tar
( planning to use gdb-5.2.1.tar later )

Host Details :
Linux  mvtest 2.4.7-10enterprise #1 SMP  i686 unknown
Red Hat 7.2

target=powerpc-eabi
prefix=/usr/vmore/gnutools/cross-gcc/target


Steps :

cd /usr/vmore/gnutools/cross-gcc
mkdir src build target test
cd /usr/vmore/gnutools/cross-gcc/src
tar -xvf ../../download/binutils-2*  gcc* newlib*

1. Compiling bintuils
   cd /usr/vmore/gnutools/cross-gcc/build
  ../../src/binutils*/configure --target=$target --prefix=$prefix -v
  make all install

 	 No compilation errors

2. Compiling gcc    ( removed libf2c from gcc*/src and linked ln -s
../newlib* newlib in gcc*/src )
   cd /usr/vmore/gnutools/cross-gcc/build


../../src/binutils*/configure --target=$target --prefix=$prefix --with-newli
b --with-header=/usr/vmore/gnutools/cross-gcc/src/newlib-1.9.0/newlib/libc/i
nclude -v
  make cross LANGUAGES="c c++"
make install

	No compilation errors

3. Test code compilation

   Added $prefix in my PATH
  A test c program with a single printf in it,
    powerpc-eabi-gcc hello.c

   LOT OF ERRORS ..

pls advice

thanks
vishwas








------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]