public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: problems compiling 2.95.3
@ 2001-04-27  4:30 David Korn
  0 siblings, 0 replies; 9+ messages in thread
From: David Korn @ 2001-04-27  4:30 UTC (permalink / raw)
  To: 'Nick Papadonis', Alexandre Oliva; +Cc: gcc-help

>-----Original Message-----
>From: Nick Papadonis [ mailto:npapadon@yahoo.com ]
>Sent: 26 April 2001 03:33


>Ok.  I copied the newlib headers to $(gcc_src_prefix)/include.
>Everything starts compiling (because things point to the right
>headers) then I get another error.  I think it's because
>there should be an -I argument with this directory passed.  Is this a
>build problem.

  Don't do it like that.  Copying those include files into the gcc
source has confused the build process.  You said in an earlier mail that
you'd been making hacks to the search paths, and you probably don't want
to do that either.

  Instead, you want to have the gcc-2.95.3 and the newlib-1.9.0 top level
source code directories side-by side in a dir somewhere.  I'd start again
with fresh unpacks of the tar file if I were you.  I generally put my
build dirs in the same tree as well, but they could be anywhere.

.../src/
     |
     +- gcc-2.95.3/
     +- newlib-1.9.0/
     +- gcc-build/
     +- newlib-build/

then cd into gcc-2.95.3 and create a couple of soft links

    cd .../src/gcc-2.95.3
    ln -s ../newlib-1.9.0/newlib newlib
    ln -s ../newlib-1.9.0/libgloss libgloss

  Now you have to make and install gcc in two passes.  This solves the
missing crt0.o problem.  The problem is that before you can build fully
executable programs with the cross compiler, you have to have a working
C library, which is where crt0.o comes from.  But before you can build
the C library, you have to have a working compiler!  Fortunately, that's
not quite true: you can make a half-working compiler, with no libs, that
is good enough for compiling the C lib.  The only thing is, this half-
built compiler *isn't* good enough for building libstdc++, and that's
why your build was going wrong previously:  at the point where it wants
to start building libstdc++, it needs to have a fully working compiler.

  OK, so how do we make this half-working compiler ?   Simple enough:
