U-boot needs to be configured for the target machine.
So other than selecting the proper configuration target from the u-boot in the K5 source bundle rather than the u-boot configuration from the DX source bundle . . . .
This should 'just work':
https://www.mobileread.com/forums/sho...&postcount=276
Once you make (no pun intended) that happen, then you can go about modifying the source code.
Just be sure to do a 'make clean' before the 'make <..._config> ; make' step after any changes even though the build scripting does a full dependency test.
The cross-compilers for Windows and for Linux are posted in the DIY-KeK environment pool. If running MacOSx, probably running a Linux LiveCD is the best idea.
Also follow this thread:
https://www.mobileread.com/forums/sho...d.php?t=194025
Although it does not apply to building u-boot, it could be used for that purpose.
The reason being that the build scripting forces an "application's gcc" to function as a "standalone (bare metal) gcc"