public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Building a cross compiler
@ 1998-04-26 18:12 The Red Fox
  1998-04-27  0:33 ` ralf
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: The Red Fox @ 1998-04-26 18:12 UTC (permalink / raw)
  To: egcs

Hi,

I'm trying to build a cross compiler on a host i586-pc-linux-gnu for
target i586-pc-linux-gnulibc1 using egcs-1.0.2.

The configure command was this:

configure --host=i586-pc-linux-gnu --target=i586-pc-linux-gnulibc1
--enable-shared --with-headers=/usr/i486-linux-libc5/include
--with-libs=/usr/i486-linux-libc5/lib

I then started the build with "make cross". Everything went fine until the
following error was encountered toward the end of building the compiler:

mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a;
false)
mv: libgcc1.a: No such file or directory
You must find a way to make libgcc1.a
make[1]: *** [libgcc1.cross] Error 1
make[1]: Leaving directory `/home/usr_src/egcs-1.0.2/build/gcc'
make: *** [cross] Error 2

The big question is, how do I find a way to make libgcc1.a?

Thanks,
Ben

+---------------------------------------------------------+
|\\ + //   Ben Ross                                \\ ^ //|
| \- -/    ben@proximity.com.au                     \` '/ |
|  \|/     http://www.proximity.com.au/~ben/         \~/  |
+---+-------------------------------------------------+---+


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

* Re: Building a cross compiler
  1998-04-26 18:12 Building a cross compiler The Red Fox
@ 1998-04-27  0:33 ` ralf
  1998-04-27 11:10   ` H.J. Lu
  1998-04-28 19:49 ` Jim Wilson
  1998-05-04 21:55 ` Jeffrey A Law
  2 siblings, 1 reply; 12+ messages in thread
From: ralf @ 1998-04-27  0:33 UTC (permalink / raw)
  To: The Red Fox; +Cc: egcs

On Mon, Apr 27, 1998 at 11:11:37AM +1000, The Red Fox wrote:

> mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a;
> false)
> mv: libgcc1.a: No such file or directory
> You must find a way to make libgcc1.a
> make[1]: *** [libgcc1.cross] Error 1
> make[1]: Leaving directory `/home/usr_src/egcs-1.0.2/build/gcc'
> make: *** [cross] Error 2
> 
> The big question is, how do I find a way to make libgcc1.a?

In general writing libgcc1.a in assembler or just taking it from an
existing native gcc compile are the two options.

  Ralf

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

* Re: Building a cross compiler
  1998-04-27 11:10   ` H.J. Lu
@ 1998-04-27 11:10     ` ralf
  1998-04-27 11:10       ` H.J. Lu
  1998-04-28 19:49       ` Todd Vierling
  1998-04-27 14:44     ` Ian Lance Taylor
  1 sibling, 2 replies; 12+ messages in thread
From: ralf @ 1998-04-27 11:10 UTC (permalink / raw)
  To: H.J. Lu; +Cc: ben, egcs

On Mon, Apr 27, 1998 at 09:50:13AM -0700, H.J. Lu wrote:

> > > The big question is, how do I find a way to make libgcc1.a?
> > 
> > In general writing libgcc1.a in assembler or just taking it from an
> > existing native gcc compile are the two options.
> 
> The third one is if libgcc1 is written in asm in egcs or it can be
> compiled by egcs, you can set OLD_CC to "./xgcc -B./" and compile it
> by hand:
> 
> # cd egcs/gcc
> # make libgcc1.a OLD_CC="./xgcc -B./"

If I remember right the gcc docs somewhere say that's not going to work
because the routines in libgcc1.a would be compiled into endless recursive
code.  Since it seems to be working for you, are the docs wrong?

> I have done that for Linux/x86. Maybe we should add something to
> egcs to do it automatically. It should be easy.

What functions from libgcc1.a are being used on Intel?  Could they somehow
be eleminated?  Life is so much sweeter without having to deal with
libgcc1.a.

  Ralf

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

* Re: Building a cross compiler
  1998-04-27  0:33 ` ralf
@ 1998-04-27 11:10   ` H.J. Lu
  1998-04-27 11:10     ` ralf
  1998-04-27 14:44     ` Ian Lance Taylor
  0 siblings, 2 replies; 12+ messages in thread
From: H.J. Lu @ 1998-04-27 11:10 UTC (permalink / raw)
  To: ralf; +Cc: ben, egcs

> 
> On Mon, Apr 27, 1998 at 11:11:37AM +1000, The Red Fox wrote:
> 
> > mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a;
> > false)
> > mv: libgcc1.a: No such file or directory
> > You must find a way to make libgcc1.a
> > make[1]: *** [libgcc1.cross] Error 1
> > make[1]: Leaving directory `/home/usr_src/egcs-1.0.2/build/gcc'
> > make: *** [cross] Error 2
> > 
> > The big question is, how do I find a way to make libgcc1.a?
> 
> In general writing libgcc1.a in assembler or just taking it from an
> existing native gcc compile are the two options.
> 

The third one is if libgcc1 is written in asm in egcs or it can be
compiled by egcs, you can set OLD_CC to "./xgcc -B./" and compile it
by hand:

