- 2005-12-30 by Kyle Husmann
I have written this document as a record of my experiences compiling binutils, gcc, and brickos. These are just my notes on the process, and if they happen to help anyone, great. I used binutils-2.16, gcc-4.0.2, and brickos 0.9.0, but any versions should work.
NOTES:
the --disable-nls flag to disable the “national language support”. By disabling this, we can avoid having to install extra language stuff in $prefix/share. Its just annoying, thats all.
If you make a package like a deb or rpm, remove $prefix/info, and $prefix/lib/libiberty.a You don't need either. Do this for gcc as well.
NOTES:
make
should error with something like this:
configure: WARNING: No
native atomic operations are provided for this platform.
configure:
WARNING: They cannot be faked when thread support is
disabled.
configure: WARNING: Thread-safety of certain classes is
not guaranteed.
configure: error: No support for this host/target
combination.
make: *** [configure-target-libstdc++-v3] Error
1
or, if you are using gcc version 3.3 and below,
checking
whether the C compiler (../build-gcc/xgcc -B ../build-gcc/gcc -g -Os
) works
configure: error: installation or configuration
problem:
C compiler cannot create executables.
This error is supposed to happen. This is because the compiling of libstdc++ does not work. We do not need libstdc++ or newlib because BrickOS contains its own minimal c++ library. Thank you to Jochen Hoenicke for this explanation.
The enable-target-optspace switch makes it compile for optimum space usage instead of speed.
NOTES:
Get the brickos-gcc33.diff patch from here: http://hoenicke.ath.cx/rcx/brickOS.html
If
you don't patch, the make dies with:
/usr/local/H8300/bin/h8300-hms-as
expandsf.s -o expandsf.o
expandsf.s: Assembler
messages:
expandsf.s:121: Warning: mismatch between opcode size
and operand size
/usr/local/H8300/bin/h8300-hms-as joinsf.s -o
joinsf.o
joinsf.s: Assembler messages:
joinsf.s:200: Warning:
mismatch between opcode size and operand
size
/usr/local/H8300/bin/h8300-hms-as addsf3.s -o
addsf3.o
addsf3.s: Assembler messages:
addsf3.s:187: Warning:
mismatch between opcode size and operand
size
/usr/local/H8300/bin/h8300-hms-as negsf2.s -o
negsf2.o
/usr/local/H8300/bin/h8300-hms-as mulsf3.s -o
mulsf3.o
/usr/local/H8300/bin/h8300-hms-as divsf3.s -o
divsf3.o
/usr/local/H8300/bin/h8300-hms-as floatsisf.s -o
floatsisf.o
floatsisf.s: Assembler messages:
floatsisf.s:138:
Warning: mismatch between opcode size and operand
size
/usr/local/H8300/bin/h8300-hms-as cmpsf2.s -o
cmpsf2.o
/usr/local/H8300/bin/h8300-hms-as fixsfsi.s -o
fixsfsi.o
fixsfsi.s: Assembler messages:
fixsfsi.s:195: Error:
invalid operands
make[2]: *** [fixsfsi.o] Error 1
make[2]:
Leaving directory
`/usr/local/src/brickos-0.2.6.10.6/lib/float'
make[1]: *** [all]
Error 2
make[1]: Leaving directory
`/usr/local/src/brickos-0.2.6.10.6/lib'
make: *** [all] Error 2
I have used the Makefile in the demo directory to create a new Makefile, which I believe is simpler. To use it, put it in the same directory as your foo.c source, and type “make foo.c”. Don't forget to change the paths at the top of the Makefile, first.
Here is the makefile: http://home.comcast.net/~kyle-violin/linux/brickos/Makefile
These websites helped tremendously. Thanks to all their authors.
http://did.mat.uni-bayreuth.de/~matthias/veranstaltungen/ws2004/mindstorms/doc/brickos-howto.html
http://hoenicke.ath.cx/rcx/brickOS.html