Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12409 Discussions

Building das Uboot for Nios2 - linker not found on Linux environment

Honored Contributor II

I am trying to build Uboot for Nios2. I notice Uboot has made many changes in their build configuration.  

Much of the old information for Uboot/Nios2 idid not work for me after I cloned the Uboot git repo. For example,  

'boards.cfg' is no longer supported. Uboot is migrating to Kconfig for build management and there are both 

Kconfig files and Make files -complicating debug.  


I do the following on Linux bash. 


> git clone git:// 

> cd u-boot-nios/ 

> make menuconfig 


These proceeding steps complete with no visible errors or warnings. 

After git clone - I can browse the Uboot source tree.  


I create a minimal '.config' file. 


> make all 


This step fails with the following error  



LD arch/nios2/cpu/built-in.o 

/bin/sh: nios2-elf-ld.bfd: command not found 

scripts/ recipe for target 'arch/nios2/cpu/built-in.o' failed 

make[1]: *** [arch/nios2/cpu/built-in.o] Error 127 

Makefile:1037: recipe for target 'arch/nios2/cpu' failed 

make: *** [arch/nios2/cpu] Error 2 


I tested to confirm that both 'nios2-elf-gcc' and 'nios2-elf-ld' are in the path and are executable.  


It appears the compile completed (based on the message output), but the nios2 linker ('nios2-elf-ld') is not found. 


I have been running Nios2 successfully on Linux.  


Anyone else seen this error or found a workaround? 


0 Kudos
3 Replies
Honored Contributor II

so you never got this success in the past? just to confirm your setup environment

Honored Contributor II

I have not run Uboot on nios2. The build failed - no linker.  


I have been running nios2 on the same hardware with the  

same sopc file. And I have not previously built Uboot for this system.
Honored Contributor II

To solve the problem of not finding the linker - I needed to set the CROSS_COMPILE environment variable 

using these bash commands.  


> CROSS_COMPILE=nios2-elf- 



Then run make and the build completed with no errors. 

Now, I need to try to load and test on my nios2 hardware. 


THIS WAS documented in the README file starting at line 4929. So I deserve a 

"RTFM idiot". BTW, the README file has 6515 lines.