Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* Q: Is it possible to compile binaries for a different processor?
@ 1999-04-15  4:00 Chris Gahan
  1999-04-15  4:00 ` Serguei Patchkovskii
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Chris Gahan @ 1999-04-15  4:00 UTC (permalink / raw)


I was wondering if it is indeed possible to compile x86 binaries, for
example, on an Alpha.  I thought about this, and it definitely seems
possible.  I figure that if you get the x86 version of GCC, and
compile it on an Alpha, it would spit out x86 binaries.  Am I way off
with this, or is this something that I can do right now?  :)



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

* Re: Q: Is it possible to compile binaries for a different processor?
  1999-04-15  4:00 Q: Is it possible to compile binaries for a different processor? Chris Gahan
  1999-04-15  4:00 ` Serguei Patchkovskii
@ 1999-04-15  4:00 ` Timo Biesenbach
  1999-04-15  4:00 ` Jaap Schellekens
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Timo Biesenbach @ 1999-04-15  4:00 UTC (permalink / raw)


It is possible. GCC is able to do cross-compiling for other
target architectures. Consult the gcc manuals for further
information.

Chris Gahan wrote:
> 
> I was wondering if it is indeed possible to compile x86 binaries, for
> example, on an Alpha.  I thought about this, and it definitely seems
> possible.  I figure that if you get the x86 version of GCC, and
> compile it on an Alpha, it would spit out x86 binaries.  Am I way off
> with this, or is this something that I can do right now?  :)

-- 
+---+---+-+-+-+-+
|   |   |-+-+-+-+ Fraunhofer-Institut fuer Graphische Datenverarbeitung
+---+---+-+-+-+-+ Fraunhofer-Institute for Computer Graphics
|   |   |-+-+-+-+ 
+---+---+-+-+-+-+ Abteilung / Department : Document Imaging 
|      __   _   |
|  !  ! _  ! \  | Timo Biesenbach
|  !  !__! !_/  | Rundeturmstr. 6      phone  ++49 6151 155 578
|               | 64283 Darmstadt      fax    ++49 6151 155 299 
+---------------+ Germany              email  timo.biesenbach@igd.fhg.de



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

* Re: Q: Is it possible to compile binaries for a different processor?
  1999-04-15  4:00 Q: Is it possible to compile binaries for a different processor? Chris Gahan
  1999-04-15  4:00 ` Serguei Patchkovskii
  1999-04-15  4:00 ` Timo Biesenbach