# cd egcs/gcc
# make libgcc1.a OLD_CC="./xgcc -B./"

I have done that for Linux/x86. Maybe we should add something to
egcs to do it automatically. It should be easy.

-- 
H.J. Lu (hjl@gnu.org)

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

* Re: Building a cross compiler
  1998-04-27 11:10     ` ralf
@ 1998-04-27 11:10       ` H.J. Lu
  1998-04-28 19:49       ` Todd Vierling
  1 sibling, 0 replies; 12+ messages in thread
From: H.J. Lu @ 1998-04-27 11:10 UTC (permalink / raw)
  To: ralf; +Cc: ben, egcs

> If I remember right the gcc docs somewhere say that's not going to work
> because the routines in libgcc1.a would be compiled into endless recursive

That is not true on x86 since gcc 2.0.

> code.  Since it seems to be working for you, are the docs wrong?
> 
> > I have done that for Linux/x86. Maybe we should add something to
> > egcs to do it automatically. It should be easy.
> 
> What functions from libgcc1.a are being used on Intel?  Could they somehow

As far as I know, there is none on Intel since gcc 2.0. But I could
be wrong.

> be eleminated?  Life is so much sweeter without having to deal with
> libgcc1.a.

Some old codes may have calls to those functions in libgcc1.a.

-- 
H.J. Lu (hjl@gnu.org)

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

* Re: Building a cross compiler
  1998-04-27 11:10   ` H.J. Lu
  1998-04-27 11:10     ` ralf
@ 1998-04-27 14:44     ` Ian Lance Taylor
  1 sibling, 0 replies; 12+ messages in thread
From: Ian Lance Taylor @ 1998-04-27 14:44 UTC (permalink / raw)
  To: hjl; +Cc: ralf, ben, egcs

   From: hjl@lucon.org (H.J. Lu)
   Date: Mon, 27 Apr 1998 09:50:13 -0700 (PDT)

   > In general writing libgcc1.a in assembler or just taking it from an
   > existing native gcc compile are the two options.

   The third one is if libgcc1 is written in asm in egcs or it can be
   compiled by egcs, you can set OLD_CC to "./xgcc -B./" and compile it
   by hand:

   # cd egcs/gcc
   # make libgcc1.a OLD_CC="./xgcc -B./"

   I have done that for Linux/x86. Maybe we should add something to
   egcs to do it automatically. It should be easy.

We already have such mechanisms.

If you have an assembler version of the file in egcs, set
CROSS_LIBGCC1 to libgcc1-asm.a, and set LIB1ASMSRC and LIB1ASMFUNCS in
your t-* file.  For example, see m68k/t-m68kbare, which uses
m68k/lib1sf68.asm.

If the file can be built with egcs, then it isn't necessary at all.
In such a case, set CROSS_LIBGCC1 to the empty string, as in
mips/t-mips.

Ian

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

* Re: Building a cross compiler
  1998-04-27 11:10     ` ralf
  1998-04-27 11:10       ` H.J. Lu
@ 1998-04-28 19:49       ` Todd Vierling
  1 sibling, 0 replies; 12+ messages in thread
From: Todd Vierling @ 1998-04-28 19:49 UTC (permalink / raw)
  To: ralf; +Cc: H.J. Lu, ben, egcs

On Mon, 27 Apr 1998 ralf@uni-koblenz.de wrote:

: > I have done that for Linux/x86. Maybe we should add something to
: > egcs to do it automatically. It should be easy.
: 
: What functions from libgcc1.a are being used on Intel?  Could they somehow
: be eleminated?  Life is so much sweeter without having to deal with
: libgcc1.a.

None.  No Linux or *BSD based i386 system requires libgcc1.a at all.  The
instructions are all handled internally.  Unfortunately, there's no
``t-linux'' in config/i386 to override LIBGCC1 and CROSS_LIBGCC1 with
"libgcc1.null".

I've brought this up on this list before.  Perhaps I should search archives?

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)


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

* Re: Building a cross compiler
  1998-04-26 18:12 Building a cross compiler The Red Fox
  1998-04-27  0:33 ` ralf
@ 1998-04-28 19:49 ` Jim Wilson
  1998-04-29  8:38   ` Joe Buck
  1998-05-04 21:55 ` Jeffrey A Law
  2 siblings, 1 reply; 12+ messages in thread
From: Jim Wilson @ 1998-04-28 19:49 UTC (permalink / raw)
  To: The Red Fox; +Cc: egcs, hjl

	mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a;
	false)
	mv: libgcc1.a: No such file or directory
	You must find a way to make libgcc1.a

The problem here is that the i386 ports use the perform_* macros to implement
libgcc1.a.  These perform_* macros are defined to be asms, and hence one
can compile libgcc1.c with gcc without generating recursive code.

Unfortunately, there is no way for the toplevel Makefile to know whether any
particular port has defined the necessary perform_* macros to make this work.

For a native (linux/freebsd/etc), one just compiles libgcc1.c with `cc', which
is gcc, and it just works.

For a cross, we have a problem, because we know we can't use `cc', and we
don't know if we can use `./xgcc -B./' (because we don't know if the
perform_* macros are defined), so the build fails with an error.