we just tell the compiler to build a C-only compiler.  That's it!  So
the procedure overall looks something like

 - unpack source code
 - configure, build and install the cross binutils
     (you've probably got this far OK)
 - make soft links in gcc top level source dir
 - change into gcc-build dir
 - configure gcc with option --enable-languages=c (as well as any others
     you've been using)
 - give the command "make LANGUAGES=c all install"
 - cd into newlib build dir
 - configure, build and install newlib
 - cd back to gcc-build dir
 - reconfigure gcc, this time without the --enable-languages option (but
     still with all your other options)
 - finish off by giving the command "make all install"

       DaveK
-- 
 All your base are belong to the Israeli army!  Oh, now they aren't again!


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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

* RE: problems compiling 2.95.3
@ 2001-04-30  2:25 Antoine PERNIN
  0 siblings, 0 replies; 9+ messages in thread
From: Antoine PERNIN @ 2001-04-30  2:25 UTC (permalink / raw)
  To: gcc-help

Thanks David for this information,

i understand the process you explain here, and it sounds interesting cause i 
also have problems with crt0.o...

but what i would like to know now is :
How do i configure and make newlib?
I mean what is the target i should use?
I need to build crossdevelopment tools (binutils, gcc, insight) for an arm 
platform. so i used --target=arm-elf
but configure says that this type of configuration is not supported in the 
following directories : target-libgloss

Thanks for any explanation (i've been searching on the net for that, but i 
couldn't find it)

PS : just an idea : wouldn't it be usefull to create a page where we could 
find how to build the required crossdev tools? (i mean at least for the most 
used platform such as arm ones...)


>From: David Korn <dkorn@pixelpower.com>
>To: 'Nick Papadonis' <npapadon@yahoo.com>, Alexandre Oliva  
><aoliva@redhat.com>
>CC: gcc-help@gcc.gnu.org
>Subject: RE: problems compiling 2.95.3
>Date: Fri, 27 Apr 2001 12:32:45 +0100
>
> >-----Original Message-----
> >From: Nick Papadonis [ mailto:npapadon@yahoo.com ]
> >Sent: 26 April 2001 03:33
>
>
> >Ok.  I copied the newlib headers to $(gcc_src_prefix)/include.
> >Everything starts compiling (because things point to the right
> >headers) then I get another error.  I think it's because
> >there should be an -I argument with this directory passed.  Is this a
> >build problem.
>
>   Don't do it like that.  Copying those include files into the gcc
>source has confused the build process.  You said in an earlier mail that
>you'd been making hacks to the search paths, and you probably don't want
>to do that either.
>
>   Instead, you want to have the gcc-2.95.3 and the newlib-1.9.0 top level
>source code directories side-by side in a dir somewhere.  I'd start again
>with fresh unpacks of the tar file if I were you.  I generally put my
>build dirs in the same tree as well, but they could be anywhere.
>
>.../src/
>      |
>      +- gcc-2.95.3/
>      +- newlib-1.9.0/
>      +- gcc-build/
>      +- newlib-build/
>
>then cd into gcc-2.95.3 and create a couple of soft links
>
>     cd .../src/gcc-2.95.3
>     ln -s ../newlib-1.9.0/newlib newlib
>     ln -s ../newlib-1.9.0/libgloss libgloss
>
>   Now you have to make and install gcc in two passes.  This solves the
>missing crt0.o problem.  The problem is that before you can build fully
>executable programs with the cross compiler, you have to have a working
>C library, which is where crt0.o comes from.  But before you can build
>the C library, you have to have a working compiler!  Fortunately, that's
>not quite true: you can make a half-working compiler, with no libs, that
>is good enough for compiling the C lib.  The only thing is, this half-
>built compiler *isn't* good enough for building libstdc++, and that's
>why your build was going wrong previously:  at the point where it wants
>to start building libstdc++, it needs to have a fully working compiler.
>
>   OK, so how do we make this half-working compiler ?   Simple enough:
>we just tell the compiler to build a C-only compiler.  That's it!  So
>the procedure overall looks something like
>
>  - unpack source code
>  - configure, build and install the cross binutils
>      (you've probably got this far OK)
>  - make soft links in gcc top level source dir
>  - change into gcc-build dir
>  - configure gcc with option --enable-languages=c (as well as any others
>      you've been using)
>  - give the command "make LANGUAGES=c all install"
>  - cd into newlib build dir
>  - configure, build and install newlib
>  - cd back to gcc-build dir
>  - reconfigure gcc, this time without the --enable-languages option (but
>      still with all your other options)
>  - finish off by giving the command "make all install"
>
>        DaveK
>--

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com .

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

* Re: problems compiling 2.95.3
  2001-04-25 13:59     ` Alexandre Oliva
@ 2001-04-26  7:16       ` Nick Papadonis
  0 siblings, 0 replies; 9+ messages in thread
From: Nick Papadonis @ 2001-04-26  7:16 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-help

Alexandre Oliva <aoliva@redhat.com> writes:

> On Apr 25, 2001, Nick Papadonis <npapadon@yahoo.com> wrote:
> 
> > Why should I need newlib?
> 

Ok.  I copied the newlib headers to $(gcc_src_prefix)/include.
Everything starts compiling (because things point to the right
headers) then I get another error.  I think it's because
there should be an -I argument with this directory passed.  Is this a
build problem.

make[1]: Entering directory `/home/nick/build/gcc-2.95.3-build/m68k-coff/libio'
if [ x"no" = xyes ] && [ ! -d pic ]; then \
  mkdir pic; \
else true; fi
touch stamp-picdir
rootme=`pwd`/ ; export rootme; \
CC="/home/nick/build/gcc-2.95.3-build/gcc/xgcc -B/home/nick/build/gcc-2.95.3-build/gcc/ -B/usr/local/m68k-coff/m68k-coff/bin/ -I. -I../../../gcc-2.95.3/libio"; export CC; \
CXX="/home/nick/build/gcc-2.95.3-build/gcc/xgcc -B/home/nick/build/gcc-2.95.3-build/gcc/ -B/usr/local/m68k-coff/m68k-coff/bin/ -I. -I../../../gcc-2.95.3/libio -nostdinc++ -nostdinc++ -g -O2"; export CXX; \
CONFIG_NM="m68k-coff-nm"; export CONFIG_NM; \
/bin/sh ../../../gcc-2.95.3/libio/gen-params LIB_VERSION=2.8.0  >tmp-params.h
dummy.c:1: sys/types.h: No such file or directory
dummy.c:8: stdio.h: No such file or directory
dummy.c:9: time.h: No such file or directory
dummy.c:10: signal.h: No such file or directory
gen-params: could not invoke /home/nick/build/gcc-2.95.3-build/gcc/xgcc -B/home/nick/build/gcc-2.95.3-build/gcc/ -B/usr/local/m68k-coff/m68k-coff/bin/ -I. -I../../../gcc-2.95.3/libio -E on dummy.c
make[1]: *** [_G_config.h] Error 1
make[1]: Leaving directory `/home/nick/build/gcc-2.95.3-build/m68k-coff/libio'
make: *** [all-target-libio] Error 2



> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist    *Please* write to mailing lists, not to me
> 

-- 
- Nick

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

* Re: problems compiling 2.95.3
  2001-04-26  6:35   ` Nick Papadonis
@ 2001-04-26  6:46     ` Alexandre Oliva
  0 siblings, 0 replies; 9+ messages in thread
From: Alexandre Oliva @ 2001-04-26  6:46 UTC (permalink / raw)
  To: Nick Papadonis; +Cc: gcc-help

On Apr 26, 2001, Nick Papadonis <npapadon@yahoo.com> wrote:

> /usr/local/m68k-coff/m68k-coff/bin/ld: cannot open crt0.o: No such file or direc
> tory

This is also part of newlib.  You should follow the `unified tree'
build procedure.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* Re: problems compiling 2.95.3
  2001-04-25 11:52 ` Alexandre Oliva
  2001-04-25 13:36   ` Nick Papadonis
@ 2001-04-26  6:35   ` Nick Papadonis
  2001-04-26  6:46     ` Alexandre Oliva
  1 sibling, 1 reply; 9+ messages in thread
From: Nick Papadonis @ 2001-04-26  6:35 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-help

Alexandre Oliva <aoliva@redhat.com> writes:

> On Apr 25, 2001, Nick Papadonis <npapadon@yahoo.com> wrote:
> 
> > The problem appears to be in the $(ARCH)/libio directory.  It can't
> > find certain header files.
> 
> You need newlib.
> 


Ok... after a bunch of Makefile.in header search hacks and installing
newlib headers, I have most of
gcc compiling.  

In m68k-coff/libchill I get the following error in config.log:
----
configure:562: checking if compiler cc1chill has been built
configure:593: checking for gcc
configure:706: checking whether the C compiler (/home/nick/build/gcc-2.95.3-buil
d/gcc/xgcc -B/home/nick/build/gcc-2.95.3-build/gcc/ -B/usr/local/m68k-coff/m68k-
coff/bin/ -g -O2 ) works
configure:722: /home/nick/build/gcc-2.95.3-build/gcc/xgcc -B/home/nick/build/gcc
-2.95.3-build/gcc/ -B/usr/local/m68k-coff/m68k-coff/bin/ -o conftest -g -O2   co
nftest.c  1>&5
/usr/local/m68k-coff/m68k-coff/bin/ld: cannot open crt0.o: No such file or direc
tory
collect2: ld returned 1 exit status
configure: failed program was:

#line 717 "configure"
#include "confdefs.h"

main(){return(0);}
----

It appears that I don't have a startup file.  I don't really need
crt0.o and want to include it only when I compile for the target.  Is
there a way to take this out of the generic linker script?  Should I have
installed the 'newlib' source under the gcc-2.x directory tree?  I
just copied the headers into gcc-2.x/include.


Any ideas much appreciated.


-- 
- Nick

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

* Re: problems compiling 2.95.3
  2001-04-25 13:36   ` Nick Papadonis
@ 2001-04-25 13:59     ` Alexandre Oliva
  2001-04-26  7:16       ` Nick Papadonis
  0 siblings, 1 reply; 9+ messages in thread
From: Alexandre Oliva @ 2001-04-25 13:59 UTC (permalink / raw)
  To: Nick Papadonis; +Cc: gcc-help

On Apr 25, 2001, Nick Papadonis <npapadon@yahoo.com> wrote:

> Why should I need newlib?

Where do you expect to get the C headers from?

> How can I use newlib unless I have a kernel for the device?  
> I'm creating a thread manager and don't have a version of the linux
> kernel.

Huh?  Newlib has nothing to do with kernel.  I'm not talking about
glibc.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* Re: problems compiling 2.95.3
  2001-04-25 11:52 ` Alexandre Oliva
@ 2001-04-25 13:36   ` Nick Papadonis
  2001-04-25 13:59     ` Alexandre Oliva
  2001-04-26  6:35   ` Nick Papadonis
  1 sibling, 1 reply; 9+ messages in thread
From: Nick Papadonis @ 2001-04-25 13:36 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-help

Why should I need newlib?  I built gcc target=m68k before without it.

How can I use newlib unless I have a kernel for the device?  I'm
creating a thread manager and don't have a version of the linux
kernel.

Thanks.

- Nick

Alexandre Oliva <aoliva@redhat.com> writes:

> On Apr 25, 2001, Nick Papadonis <npapadon@yahoo.com> wrote:
> 
> > The problem appears to be in the $(ARCH)/libio directory.  It can't
> > find certain header files.
> 
> You need newlib.
> 
> -- 
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist    *Please* write to mailing lists, not to me
> 

-- 
- Nick

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

* Re: problems compiling 2.95.3
  2001-04-25  9:46 Nick Papadonis
@ 2001-04-25 11:52 ` Alexandre Oliva
  2001-04-25 13:36   ` Nick Papadonis
  2001-04-26  6:35   ` Nick Papadonis
  0 siblings, 2 replies; 9+ messages in thread
From: Alexandre Oliva @ 2001-04-25 11:52 UTC (permalink / raw)
  To: Nick Papadonis; +Cc: gcc-help

On Apr 25, 2001, Nick Papadonis <npapadon@yahoo.com> wrote:

> The problem appears to be in the $(ARCH)/libio directory.  It can't
> find certain header files.

You need newlib.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* problems compiling 2.95.3
@ 2001-04-25  9:46 Nick Papadonis
  2001-04-25 11:52 ` Alexandre Oliva
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Papadonis @ 2001-04-25  9:46 UTC (permalink / raw)
  To: gcc-help

Hi.  I am having problems compiling gcc 2.95.3 for the m68k-coff
target.  I'm using RH 7.0, gcc 2.95.3 (yes it compiled for i686).

The problem appears to be in the $(ARCH)/libio directory.  It can't
find certain header files.

Has anyone had this similar problem:

make[1]: Entering directory `/home/nick/build/gcc-2.95.3/m68k-coff/libio'
/bin/sh ./config.status
target-mkfrag is unchanged
Created "Makefile" in /home/nick/build/gcc-2.95.3/m68k-coff/libio using "target-mkfrag"
Adding multilib support to Makefile in .
multidirs=m68000 m5200 mcpu32 msoft-float
with_multisubdir=
./config.status is unchanged
make[1]: Leaving directory `/home/nick/build/gcc-2.95.3/m68k-coff/libio'
make[1]: Entering directory `/home/nick/build/gcc-2.95.3/m68k-coff/libio'
rootme=`pwd`/ ; export rootme; \
CC="/home/nick/build/gcc-2.95.3/gcc/xgcc -B/home/nick/build/gcc-2.95.3/gcc/ -B/usr/local/m68k-coff/m68k-coff/bin/ -I. -I."; export CC; \
CXX="/home/nick/build/gcc-2.95.3/gcc/xgcc -B/home/nick/build/gcc-2.95.3/gcc/ -B/usr/local/m68k-coff/m68k-coff/bin/ -I. -I. -nostdinc++ -g -O2"; export CXX; \
CONFIG_NM="m68k-coff-nm"; export CONFIG_NM; \
/bin/sh ./gen-params LIB_VERSION=2.8.0  >tmp-params.h
dummy.c:1: sys/types.h: No such file or directory
dummy.c:8: stdio.h: No such file or directory
dummy.c:9: time.h: No such file or directory
dummy.c:10: signal.h: No such file or directory
gen-params: could not invoke /home/nick/build/gcc-2.95.3/gcc/xgcc -B/home/nick/build/gcc-2.95.3/gcc/ -B/usr/local/m68k-coff/m68k-coff/bin/ -I. -I. -E on dummy.c
make[1]: *** [_G_config.h] Error 1
make[1]: Leaving directory `/home/nick/build/gcc-2.95.3/m68k-coff/libio'
make: *** [all-target-libio] Error 2



Any insight much appreciated.

-- 
- Nick

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

end of thread, other threads:[~2001-04-30  2:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-27  4:30 problems compiling 2.95.3 David Korn
  -- strict thread matches above, loose matches on Subject: below --
2001-04-30  2:25 Antoine PERNIN
2001-04-25  9:46 Nick Papadonis
2001-04-25 11:52 ` Alexandre Oliva
2001-04-25 13:36   ` Nick Papadonis
2001-04-25 13:59     ` Alexandre Oliva
2001-04-26  7:16       ` Nick Papadonis
2001-04-26  6:35   ` Nick Papadonis
2001-04-26  6:46     ` Alexandre Oliva

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