@ 1999-04-15  4:00 ` Jaap Schellekens
  1999-04-16  4:00 ` Craig Graham
  1999-04-16  4:00 ` Michal Jaegermann
  4 siblings, 0 replies; 7+ messages in thread
From: Jaap Schellekens @ 1999-04-15  4:00 UTC (permalink / raw)


In article <37168eea.69605890@news.yec1.on.wave.home.com>, Chris Gahan wrote:
>I was wondering if it is indeed possible to compile x86 binaries, for
>example, on an Alpha.  I thought about this, and it definitely seems
>possible.  I figure that if you get the x86 version of GCC, and
>compile it on an Alpha, it would spit out x86 binaries.  Am I way off
>with this, or is this something that I can do right now?  :)

It should work but it is a lot of work. If you have em86 installed and you are
patient (it is slow) you can simply run the x86 version of gcc in stead of
building a cross compiler. 

Cheers -- Jaap



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

* Re: Q: Is it possible to compile binaries for a different processor?
  1999-04-15  4:00 Q: Is it possible to compile binaries for a different processor? Chris Gahan
@ 1999-04-15  4:00 ` Serguei Patchkovskii
  1999-04-15  4:00 ` Timo Biesenbach
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Serguei Patchkovskii @ 1999-04-15  4:00 UTC (permalink / raw)


Chris Gahan (cgahan@geocities.com) wrote:
: I was wondering if it is indeed possible to compile x86 binaries, for
: example, on an Alpha.  I thought about this, and it definitely seems
: possible.  I figure that if you get the x86 version of GCC, and
: compile it on an Alpha, it would spit out x86 binaries.  Am I way off
: with this, or is this something that I can do right now?  :)

I used to build extended DOS x86 binaries with gcc on SGI Irix. Worked
like a charm, and was quite easy to set up. I see no reason why this
wouldn't work on Linux/Alpha. The only reasonably tricky bit is to get
the compiler support libraries and crt0.o for your target platform - 
which you can do by cannibalizing a native gcc binary distribution for
the x86 OS flavour you want to target.

Regards,

/Serge.P



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

* Re: Q: Is it possible to compile binaries for a different processor?
  1999-04-15  4:00 Q: Is it possible to compile binaries for a different processor? Chris Gahan
                   ` (3 preceding siblings ...)
  1999-04-16  4:00 ` Craig Graham
@ 1999-04-16  4:00 ` Michal Jaegermann
  1999-05-15  4:00   ` Bounce
  4 siblings, 1 reply; 7+ messages in thread
From: Michal Jaegermann @ 1999-04-16  4:00 UTC (permalink / raw)


Chris Gahan (cgahan@geocities.com) wrote:
: I was wondering if it is indeed possible to compile x86 binaries, for
: example, on an Alpha.  

This should be quite easy. gcc had a cross-compilation support for
"always" and I still have around a gcc cross-compiler for producing
Atari ST code. :-) The biggest drag is a set of tools (like 'nm' or 'ar'
and linker) which run on the host computer but operate on binaries of
an intended target and, of course, a set of your target libraries to
link with.

Going the other direction (to cross-compile on x86 for Alpha) seems
to be impossible, or at least very hard, as cross-compiler performs
various arithmetic operations in a target arithmetic and gcc currently
assumes that it can fit them in a host registers.  Registers on
Alpha are twice a width of those on Intel.

Now the good question would be why anybody would really want to set such
cross-compiler?  Intel boxes are all over the place, quite a few of them
rather fast, and creating the whole cross-compilation environment (not
only a cross-compiler itself) is maybe not hard, with all this support
which is already in place, but rather tedious project.

  Michal



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

* Re: Q: Is it possible to compile binaries for a different processor?
  1999-04-15  4:00 Q: Is it possible to compile binaries for a different processor? Chris Gahan
                   ` (2 preceding siblings ...)
  1999-04-15  4:00 ` Jaap Schellekens
@ 1999-04-16  4:00 ` Craig Graham
  1999-04-16  4:00 ` Michal Jaegermann
  4 siblings, 0 replies; 7+ messages in thread
From: Craig Graham @ 1999-04-16  4:00 UTC (permalink / raw)


Chris Gahan wrote:
> 
> I was wondering if it is indeed possible to compile x86 binaries, for
> example, on an Alpha.  I thought about this, and it definitely seems
> possible.  I figure that if you get the x86 version of GCC, and
> compile it on an Alpha, it would spit out x86 binaries.  Am I way off
> with this, or is this something that I can do right now?  :)

Yeah - I used to compile Playstation (MIPSr3000) binaries with GCC
on DOS and Linux - it's pretty easy to build a cross compiler, just
get the full GCC & binutils source, and configure with the target and
host set to whatever you need.

Craig.



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

* Re: Q: Is it possible to compile binaries for a different processor?
  1999-04-16  4:00 ` Michal Jaegermann
@ 1999-05-15  4:00   ` Bounce
  0 siblings, 0 replies; 7+ messages in thread
From: Bounce @ 1999-05-15  4:00 UTC (permalink / raw)


On 16 Apr 1999 02:50:58 GMT, Michal Jaegermann <michal@gortel.phys.ualberta.ca> wrote:
>Going the other direction (to cross-compile on x86 for Alpha) seems
>to be impossible, or at least very hard, as cross-compiler performs
>various arithmetic operations in a target arithmetic and gcc currently
>assumes that it can fit them in a host registers.  Registers on
>Alpha are twice a width of those on Intel.

You know, actually, I *was* able to perform a preliminary port of GNAT
(an Ada 95 compiler melded with gcc 2.8.1) to the alpha by
cross-compiling from x86/linux (since an alpha/linux version didn't
exist).  So now I can compile Ada code on the alpha, provided I don't
use any of the tasking abilities (they haven't been ported yet ...).

So my experience is that it *is* possible to cross compile from an x86
to the alpha (well, at least from a pentium), and not only that, it's
possible to cross-compile a port of gcc as well!  I'm not sure if
floating point stuff will cross-compile, but basic integer stuff seems
to work fine.

-Albert
 computer is interport.net, user is aklee.



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

end of thread, other threads:[~1999-05-15  4:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-04-15  4:00 Q: Is it possible to compile binaries for a different processor? Chris Gahan
1999-04-15  4:00 ` Serguei Patchkovskii
1999-04-15  4:00 ` Timo Biesenbach
1999-04-15  4:00 ` Jaap Schellekens
1999-04-16  4:00 ` Craig Graham
1999-04-16  4:00 ` Michal Jaegermann
1999-05-15  4:00   ` Bounce

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