September 29, 2026

The mac mini -- building Kyu

This could be an acid test of the cross development setup on the Mac. Kyu is the RTOS I have worked on for many years.

One again, I will do all this on the command line via an ssh connection from another machine:

cd Misc
git clone https://github.com/trebisky/Kyu.git
cd Kyu
./config h3
My config script (written in ruby) has trouble. It looks for ruby in /bin/ruby (should be /usr/bin/ruby or use "env").
make clean
make
This quickly builds many things using "arm-none-eabi-gcc" then I get the error:
fatal error: stdarg.h: No such file or directory
I use "locate stdarg.h" (after setting up locate) and it gives me about a dozen locations. The most likely is probably:
/opt/homebrew/Cellar/arm-none-eabi-gcc/16.2.0/lib/gcc/arm-none-eabi/16.2.0/include/stdarg.h
There is a heck of a long path to put into a -I switch for the compiler, but maybe that is what we will do.
I use this command:
arm-none-eabi-gcc -print-search-dirs
/opt/homebrew/Cellar/arm-none-eabi-gcc/16.2.0/lib/gcc/arm-none-eabi/16.2.0/
I shows the above prefix in the long list it spews out.

My gcc command includes this:

-isystem /usr/lib/gcc/arm-none-eabi/`arm-none-eabi-gcc -dumpversion`/include
We should fool with this. There is no directory /usr/lib/gcc on the Mac. I hack Makefile.inc with:
ABI = -isystem /opt/homebrew/Cellar/arm-none-eabi-gcc/16.2.0/lib/gcc/arm-none-eabi/16.2.0/include
Now the compile zooms along and yields this:
arm-none-eabi-ld.bfd: cannot find -lgcc: Invalid argument
This is on the link line. I just remove "-lgcc", again editing Makefile.inc It turns out this is not (no longer?) needed even on the linux side, so this can just be erradicated entirely.

Now the build works! I get:

-rwxr-xr-x  1 tom  staff  254460 Sep 29 16:06 kyu.bin
On my regular system I see:
-rw-r--r-- 1 tom  tom   254360 Sep 27 16:32 kyu.bin
So, we picked up an extra 100 bytes somewhere. I doubt it it matters. It might be some message generated at compile time with times, dates, compiler version or some such.

I we care, we might find out where and what this is if we ran diff on kyu.dump (which is the whole thing disasembled).

What I could do now is this:

scp kyu.bin trona:/var/lib/tftpboot
Then I could reboot the H3 board. It is set up to boot using tftp from trona and it would be trouble to rearrange things both on the H3 board and on the Mac, so this would serve for a quick test now.

Times

I use a stopwatch and run "make clean" then "make"
On my x86 system =  7 seconds
On the Mac system = 2 seconds
Mac: make -j 20   = 0 seconds
Running "make -j 20" the prompt is back immediately, much faster than I can react with a stopwatch. Well under a second.
Have any comments? Questions? Drop me a line!