public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: How to move gcc to compile to my own architecture?
       [not found] <AM5PR0602MB3251080495DE121D2397444DE3489@AM5PR0602MB3251.eurprd06.prod.outlook.com>
@ 2022-09-16 16:27 ` Jonathan Wakely
       [not found]   ` <CAE539w-PfeyeqKuBhTcrS3=tSwydNmtbcvLW7tt0VmUNPAm2bQ@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2022-09-16 16:27 UTC (permalink / raw)
  To: Chengyin Yao; +Cc: gcc-help

On Fri, 16 Sept 2022 at 17:05, Chengyin Yao via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Yea so I'm just wondering, how to compile gcc to (my own) architecture cpu that has a completely different architecture?

I'm not sure what you mean by "move gcc", and what is this "completely
different architecture"? The best answers depend on what you mean.

Have you created your own CPU with its own instruction set? Then you
want to "port" GCC (and binutils for the assembler and linker) to your
architecture. That's quite a lot of work. You could start by reading
https://gcc.gnu.org/onlinedocs/gccint/Back-End.html and
https://wiki.osdev.org/Porting_GCC_to_your_OS

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

* Re: How to move gcc to compile to my own architecture?
       [not found]   ` <CAE539w-PfeyeqKuBhTcrS3=tSwydNmtbcvLW7tt0VmUNPAm2bQ@mail.gmail.com>
@ 2022-09-16 20:09     ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2022-09-16 20:09 UTC (permalink / raw)
  To: Jackson Pfeffer; +Cc: Chengyin Yao, gcc-help

On Fri, 16 Sept 2022 at 20:51, Jackson Pfeffer <crazykidjack@gmail.com> wrote:
>
> I shouldn't assume (you know what happens)... But I assume they are asking how to compile GCC from source on a machine running (for example) some ARM chip running Linux to get an executable GCC that will run on (for example) an Intel x64 chip running windows.
>
> I assume (there it is again) that they are compiling on one well known "architecture" targeting another well known (but different) "architecture".
>
> I'm a GCC noob, but I think this basically amounts to them needing a cross compiler.

Indeed, I should have said that the fist link on the osdev wiki covers
that case (which is much simpler than porting GCC to a brand new
architecture).

See https://wiki.osdev.org/GCC_Cross-Compiler for cross compiler
details. That's all you need to be able to use one type of machine to
compile code for a different type of machine.

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

end of thread, other threads:[~2022-09-16 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AM5PR0602MB3251080495DE121D2397444DE3489@AM5PR0602MB3251.eurprd06.prod.outlook.com>
2022-09-16 16:27 ` How to move gcc to compile to my own architecture? Jonathan Wakely
     [not found]   ` <CAE539w-PfeyeqKuBhTcrS3=tSwydNmtbcvLW7tt0VmUNPAm2bQ@mail.gmail.com>
2022-09-16 20:09     ` Jonathan Wakely

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