Linux MIPS Architecture development
 help / color / mirror / Atom feed
* gcc-4.1.0 cross-compile for MIPS
@ 2006-06-16 12:22 kernel coder
  2006-06-16 12:38 ` Ralf Roesch
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: kernel coder @ 2006-06-16 12:22 UTC (permalink / raw)
  To: linux-mips

hi,
   I'm trying to cross compile gcc-4.1.0 for mipsel platform.Following
is the sequence of commands which i'm using.My host system is i686.

../gcc-4.1.0/configure --target=mipsel --without-headres
--prefix=/home/shahzad/install/ --with-newlib --enable-languages=c

make

But following error is generated

/home/shahzad/mips_gcc/./gcc/xgcc -B/home/shahzad/mips_gcc/./gcc/
-B/home/shahzad/install//mipsel/bin/
-B/home/shahzad/install//mipsel/lib/ -isystem
/home/shahzad/install//mipsel/include -isystem
/home/shahzad/install//mipsel/sys-include -DHAVE_CONFIG_H -I.
-I../../../gcc-4.1.0/libssp -I. -Wall -O2 -g -O2 -MT ssp.lo -MD -MP
-MF .deps/ssp.Tpo -c ../../../gcc-4.1.0/libssp/ssp.c -o ssp.o
../../../gcc-4.1.0/libssp/ssp.c:46:20: error: fcntl.h: No such file or directory
../../../gcc-4.1.0/libssp/ssp.c: In function '__guard_setup':
../../../gcc-4.1.0/libssp/ssp.c:70: warning: implicit declaration of
function 'open'
../../../gcc-4.1.0/libssp/ssp.c:70: error: 'O_RDONLY' undeclared
(first use in this function)
../../../gcc-4.1.0/libssp/ssp.c:70: error: (Each undeclared identifier
is reported only once
../../../gcc-4.1.0/libssp/ssp.c:70: error: for each function it appears in.)
../../../gcc-4.1.0/libssp/ssp.c:73: error: 'ssize_t' undeclared (first
use in this function)
../../../gcc-4.1.0/libssp/ssp.c:73: error: expected ';' before 'size'
.........................................
........................................

I'm using fedora 5 as development platform and version of gcc
installed on system is 4.1.0

thanks,
shahzad

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

* Re: gcc-4.1.0 cross-compile for MIPS
  2006-06-16 12:22 gcc-4.1.0 cross-compile for MIPS kernel coder
@ 2006-06-16 12:38 ` Ralf Roesch
  2006-06-16 14:22   ` kernel coder
  2006-06-16 15:41 ` Jonathan Day
  2006-06-16 22:33 ` James E Wilson
  2 siblings, 1 reply; 8+ messages in thread
From: Ralf Roesch @ 2006-06-16 12:38 UTC (permalink / raw)
  To: kernel coder; +Cc: linux-mips

I have successfully build a newlib based crosscompiler but it's gcc 4.0.3.

Anyway  I have some notes on your configuration:

--without-headres (is it a typo?)

Instead I have:
--with-headers=<path_to_newlib>/src/newlib/libc/include \

May be this helps.

Regards
Ralf

kernel coder schrieb:
> hi,
>   I'm trying to cross compile gcc-4.1.0 for mipsel platform.Following
> is the sequence of commands which i'm using.My host system is i686.
>
> ../gcc-4.1.0/configure --target=mipsel --without-headres
> --prefix=/home/shahzad/install/ --with-newlib --enable-languages=c
>
> make
>
> But following error is generated
>
> /home/shahzad/mips_gcc/./gcc/xgcc -B/home/shahzad/mips_gcc/./gcc/
> -B/home/shahzad/install//mipsel/bin/
> -B/home/shahzad/install//mipsel/lib/ -isystem
> /home/shahzad/install//mipsel/include -isystem
> /home/shahzad/install//mipsel/sys-include -DHAVE_CONFIG_H -I.
> -I../../../gcc-4.1.0/libssp -I. -Wall -O2 -g -O2 -MT ssp.lo -MD -MP
> -MF .deps/ssp.Tpo -c ../../../gcc-4.1.0/libssp/ssp.c -o ssp.o
> ../../../gcc-4.1.0/libssp/ssp.c:46:20: error: fcntl.h: No such file or 
> directory
> ../../../gcc-4.1.0/libssp/ssp.c: In function '__guard_setup':
> ../../../gcc-4.1.0/libssp/ssp.c:70: warning: implicit declaration of
> function 'open'
> ../../../gcc-4.1.0/libssp/ssp.c:70: error: 'O_RDONLY' undeclared
> (first use in this function)
> ../../../gcc-4.1.0/libssp/ssp.c:70: error: (Each undeclared identifier
> is reported only once
> ../../../gcc-4.1.0/libssp/ssp.c:70: error: for each function it 
> appears in.)
> ../../../gcc-4.1.0/libssp/ssp.c:73: error: 'ssize_t' undeclared (first
> use in this function)
> ../../../gcc-4.1.0/libssp/ssp.c:73: error: expected ';' before 'size'
> .........................................
> ........................................
>
> I'm using fedora 5 as development platform and version of gcc
> installed on system is 4.1.0
>
> thanks,
> shahzad
>

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

* Re: gcc-4.1.0 cross-compile for MIPS
  2006-06-16 12:38 ` Ralf Roesch
