Error building U-Boot for Cyclone V in Cygwin

Hi there,

I am having problems building U-Boot in the cygwin environment for the Cyclone V. I have followed all the steps from https://rocketboards.org/foswiki/view/Documentation/EmbeddedLinuxBeginnerSGuide

and the problem starts in Section 5: Configure and Compile U-Boot.

The first problem happens at “make mrproper”. I would get the following error:

$ make mrproper
process_begin: CreateProcess(NULL, /cygdrive/c/altera/15.0/soc/atlas_linux_ghrd/
software/u-boot-socfpga/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm
-linux-gnueabihf-gcc -print-file-name=include, …) failed.
/usr/bin/sh: /cygdrive/c/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpg
a/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc:
No such file or directory
dirname: missing operand
Try ‘dirname --help’ for more information.
process_begin: CreateProcess(NULL, /cygdrive/c/altera/15.0/soc/atlas_linux_ghrd/
software/u-boot-socfpga/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm
-linux-gnueabihf-gcc -print-file-name=include, …) failed.

Changing

export CROSS_COMPILE=$PWD/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-

to

export CROSS_COMPILE=arm-linux-gnueabihf-

solved the first problem (but I am unsure if it contributes to the next problem). Note that I get the following error now, which I feel should be harmless (deleting the spl directory before executing “make mrproper” does not show this error)

$ make mrproper
rm: cannot remove `SPL’: Is a directory
make: *** [clobber] Error 1

I then hit the stumbling block at

make socfpga_cyclone5_config
make

Make fails with the following message:

$ make
Generating include/autoconf.mk
cc1.exe: warning: target CPU does not support THUMB instructions [enabled by def
ault]
In file included from C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpg
a/include/configs/socfpga_cyclone5.h:27:0,
from C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpg
a/include/config.h:10,
from include/common.h:37:
C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpga/include/configs/socf
pga_common.h:20:31: fatal error: asm/arch/hardware.h: No such file or directory
#include <asm/arch/hardware.h>
^
compilation terminated.
Generating include/autoconf.mk.dep
cc1.exe: warning: target CPU does not support THUMB instructions [enabled by def
ault]
In file included from C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpg
a/include/configs/socfpga_cyclone5.h:27:0,
from C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpg
a/include/config.h:10,
from include/common.h:37:
C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpga/include/configs/socf
pga_common.h:20:31: fatal error: asm/arch/hardware.h: No such file or directory
#include <asm/arch/hardware.h>
^
compilation terminated.
arm-linux-gnueabihf-gcc -DDO_DEPS_ONLY
-g -Os -fno-common -ffixed-r8 -msoft-float -IC:/altera/15.0/
soc/atlas_linux_ghrd/software/u-boot-socfpga/board/altera/socfpga -IC:/altera/15
.0/soc/atlas_linux_ghrd/software/u-boot-socfpga/board/altera/socfpga/sdram -D__K
ERNEL__ -IC:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpga/include -f
no-builtin -ffreestanding -nostdinc -isystem c:/altera/15.0/embedded/ds-5/sw/gcc
/bin/…/lib/gcc/arm-linux-gnueabihf/4.8.3/include -pipe -DCONFIG_ARM -D__ARM__
-march=armv5 -Wall -Wstrict-prototypes
-o lib/asm-offsets.s lib/asm-offsets.c -c -S
lib/asm-offsets.c:1:0: warning: target CPU does not support THUMB instructions [
enabled by default]
/*
^
In file included from C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpg
a/include/configs/socfpga_cyclone5.h:27:0,
from C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpg
a/include/config.h:10,
from C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpg
a/include/common.h:37,
from lib/asm-offsets.c:18:
C:/altera/15.0/soc/atlas_linux_ghrd/software/u-boot-socfpga/include/configs/socf
pga_common.h:20:31: fatal error: asm/arch/hardware.h: No such file or directory
#include <asm/arch/hardware.h>
^
compilation terminated.
make: *** [lib/asm-offsets.s] Error 1

I do not think the source files need changing else it will generate a whole host of problems later on.

So how do I solve this issue?

Hello.
I have the same problem.
Did you solve it?
Than you.

Hello.
Also I have the same problem.
Anyone solve it?
Than you.

follow this guide:
http://www.alterawiki.com/wiki/Intro_to_Altera_SoC_Devices_for_HW_Developers_Workshop_-_Generating_the_Preloader
at the make stage, just issue make uboot instead of bare make, and you will get u-boot.img compiled.

I had similar issue following the instructions here:-

https://rocketboards.org/foswiki/view/Documentation/WS2LinuxKernelIntroductionForAlteraSoCDevices

The solution is to use a Linux PC, not Cygwin.

I used Ubuntu 14.06, but did have to install these:-
apt-get install lib32z1
apt-get install lib32ncurses5
apt-get install git

Newer u-boot versions use all possible bad practices: linking, use same names with different char-cases (kconfig folder and Kconfig file in the same folder). So, the only way to build it is Linux OS.