The issue is now resolved, as I’ve been able to build the preloader successfully using Ubuntu over WSL after reinstalling Linaro and the Intel Embedded Development Suite in the Ubuntu environment.
The failure to build the preloader and u-boot under Cygwin is ultimately due to 2 issues:
- the Windows environment uses carriage return, linefeed as end of line characters while the Linux environment uses only linefeed.
- scripts running under Windows need executable files to be called with the file extension included.
Most of the build errors due to the above issues can be resolved (as I’ve indicated in my earlier posts).
Some of the line ending issues can be resolved by adding checks for CR LF. For example to build include\generated\version_autogenerated.h correctly, the definition filechk_version.h in makefile in the root directory needs to be modified:
(echo #define PLAIN_VERSION “$(UBOOTRELEASE)”;
echo #define U_BOOT_VERSION "U-Boot " PLAIN_VERSION;
echo #define CC_VERSION_STRING “$$(LC_ALL=C $(CC) --version | head -n 1 | sed s/\r//)”;
echo #define LD_VERSION_STRING “$$(LC_ALL=C $(LD) --version | head -n 1 | sed s/\r//)”; )
The tools\scripts\define2mk.sed also needed the line s/\r//; added before the last line to remove carriage returns.
The build still failed due to CONFIG_LMB not being added to include/generated/autoconf.h. There is no ‘1’ placed after #define CONFIG_LMB in u-boot.cfg, which was related to empty quotation marks being added after CONFIG_LMB in include\autoconf.mk (CONFIG_LMB=""). This was somehow another symptom of the different line endings used in Windows, but I was not able to fix this in the scripts that build autoconf.mk.
I guess if someone really wants to build u-boot from Cygwin this would be something to look into.