@ 2006-06-16 14:22   ` kernel coder
  0 siblings, 0 replies; 8+ messages in thread
From: kernel coder @ 2006-06-16 14:22 UTC (permalink / raw)
  To: Ralf Roesch; +Cc: linux-mips

thanks ,i did a grep in gcc source directory for fcntl.h but there was
no such file in source code.
I think i should explicitly include path for fcntl.h file.

For gcc-3.4.2 i used following sequence of commands.

binutils
------------
../binutils-2.16.1/configure --prefix=/home/shahzad/install --target=mipsel
make
make install

 gcc-3.4.2
----------------------------
../gcc-3.4.2/configure --prefix=/home/shahzad/install --target=mipsel
--without-headers --with-newlib --enable-languages=c
make
make install

glibc
-----------
../glibc-2.3.1/configure --host=mipsel --prefix="/usr"
--enable-add-ons     -with-headers=/home/shahzad/install/include

make cross-compiling=yes  --prefix="" install-headers

gcc-3.4.2
--------------
../gcc-3.4.2/configure --target=mipsel --prefix=/home/shahzad/install
--disable-shared --with-headers=/home/shahzad/install/include
--with-newlib --enable-languages=c

make
make install

Should i change this sequence for gcc-4.1.0.Can someone give his
sequence of commands for his successfull gcc build for mips.

thanks,
shahzad


On 6/16/06, Ralf Roesch <linux@cantastic.de> wrote:
> I have successfully build a newlib based crosscompiler but it's gcc 4.0.3.
>
> Anyway  I have some notes on your configuration:
>
> --without-headres (is it a typo?)
>
> Instead I have:
> --with-headers=<path_to_newlib>/src/newlib/libc/include \
>
> May be this helps.
>
> Regards
> Ralf
>
> kernel coder schrieb:
> > hi,
> >   I'm trying to cross compile gcc-4.1.0 for mipsel platform.Following
> > is the sequence of commands which i'm using.My host system is i686.
> >
> > ../gcc-4.1.0/configure --target=mipsel --without-headres
> > --prefix=/home/shahzad/install/ --with-newlib --enable-languages=c
> >
> > make
> >
> > But following error is generated
> >
> > /home/shahzad/mips_gcc/./gcc/xgcc -B/home/shahzad/mips_gcc/./gcc/
> > -B/home/shahzad/install//mipsel/bin/
> > -B/home/shahzad/install//mipsel/lib/ -isystem
> > /home/shahzad/install//mipsel/include -isystem
> > /home/shahzad/install//mipsel/sys-include -DHAVE_CONFIG_H -I.
> > -I../../../gcc-4.1.0/libssp -I. -Wall -O2 -g -O2 -MT ssp.lo -MD -MP
> > -MF .deps/ssp.Tpo -c ../../../gcc-4.1.0/libssp/ssp.c -o ssp.o
> > ../../../gcc-4.1.0/libssp/ssp.c:46:20: error: fcntl.h: No such file or
> > directory
> > ../../../gcc-4.1.0/libssp/ssp.c: In function '__guard_setup':
> > ../../../gcc-4.1.0/libssp/ssp.c:70: warning: implicit declaration of
> > function 'open'
> > ../../../gcc-4.1.0/libssp/ssp.c:70: error: 'O_RDONLY' undeclared
> > (first use in this function)
> > ../../../gcc-4.1.0/libssp/ssp.c:70: error: (Each undeclared identifier
> > is reported only once
> > ../../../gcc-4.1.0/libssp/ssp.c:70: error: for each function it
> > appears in.)
> > ../../../gcc-4.1.0/libssp/ssp.c:73: error: 'ssize_t' undeclared (first
> > use in this function)
> > ../../../gcc-4.1.0/libssp/ssp.c:73: error: expected ';' before 'size'
> > .........................................
> > ........................................
> >
> > I'm using fedora 5 as development platform and version of gcc
> > installed on system is 4.1.0
> >
> > thanks,
> > shahzad
> >
>

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

* Re: gcc-4.1.0 cross-compile for MIPS
  2006-06-16 12:22 gcc-4.1.0 cross-compile for MIPS kernel coder
  2006-06-16 12:38 ` Ralf Roesch
