further info is here
http://www.nslu2-linux.org/wiki/SlugOS/NativeBuildForopenslug
Compiling natively is quite possible provided you have plenty of time, swap and diskspace. Below are some instructions to get you going. These should work on SlugOS 3.10 (and probably higher)
- Make sure you have lots of swap
- Add a normal user, 'slug' is recommended
ipkg install slugos-native (this package is not yet available for 4.8beta)
ipkg install libc6-dev (not needed after 3.10)
ipkg install boost-dev
ipkg install libz-dev
ipkg install monotone-5 (this package is not yet available for 4.8beta)
ipkg --force-overwrite install ipkg-utils
- Login as the normal user
- Run
wget http://www.nslu2-linux.org/Makefile && make setup (this will take a while)
- At this point you need to create .../openslug/conf/topdir.conf. It should contain the path to your openslug dir (e.g. for me
TOPDIR='/home/slug/OpenSlugHead/openslug'
- Run
bash, then cd openslug && source setup-env
- Now you can run
make to build everything supposed to be built natively (and be prepared to wait a loooong time), or use bb to build specific packages:
bb -b openembedded/packages/setpwc/setpwc_1.1.bb
During the bb process you may get notifications like:
NOTE: Couldn't find shared library provider for libncurses.so.5
NOTE: Couldn't find shared library provider for libc.so.6
These can be ignored.
Alternately you can get rid of the error by compiling with the -mthumb-interwork flag. E.g.:
gcc -o hello -mthumb-interwork hello.c
Other notes
compiling programs with gcc.
gcc -o hello hello.c will give you a warning like Warning: /tmp/ccJ12GPL.o does not support interworking, whereas hello does but will produce a working executable.
configuring libthread-db1:
//usr/lib/ipkg/info/libthread-db1.postinst: 4: ldconfig: not found
libthread-db1.postinst returned 127
so
run /sbin/ldconfig by hand
More notes:
My modifiations:
- ipkg install python-distutils
- ipkg install libc6-dev (because crt1.o missing)
- correct in bitbake.conf the following
ASSUME_PROVIDED =
to
ASSUME_PROVIDED +=
- touch bitbake.conf
And more notes
Running wget http://www.nslu2-linux.org/Makefile && make setup fails
cant find monotone so i linked monotone to mtn
And I end up with this error
monotone: error: failure extracting schema from sqlite_master
This is due to the master makefile now requiring montone 0.28 for which there is no package and so far I have been unable to compile it natively. I found a forum (sorry, can't remember where) which acknowledges this and stated that fixing it "wasn't a high priority". So basically, don't bother with native compliation as it's fatally bust and those cross compilers that broke it couldn't be bothered to update this page. If only I'd discovered that BEFORE I totally rebuilt my slug...
Fix for ldconfig: not found
If you log in as a regular user, then su to root, the PATH does not include /sbin, which is why ldconfig could not be found. Log in as root, and PATH will include /sbin, and ldconfig will be found.
Fix with ar
The following steps were also required to replace the busybox ar utility with a one enabling building your own libraries:
# cd /usr/bin
# rm ar
# ln -s arm-linux-ar ar
With this fix for me is possible to compile.