Welcome, Guest. Please login or register.

Author Topic: Cross-compilers  (Read 1247 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Cross-compilers
« on: March 27, 2009, 05:36:19 PM »
If a development environment has a cross-compiler for an OS on one CPU platform, does that mean it would be easier to incorporate a cross-compiler for the same OS on another platform? As an example, if the DE could cross-compile for Linux x86 but not Linux PPC, would it be easier to add cross-compile functionality for Linux PPC than it would be if it didn't already support Linux x86?
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Trev

  • Zero
  • Hero Member
  • *****
  • Join Date: May 2003
  • Posts: 1550
  • Country: 00
    • Show only replies by Trev
Re: Cross-compilers
« Reply #1 on: March 29, 2009, 07:10:41 PM »
It's typically the othe way around, since the OS just defines the ABI.
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Cross-compilers
« Reply #2 on: March 29, 2009, 07:23:30 PM »
Ahhh ok, so once the compiler can build for, say, OSX x86, it will be easier to make it build for Linux x86 but not for OSX PPC?
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Trev

  • Zero
  • Hero Member
  • *****
  • Join Date: May 2003
  • Posts: 1550
  • Country: 00
    • Show only replies by Trev
Re: Cross-compilers
« Reply #3 on: March 29, 2009, 08:16:29 PM »
Yup. Of course, someone very skilled with the target hardware may be able to write a compiler back-end faster than someone not so skilled with an OS can write a standard library and a linker. Neither task is trivial.

EDIT:

Are you looking for a specific compiler that works with a specific IDE? If you're limiting the discussion to gcc, then as long as the target is supported, it's just a matter of building the cross-compiler.
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Cross-compilers
« Reply #4 on: March 29, 2009, 09:12:52 PM »
Quote
Trev wrote:
Are you looking for a specific compiler that works with a specific IDE?

No, I was just wondering about this because I recently asked RealSoftware if there is any possibility of a Linux PPC cross-compiler in RealBasic. It can already compile for Linux x86 and OSX PPC, and I was just wondering whether the existing OSX PPC cross-compiler would help them to develop a Linux PPC cross-compiler more easily, or whether they would have to start all over again.
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10