@ 2006-06-16 15:41 ` Jonathan Day
  2006-06-16 22:33 ` James E Wilson
  2 siblings, 0 replies; 8+ messages in thread
From: Jonathan Day @ 2006-06-16 15:41 UTC (permalink / raw)
  To: kernel coder, linux-mips

Hi,

Two quick questions in return! :) First, did you use
the patches on the Linux From Scratch website, which
fixes problems with GCC in a MIPS environment?
(Although not using the MIPSEL environment myself, I'm
on a big-endiam system, I learned very quickly that
those patches really are essential.)

The second question is why 4.1.0? 4.1.1 fixes some
nasties, from what I understand, making that the
better of the 4.1.x branch. On the flip-side, 4.0.3 is
the last-known version of GCC that will compile G95
correctly, strongly hinting at remaining issues in
4.1.x that have the potential for generating incorrect
code. (I've not been able to build 4.2.x from SVN for
a while, although it adds some features I would love
to use.)

Jonathan Day

--- kernel coder <lhrkernelcoder@gmail.com> wrote:

> hi,
>    I'm trying to cross compile gcc-4.1.0 for mipsel
> platform.Following
> is the sequence of commands which i'm using.My host
> system is i686.
> 
> ../gcc-4.1.0/configure --target=mipsel
> --without-headres
> --prefix=/home/shahzad/install/ --with-newlib
> --enable-languages=c
> 
> make
> 
> But following error is generated
> 
> /home/shahzad/mips_gcc/./gcc/xgcc
> -B/home/shahzad/mips_gcc/./gcc/
> -B/home/shahzad/install//mipsel/bin/
> -B/home/shahzad/install//mipsel/lib/ -isystem
> /home/shahzad/install//mipsel/include -isystem
> /home/shahzad/install//mipsel/sys-include
> -DHAVE_CONFIG_H -I.
> -I../../../gcc-4.1.0/libssp -I. -Wall -O2 -g -O2 -MT
> ssp.lo -MD -MP
> -MF .deps/ssp.Tpo -c ../../../gcc-4.1.0/libssp/ssp.c
> -o ssp.o
> ../../../gcc-4.1.0/libssp/ssp.c:46:20: error:
> fcntl.h: No such file or directory
> ../../../gcc-4.1.0/libssp/ssp.c: In function
> '__guard_setup':
> ../../../gcc-4.1.0/libssp/ssp.c:70: warning:
> implicit declaration of
> function 'open'
> ../../../gcc-4.1.0/libssp/ssp.c:70: error:
> 'O_RDONLY' undeclared
> (first use in this function)
> ../../../gcc-4.1.0/libssp/ssp.c:70: error: (Each
> undeclared identifier
> is reported only once
> ../../../gcc-4.1.0/libssp/ssp.c:70: error: for each
> function it appears in.)
> ../../../gcc-4.1.0/libssp/ssp.c:73: error: 'ssize_t'
> undeclared (first
> use in this function)
> ../../../gcc-4.1.0/libssp/ssp.c:73: error: expected
> ';' before 'size'
> .........................................
> ........................................
> 
> I'm using fedora 5 as development platform and
> version of gcc
> installed on system is 4.1.0
> 
> thanks,
> shahzad
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

