public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* An error on building the GCC tic6x cross compiler
@ 2012-10-12  7:47 m9802119
  2012-10-12 12:51 ` Kai Ruottu
  0 siblings, 1 reply; 6+ messages in thread
From: m9802119 @ 2012-10-12  7:47 UTC (permalink / raw)
  To: gcc-help

hello:

I tried to build tic6x cross compiler in recent days, but always fail.
this is my building step:
   cd build-binutils/
   ../binutils-2.22/configure --prefix=/usr/local/tic6x/ --target=tic6x-elf
   make all
   make install
   cd .. 
   cd build-gmp/
   export PATH=$PATH:/usr/local/tic6x
   export PATH=$PATH:/usr/local/tic6x/bin
   ../gmp/configure --prefix=/usr/local/tic6x/gmp
   ../gmp/configure --prefix=/usr/local/tic6x/gmp
   make
   make install
   cd ..
   cd build-mpfr/
   ../mpfr/configure --prefix=/usr/local/tic6x/mpfr --with-gmp=/usr/local/tic6x/gmp
   make
   make install
   cd ..
   cd build-mpc
   ../mpc/configure --prefix=/usr/local/tic6x/mpc --with-gmp=/usr/local/tic6x/gmp --with-mpfr=/usr/local/tic6x/mpfr --enable-static --disable-shared
   make
   make install
   cd ..
   cd build-gcc
   ../gcc-4.7.2/configure --target=tic6x-elf --prefix=/usr/localti/c6x --enable-languages="c,c++" --with-newlib --with-header=../newlib-1.20.0/newlib/libc/include --with-gmp=/usr/local/tic6x/gmp --with-mpfr=/usr/local/tic6x/mpfr --with-   mpc=/usr/local/tic6x/mpc
   make all-gcc
   make install-gcc
   cd ..
   cd build-newlib/
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH}:/usr/local/tic6x/gmp/lib:/usr/local/tic6x/mpfr/lib:/usr/local/tic6x/mpc/lib
   ln -s /usr/local/tic6x/bin/tic6x-elf-gcc /usr/local/tic6x/bin/tic6x-elf-cc
   ../newlib-1.20.0/configure --target=tic6x-elf --prefix=/usr/local/tic6x/
   make all install
   cd ..
   cd build-gcc
   make all install

after installation, I haved compile the .c file. Then the error occur. The message as shown in below:

$ tic6x-elf-gcc helloworld.c 
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000008100
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/sbrkr.c:58: undefined reference to `sbrk'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-writer.o): In function `_write_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/writer.c:58: undefined reference to `write'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-closer.o): In function `_close_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/closer.c:53: undefined reference to `close'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-fstatr.o): In function `_fstat_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/fstatr.c:62: undefined reference to `fstat'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-isattyr.o): In function `_isatty_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/isattyr.c:58: undefined reference to `isatty'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-lseekr.o): In function `_lseek_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/lseekr.c:58: undefined reference to `lseek'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-readr.o): In function `_read_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/readr.c:58: undefined reference to `read'
collect2: error:ld return 1

Every thing is OK when I build arm cross compiler and compile the .c or .cpp files.
Can you tell me what happen and how to solve it ?
Thanks.

Best Regards.

W.J. Wang

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

* Re: An error on building the GCC tic6x cross compiler
  2012-10-12  7:47 An error on building the GCC tic6x cross compiler m9802119
@ 2012-10-12 12:51 ` Kai Ruottu
  2012-10-12 18:02   ` Kai Ruottu
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Ruottu @ 2012-10-12 12:51 UTC (permalink / raw)
  To: gcc-help

12.10.2012 10:47, m9802119 kirjoitti:
> hello:
>
> I tried to build tic6x cross compiler in recent days, but always fail.
>
> after installation, I haved compile the .c file. Then the error occur. The message as shown in below:
>
> $ tic6x-elf-gcc helloworld.c 
> /usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000008100
> /usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
> /home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/sbrkr.c:58: undefined reference to `sbrk'
> Every thing is OK when I build arm cross compiler and compile the .c or .cpp files.
> Can you tell me what happen and how to solve it ?
>

You should learn what a "real target" is and how to link apps for it,
what are start files, 'crt*.o', what
low-level routines for the hardware, linker scripts etc...

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

* Re: An error on building the GCC tic6x cross compiler
  2012-10-12 12:51 ` Kai Ruottu
