2

i want a compiler on board so that it has the ability to compile for itself. As you known, self compile is a key ability for a "PC". There is ubuntu running on arm board, so if there is a way to setup a gcc on board, then i can use arm board to develop simple program.

Is there a project doing this? Is there a way port gcc on board? Any clue can help

DigCamara
  • 5,540
  • 4
  • 36
  • 47
jokemilk
  • 39
  • 2
  • You can certainly build GCC to run on your board. In fact, it might "just work". Why do you want to do it instead of cross compiling, though? Presumably your computer is a lot faster than whatever ARM dev board you're targeting. – Carl Norum Feb 28 '13 at 19:01
  • 1
    possible duplicate of [gcc ON arm/android](http://stackoverflow.com/questions/6380846/gcc-on-arm-android) – auselen Feb 28 '13 at 20:14
  • i think arm will be a uni platform for PC、 tablet、 smart phone. But for pc, you need a self compile ability to produce app for youself. i am a engineer of embedded systems, so PC for me is not just a entertaiment tool, i need a working platform to substitute x86 pc. – jokemilk Mar 01 '13 at 09:39
  • also as you known, arm is becaming faster than before. theres is dual core、 qual core model. so i think hardware limit will eventually vanish. – jokemilk Mar 01 '13 at 09:41
  • Do you have a board in mind? Can't you just purchase an ARM board that can run Ubuntu, install Ubuntu, and `apt-get install gcc`? If you don't have any particular requirements, the Raspberry Pi is not a terrible choice and the recommended distribution (Raspbian) comes with GCC by default; it's a bit picky about the power supply and USB/networking has historically been a bit buggy though. – tc. Mar 03 '13 at 22:56
  • Other possible duplicates, [compile native](http://stackoverflow.com/questions/16403461/cross-compile-or-compile-native-for-cpu-arch), [Cross native w ARM tag](http://stackoverflow.com/search?q=+[arm]+cross+native+is%3Aquestion) – artless noise May 25 '13 at 14:55

2 Answers2

1

Certainly, making a self-hosted compiler is possible. The most straightforward way is just to build GCC using the same cross-compiler toolchain you use to compiler "normal" apps for the board. However, it's not a trivial process.

Here are a couple of projects that produce a toolchain that runs on the target itself:

Bootstrap-Linux: https://github.com/pikhq/bootstrap-linux

Aboriginal Linux: http://landley.net/code/aboriginal/ (includes prebuilt binaries)

Igor Skochinsky
  • 24,629
  • 2
  • 72
  • 109
0

If you have fully functional Ubuntu, just do:

sudo apt-get update
sudo apt-get install build-essential

If you don't have enough memory or apt is missing, you have to manually download packages for ARM architecture and your Ubuntu version from internet to your board, and do

dpkg -i <package_name.deb>

At this stage you can get a lot of unsatisfied depencies, so you have to download and install them too.

Oleg Olivson
  • 489
  • 2
  • 5