* Re: gcc-4.1.0 cross-compile for MIPS
  2006-06-16 12:22 gcc-4.1.0 cross-compile for MIPS kernel coder
  2006-06-16 12:38 ` Ralf Roesch
  2006-06-16 15:41 ` Jonathan Day
@ 2006-06-16 22:33 ` James E Wilson
  2006-06-19  6:40   ` kernel coder
  2 siblings, 1 reply; 8+ messages in thread
From: James E Wilson @ 2006-06-16 22:33 UTC (permalink / raw)
  To: kernel coder; +Cc: linux-mips

On Fri, 2006-06-16 at 05:22, kernel coder wrote:
> /home/shahzad/install//mipsel/sys-include -DHAVE_CONFIG_H -I.
> -I../../../gcc-4.1.0/libssp -I. -Wall -O2 -g -O2 -MT ssp.lo -MD -MP
> -MF .deps/ssp.Tpo -c ../../../gcc-4.1.0/libssp/ssp.c -o ssp.o
> ../../../gcc-4.1.0/libssp/ssp.c:46:20: error: fcntl.h: No such file or directory

You can't build target libraries like libssp in a --without-headers
build.  It was luck that this happened to work with earlier gcc
releases, because previously we didn't have C language target libraries
in gcc.  The solution is to do
  make all-gcc
  make install-gcc
instead of just
  make all
  make install

Please see Dan Kegel's crosstools package, which already knows how to do
this.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com

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

* Re: gcc-4.1.0 cross-compile for MIPS
  2006-06-16 22:33 ` James E Wilson
@ 2006-06-19  6:40   ` kernel coder
  2006-06-19  7:19     ` Matej Kupljen
  2006-06-23 19:01     ` James E Wilson
  0 siblings, 2 replies; 8+ messages in thread
From: kernel coder @ 2006-06-19  6:40 UTC (permalink / raw)
  To: James E Wilson; +Cc: linux-mips

yes you were right.When i did
make all-gcc

It just compiled smoothly.

Now to compile glibc-2.3.6 ,I issued following sequence of commands

../glibc-2.3.6/configure --host=mipsel-linux --prefix="/usr"
--enable-add-ons --with-headers=/home/shahzad/install/mipsel/include

 make cross-compiling=yes
install_root=/home/shahzad/install/mipsel/include  prefix=""
install-headers

But following error was generated