@ 2012-10-12 18:02   ` Kai Ruottu
  0 siblings, 0 replies; 6+ messages in thread
From: Kai Ruottu @ 2012-10-12 18:02 UTC (permalink / raw)
  To: gcc-help

Kai Ruottu wrote:
> 12.10.2012 10:47, m9802119 kirjoitti:
>> hello:
>>
>> I tried to build tic6x cross compiler in recent days, but always fail.
>>
>> after installation, I haved compile the .c file. Then the error occur. The message as shown in below:
>>
>> $ tic6x-elf-gcc helloworld.c 
>> /usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000008100
>> /usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
>> /home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/sbrkr.c:58: undefined reference to `sbrk'
>> Every thing is OK when I build arm cross compiler and compile the .c or .cpp files.
>> Can you tell me what happen and how to solve it ?
>>
> 
> You should learn what a "real target" is and how to link apps for it,
> what are start files, 'crt*.o', what
> low-level routines for the hardware, linker scripts etc...

The 'arm-elf' or 'arm-eabi' (expected) case used to have a default "real target",
some ARM-CPU board with a default monitor firmware on it and when linking using
low-level routines (read(), write(),...) using the monitor firmware to interface
the hardware system.

But the tic6x-elf seems to belong to the "unreal elves" category meaning that
it has no TI C6X CPU-board with some firmware or operating system as the default
target system.  So you MUST know what you have and use the right linker script
(and it using the right glue library) for it - if that linker script is provided
with newlib-1.20.0 !


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

* An error on building the GCC tic6x cross compiler
  2012-10-13  3:57 WJ Wang
  2012-10-13 22:46 ` WJ Wang
@ 2012-10-14 11:37 ` WJ Wang
  1 sibling, 0 replies; 6+ messages in thread
From: WJ Wang @ 2012-10-14 11:37 UTC (permalink / raw)
  To: gcc-help


please delete this article, thanks.
-- 
View this message in context: http://old.nabble.com/An-error-on-building-the-GCC-tic6x-cross-compiler-tp34550010p34550010.html
Sent from the gcc - Help mailing list archive at Nabble.com.

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

* An error on building the GCC tic6x cross compiler
  2012-10-13  3:57 WJ Wang
@ 2012-10-13 22:46 ` WJ Wang
  2012-10-14 11:37 ` WJ Wang
  1 sibling, 0 replies; 6+ messages in thread
From: WJ Wang @ 2012-10-13 22:46 UTC (permalink / raw)
  To: gcc-help


 hello everyone:

I tried to build tic6x cross compiler in recent days.
this is my building step:
  cd build-binutils/
  ../binutils-2.22/configure --prefix=/usr/local/tic6x/ --target=tic6x-elf
  make all
  make install
  cd ..
  cd build-gmp/
  export PATH=$PATH:/usr/local/tic6x
  export PATH=$PATH:/usr/local/tic6x/bin
  ../gmp/configure --prefix=/usr/local/tic6x/gmp
  ../gmp/configure --prefix=/usr/local/tic6x/gmp
  make
  make install
  cd ..
  cd build-mpfr/
  ../mpfr/configure --prefix=/usr/local/tic6x/mpfr
--with-gmp=/usr/local/tic6x/gmp
  make
  make install
  cd ..
  cd build-mpc
  ../mpc/configure --prefix=/usr/local/tic6x/mpc
--with-gmp=/usr/local/tic6x/gmp --with-mpfr=/usr/local/tic6x/mpfr
--enable-static --disable-shared
  make
  make install
  cd ..
  cd build-gcc
  ../gcc-4.7.2/configure --target=tic6x-elf --prefix=/usr/localti/c6x
--enable-languages="c,c++" --with-newlib
--with-header=../newlib-1.20.0/newlib/libc/include
--with-gmp=/usr/local/tic6x/gmp --with-mpfr=/usr/local/tic6x/mpfr --with-  
mpc=/usr/local/tic6x/mpc
  make all-gcc
  make install-gcc
  cd ..
  cd build-newlib/
  export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH}:/usr/local/tic6x/gmp/lib:/usr/local/tic6x/mpfr/lib:/usr/local/tic6x/mpc/lib
  ln -s /usr/local/tic6x/bin/tic6x-elf-gcc /usr/local/tic6x/bin/tic6x-elf-cc
  ../newlib-1.20.0/configure --target=tic6x-elf --prefix=/usr/local/tic6x/
  make all install
  cd ..
  cd build-gcc
  make all install

after installation, I have compiled the .c file. Then the error occur. The
message as shown in below:

$ tic6x-elf-gcc helloworld.c

/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/bin/ld:
warning: cannot find entry symbol _start; defaulting to 0000000000008100
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-sbrkr.o):
In function `_sbrk_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/sbrkr.c:58:
undefined reference to `sbrk'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-writer.o):
In function `_write_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/writer.c:58:
undefined reference to `write'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-closer.o):
In function `_close_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/closer.c:53:
undefined reference to `close'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-fstatr.o):
In function `_fstat_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/fstatr.c:62:
undefined reference to `fstat'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-isattyr.o):
In function `_isatty_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/isattyr.c:58:
undefined reference to `isatty'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-lseekr.o):
In function `_lseek_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/lseekr.c:58:
undefined reference to `lseek'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-readr.o):
In function `_read_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/readr.c:58:
undefined reference to `read'
collect2: error:ld return 1

Every thing is OK when I build arm cross compiler and compile the .c or .cpp
files.
Can you tell me how to solve it ?
Thanks.
-- 
View this message in context: http://old.nabble.com/An-error-on-building-the-GCC-tic6x-cross-compiler-tp34550010p34550010.html
Sent from the gcc - Help mailing list archive at Nabble.com.

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

* An error on building the GCC tic6x cross compiler
@ 2012-10-13  3:57 WJ Wang
  2012-10-13 22:46 ` WJ Wang
  2012-10-14 11:37 ` WJ Wang
  0 siblings, 2 replies; 6+ messages in thread
From: WJ Wang @ 2012-10-13  3:57 UTC (permalink / raw)
  To: gcc-help


 hello every one:

I tried to build tic6x cross compiler in recent days.
this is my building step:
  cd build-binutils/
  ../binutils-2.22/configure --prefix=/usr/local/tic6x/ --target=tic6x-elf
  make all
  make install
  cd ..
  cd build-gmp/
  export PATH=$PATH:/usr/local/tic6x
  export PATH=$PATH:/usr/local/tic6x/bin
  ../gmp/configure --prefix=/usr/local/tic6x/gmp
  ../gmp/configure --prefix=/usr/local/tic6x/gmp
  make
  make install
  cd ..
  cd build-mpfr/
  ../mpfr/configure --prefix=/usr/local/tic6x/mpfr
--with-gmp=/usr/local/tic6x/gmp
  make
  make install
  cd ..
  cd build-mpc
  ../mpc/configure --prefix=/usr/local/tic6x/mpc
--with-gmp=/usr/local/tic6x/gmp --with-mpfr=/usr/local/tic6x/mpfr
--enable-static --disable-shared
  make
  make install
  cd ..
  cd build-gcc
  ../gcc-4.7.2/configure --target=tic6x-elf --prefix=/usr/localti/c6x
--enable-languages="c,c++" --with-newlib
--with-header=../newlib-1.20.0/newlib/libc/include
--with-gmp=/usr/local/tic6x/gmp --with-mpfr=/usr/local/tic6x/mpfr --with-  
mpc=/usr/local/tic6x/mpc
  make all-gcc
  make install-gcc
  cd ..
  cd build-newlib/
  export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH}:/usr/local/tic6x/gmp/lib:/usr/local/tic6x/mpfr/lib:/usr/local/tic6x/mpc/lib
  ln -s /usr/local/tic6x/bin/tic6x-elf-gcc /usr/local/tic6x/bin/tic6x-elf-cc
  ../newlib-1.20.0/configure --target=tic6x-elf --prefix=/usr/local/tic6x/
  make all install
  cd ..
  cd build-gcc
  make all install

after installation, I have compiled the .c file. Then the error occur. The
message as shown in below:

$ tic6x-elf-gcc helloworld.c

/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/bin/ld:
warning: cannot find entry symbol _start; defaulting to 0000000000008100
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-sbrkr.o):
In function `_sbrk_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/sbrkr.c:58:
undefined reference to `sbrk'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-writer.o):
In function `_write_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/writer.c:58:
undefined reference to `write'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-closer.o):
In function `_close_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/closer.c:53:
undefined reference to `close'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-fstatr.o):
In function `_fstat_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/fstatr.c:62:
undefined reference to `fstat'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-isattyr.o):
In function `_isatty_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/isattyr.c:58:
undefined reference to `isatty'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-lseekr.o):
In function `_lseek_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/lseekr.c:58:
undefined reference to `lseek'
/usr/local/c6x/lib/gcc/tic6x-elf/4.7.2/../../../../tic6x-elf/lib/libc.a(lib_a-readr.o):
In function `_read_r':
/home/spirits/src/build-newlib/tic6x-elf/newlib/libc/reent/../../../../../newlib-1.20.0/newlib/libc/reent/readr.c:58:
undefined reference to `read'
collect2: error:ld return 1

Every thing is OK when I build arm cross compiler and compile the .c or .cpp
files.
Can you tell me how to solve it ?
Thanks.
-- 
View this message in context: http://old.nabble.com/An-error-on-building-the-GCC-tic6x-cross-compiler-tp34550010p34550010.html
Sent from the gcc - Help mailing list archive at Nabble.com.

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

end of thread, other threads:[~2012-10-13  7:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-12  7:47 An error on building the GCC tic6x cross compiler m9802119
2012-10-12 12:51 ` Kai Ruottu
2012-10-12 18:02   ` Kai Ruottu
2012-10-13  3:57 WJ Wang
2012-10-13 22:46 ` WJ Wang
2012-10-14 11:37 ` WJ Wang

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