NSLU2-Linux
view · edit · print · history

How to setup a native C compiler

The information is tested on OpenSlug but will most likely apply for other distro's as well.

In order to have gcc/g++ on your slug (e.g. to compile your own software) you need to do the following:

On OpenSlug 2.7

  1. install the package: openslug-native (This contains the essential build tools)
  2. if /usr/bin/gcc does not exist: create a file /usr/bin/gcc containing: /usr/bin/armeb-linux-gcc $*
  3. issue the command chmod 555 /usr/bin/gcc

On OpenSlug 3.3 beta or higher

  1. install the package: slugos-native (This contains the essential build tools)
  2. rm /usr/bin/gcc (this is a symlink to armeb-linux-gcc)
  3. create a file /usr/bin/gcc containing: /usr/bin/armeb-linux-gcc -mthumb-interwork $*
  4. issue the command chmod 555 /usr/bin/gcc

That's all.
Now go ahead, create helloworld.c and test your work. Enjoy!

Small problem on OpenSlug 3.10-beta

Compiling would work, but linking fails with an error of not finding crt1.o. It turns out, that libc6-dev wasn't installed. I would have assumed this is part of the dependencies of slugos-native, but it wasn't in my case.

I had to install libc6-dev in addition, then it worked like a charm.

view · edit · print · history · Last edited by eberhardmagooglemailcom.
Based on work by eberhardmagooglemailcom, eFfeM, and repvik.
Originally by eFfeM.
Page last modified on September 15, 2006, at 03:31 PM