make[1]: Entering directory `/home/shahzad/glibc-2.3.6' { echo
'#include "posix/bits/posix1_lim.h"';            \   echo '#define
_LIBC 1';                                       \   echo '#include
"misc/sys/uio.h"'; } |                 \ gcc -mabi=32 -E -dM -MD -MP
-MF /home/shahzad/build-glibc-headers/bits/stdio_lim.dT -MT
'/home/shahzad/build-glibc-headers/bits/stdio_lim.h
/home/shahzad/build-glibc-headers/bits/stdio_lim.d'      \
      -Iinclude -I. -I/home/shahzad/build-glibc-headers  -Ilibio
-Inptl -I/home/shahzad/build-glibc-headers -Isysdeps/mips/elf
-Inptl/sysdeps/unix/sysv/linux -Inptl/sysdeps/pthread
-Isysdeps/pthread -Inptl/sysdeps/unix/sysv -Inptl/sysdeps/unix
-Isysdeps/unix/sysv/linux/mips/mips32 -Isysdeps/unix/sysv/linux/mips
-Isysdeps/unix/sysv/linux -Isysdeps/gnu -Isysdeps/unix/common
-Isysdeps/unix/mman -Isysdeps/unix/inet -Isysdeps/unix/sysv
-Isysdeps/unix/mips/mips32 -Isysdeps/unix/mips -Isysdeps/unix
-Isysdeps/posix -Isysdeps/mips/mips32 -Isysdeps/mips
-Isysdeps/ieee754/flt-32 -Isysdeps/ieee754/dbl-64
-Isysdeps/wordsize-32 -Isysdeps/mips/fpu -Isysdeps/ieee754
-Isysdeps/generic/elf -Isysdeps/generic -nostdinc -isystem
/usr/lib/gcc/i386-redhat-linux/4.1.0/include -isystem
/home/shahzad/install/mipsel/include -xc - -o
/home/shahzad/build-glibc-headers/bits/stdio_lim.hT
cc1: error: unrecognized command line option "-mabi=32"



I did some search on google,but on most of links "-mabi=32" option was
being used with cross-compiler for mips.
Would you please tell me what is causing the problem.




On 6/17/06, James E Wilson <wilson@specifix.com> wrote:
> On Fri, 2006-06-16 at 05:22, kernel coder wrote:
> > /home/shahzad/install//mipsel/sys-include -DHAVE_CONFIG_H -I.
> > -I../../../gcc-4.1.0/libssp -I. -Wall -O2 -g -O2 -MT ssp.lo -MD -MP
> > -MF .deps/ssp.Tpo -c ../../../gcc-4.1.0/libssp/ssp.c -o ssp.o
> > ../../../gcc-4.1.0/libssp/ssp.c:46:20: error: fcntl.h: No such file or directory
>
> You can't build target libraries like libssp in a --without-headers
> build.  It was luck that this happened to work with earlier gcc
> releases, because previously we didn't have C language target libraries
> in gcc.  The solution is to do
>   make all-gcc
>   make install-gcc
> instead of just
>   make all
>   make install
>
> Please see Dan Kegel's crosstools package, which already knows how to do
> this.
> --
> Jim Wilson, GNU Tools Support, http://www.specifix.com
>
>

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

* Re: gcc-4.1.0 cross-compile for MIPS
  2006-06-19  6:40   ` kernel coder
@ 2006-06-19  7:19     ` Matej Kupljen
  2006-06-23 19:01     ` James E Wilson
  1 sibling, 0 replies; 8+ messages in thread
From: Matej Kupljen @ 2006-06-19  7:19 UTC (permalink / raw)
  To: kernel coder; +Cc: James E Wilson, linux-mips

Hi,

See this thread:
http://sourceware.org/ml/crossgcc/2005-07/msg00030.html

BR,,
Matej