I think this should be fixed by rewriting the x86 port to implement libgcc1
as an assembler file instead of the perform_* macros, and then we should
eliminate the perform_* macros so that no one else will be tempted to use
them.  This is how all other ports work nowadays.

Jim

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

* Re: Building a cross compiler
  1998-04-28 19:49 ` Jim Wilson
@ 1998-04-29  8:38   ` Joe Buck
  1998-04-29 14:48     ` Jim Wilson
  0 siblings, 1 reply; 12+ messages in thread
From: Joe Buck @ 1998-04-29  8:38 UTC (permalink / raw)
  To: Jim Wilson; +Cc: ben, egcs, hjl

> I think this should be fixed by rewriting the x86 port to implement libgcc1
> as an assembler file instead of the perform_* macros, and then we should
> eliminate the perform_* macros so that no one else will be tempted to use
> them.  This is how all other ports work nowadays.

Perhaps I'm missing something, but wouldn't that mean that the
assembler functions would no longer be inline?



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

* Re: Building a cross compiler
  1998-04-29  8:38   ` Joe Buck
@ 1998-04-29 14:48     ` Jim Wilson
  0 siblings, 0 replies; 12+ messages in thread
From: Jim Wilson @ 1998-04-29 14:48 UTC (permalink / raw)
  To: Joe Buck; +Cc: ben, egcs, hjl

	> I think this should be fixed by rewriting the x86 port to implement libgcc1
	> as an assembler file instead of the perform_* macros, and then we should
	> eliminate the perform_* macros so that no one else will be tempted to use
	> them.  This is how all other ports work nowadays.

	Perhaps I'm missing something, but wouldn't that mean that the
	assembler functions would no longer be inline?

What I am suggesting here is that we use assembly routines instead
of asms to implement libgcc1.  This only affects compilation of libgcc1.a.
It does not affect any user programs, as libgcc1 source code is never used for
anything but libgcc1.a.

libgcc1 routines can be expanded inline, but this is done by either by machine
independent code in the middle-end, or machine dependent patterns in the md
file.  The libgcc1 source code has nothing to do with this.

Jim

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

* Re: Building a cross compiler
  1998-04-26 18:12 Building a cross compiler The Red Fox
  1998-04-27  0:33 ` ralf
  1998-04-28 19:49 ` Jim Wilson
@ 1998-05-04 21:55 ` Jeffrey A Law
  1998-05-05 23:29   ` The Red Fox
  2 siblings, 1 reply; 12+ messages in thread
From: Jeffrey A Law @ 1998-05-04 21:55 UTC (permalink / raw)
  To: The Red Fox; +Cc: egcs

  In message <Pine.LNX.3.95.980427105937.10504A-100000@mantis.proximity.com.au>you write:
  > mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a;
  > false)
  > mv: libgcc1.a: No such file or directory
  > You must find a way to make libgcc1.a
  > make[1]: *** [libgcc1.cross] Error 1
  > make[1]: Leaving directory `/home/usr_src/egcs-1.0.2/build/gcc'
  > make: *** [cross] Error 2
  > 
  > The big question is, how do I find a way to make libgcc1.a?
I believe this has already been fixed in the development branch.

For an i586-pc-linux-gnulibc1 target I don't think you need
libgcc1.a, so removing the code which tries to build and check
for libgcc1.a should be an OK workaround.

jeff

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

* Re: Building a cross compiler
  1998-05-04 21:55 ` Jeffrey A Law
@ 1998-05-05 23:29   ` The Red Fox
  0 siblings, 0 replies; 12+ messages in thread
From: The Red Fox @ 1998-05-05 23:29 UTC (permalink / raw)
  To: Jeffrey A Law; +Cc: egcs

>   > The big question is, how do I find a way to make libgcc1.a?
>
> I believe this has already been fixed in the development branch.
> 
> For an i586-pc-linux-gnulibc1 target I don't think you need
> libgcc1.a, so removing the code which tries to build and check
> for libgcc1.a should be an OK workaround.
> 

That seemed to work fine! Thanks! I modified the Makefile to build a 
libgcc.a without incorporating libgcc1.a.

One little nasty was when I installed the cross compiler with

make install LANGUAGES="c c++"

the files /usr/local/bin/c++ and /usr/local/bin/g++ (from the native
egcs compiler) were mysteriously removed. I am using egcs 1.0.2.

Many Thanks,
Ben


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

end of thread, other threads:[~1998-05-05 23:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-26 18:12 Building a cross compiler The Red Fox
1998-04-27  0:33 ` ralf
1998-04-27 11:10   ` H.J. Lu
1998-04-27 11:10     ` ralf
1998-04-27 11:10       ` H.J. Lu
1998-04-28 19:49       ` Todd Vierling
1998-04-27 14:44     ` Ian Lance Taylor
1998-04-28 19:49 ` Jim Wilson
1998-04-29  8:38   ` Joe Buck
1998-04-29 14:48     ` Jim Wilson
1998-05-04 21:55 ` Jeffrey A Law
1998-05-05 23:29   ` The Red Fox

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