> yes you were right.When i did
> make all-gcc
> 
> It just compiled smoothly.
> 
> Now to compile glibc-2.3.6 ,I issued following sequence of commands
> 
> ../glibc-2.3.6/configure --host=mipsel-linux --prefix="/usr"
> --enable-add-ons --with-headers=/home/shahzad/install/mipsel/include
> 
>  make cross-compiling=yes
> install_root=/home/shahzad/install/mipsel/include  prefix=""
> install-headers
> 
> But following error was generated
> 
> make[1]: Entering directory `/home/shahzad/glibc-2.3.6' { echo
> '#include "posix/bits/posix1_lim.h"';            \   echo '#define
> _LIBC 1';                                       \   echo '#include
> "misc/sys/uio.h"'; } |                 \ gcc -mabi=32 -E -dM -MD -MP
> -MF /home/shahzad/build-glibc-headers/bits/stdio_lim.dT -MT
> '/home/shahzad/build-glibc-headers/bits/stdio_lim.h
> /home/shahzad/build-glibc-headers/bits/stdio_lim.d'      \
>       -Iinclude -I. -I/home/shahzad/build-glibc-headers  -Ilibio
> -Inptl -I/home/shahzad/build-glibc-headers -Isysdeps/mips/elf
> -Inptl/sysdeps/unix/sysv/linux -Inptl/sysdeps/pthread
> -Isysdeps/pthread -Inptl/sysdeps/unix/sysv -Inptl/sysdeps/unix
> -Isysdeps/unix/sysv/linux/mips/mips32 -Isysdeps/unix/sysv/linux/mips
> -Isysdeps/unix/sysv/linux -Isysdeps/gnu -Isysdeps/unix/common
> -Isysdeps/unix/mman -Isysdeps/unix/inet -Isysdeps/unix/sysv
> -Isysdeps/unix/mips/mips32 -Isysdeps/unix/mips -Isysdeps/unix
> -Isysdeps/posix -Isysdeps/mips/mips32 -Isysdeps/mips
> -Isysdeps/ieee754/flt-32 -Isysdeps/ieee754/dbl-64
> -Isysdeps/wordsize-32 -Isysdeps/mips/fpu -Isysdeps/ieee754
> -Isysdeps/generic/elf -Isysdeps/generic -nostdinc -isystem
> /usr/lib/gcc/i386-redhat-linux/4.1.0/include -isystem
> /home/shahzad/install/mipsel/include -xc - -o
> /home/shahzad/build-glibc-headers/bits/stdio_lim.hT
> cc1: error: unrecognized command line option "-mabi=32"
> 
> 
> 
> I did some search on google,but on most of links "-mabi=32" option was
> being used with cross-compiler for mips.
> Would you please tell me what is causing the problem.
> 
> 
> 
> 
> On 6/17/06, James E Wilson <wilson@specifix.com> wrote:
> > On Fri, 2006-06-16 at 05:22, kernel coder wrote:
> > > /home/shahzad/install//mipsel/sys-include -DHAVE_CONFIG_H -I.
> > > -I../../../gcc-4.1.0/libssp -I. -Wall -O2 -g -O2 -MT ssp.lo -MD -MP
> > > -MF .deps/ssp.Tpo -c ../../../gcc-4.1.0/libssp/ssp.c -o ssp.o
> > > ../../../gcc-4.1.0/libssp/ssp.c:46:20: error: fcntl.h: No such file or directory
> >
> > You can't build target libraries like libssp in a --without-headers
> > build.  It was luck that this happened to work with earlier gcc
> > releases, because previously we didn't have C language target libraries
> > in gcc.  The solution is to do
> >   make all-gcc
> >   make install-gcc
> > instead of just
> >   make all
> >   make install
> >
> > Please see Dan Kegel's crosstools package, which already knows how to do
> > this.
> > --
> > Jim Wilson, GNU Tools Support, http://www.specifix.com
> >
> >
> 

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

* Re: gcc-4.1.0 cross-compile for MIPS
  2006-06-19  6:40   ` kernel coder
  2006-06-19  7:19     ` Matej Kupljen
@ 2006-06-23 19:01     ` James E Wilson
  1 sibling, 0 replies; 8+ messages in thread
From: James E Wilson @ 2006-06-23 19:01 UTC (permalink / raw)
  To: kernel coder; +Cc: linux-mips

On Sun, 2006-06-18 at 23:40, kernel coder wrote:
> ../glibc-2.3.6/configure --host=mipsel-linux --prefix="/usr"
> --enable-add-ons --with-headers=/home/shahzad/install/mipsel/include
> "misc/sys/uio.h"'; } |                 \ gcc -mabi=32 -E -dM -MD -MP
> cc1: error: unrecognized command line option "-mabi=32"

It failed, because it tries to give mips compiler options to the native
(x86?) compiler, which obviously won't work.  And you got this failure
because you configured glibc wrong.

As always, the answer to this problem can be found in Dan Kegel's
crosstools package, which knows how to correctly configure glibc.  Since
you apparently haven't taken my previous hints, instead of giving you
the answer, I'm just going to point you at the crosstools package, and
ask you to look it up yourself.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com

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

end of thread, other threads:[~2006-06-23 19:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-16 12:22 gcc-4.1.0 cross-compile for MIPS kernel coder
2006-06-16 12:38 ` Ralf Roesch
2006-06-16 14:22   ` kernel coder
2006-06-16 15:41 ` Jonathan Day
2006-06-16 22:33 ` James E Wilson
2006-06-19  6:40   ` kernel coder
2006-06-19  7:19     ` Matej Kupljen
2006-06-23 19:01     ` James E Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox