Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12745 Discussions

Nios2 IDE produces different binaries in Windows vs. Linux

Altera_Forum
Honored Contributor II
1,280 Views

We develop Nios code in a mixed-os environment using Nios 2 IDE version 9.0 sp2. Recently, I needed to debug some running code using attach mode on a windows laptop and could not get the debugger to recognize the addresses in the running binary (built on linux). After some experimentation, I discovered that the Windows and Linux editions of the same version create quite different binaries from identical code and project settings. As a sanity check, I verified that different Linux machines create identical binaries from identical code and that I was able to attach to binaries built by a different machine. I also noticed that the windows nios2-elf-gcc reports a different build from the linux nios2-elf-gcc (b111 vs b132, respectively). 

 

Is there anything I can do to get the Win/Linux versions on the same page? It is desirable to debug using a laptop, and this situation makes it impossible to do it natively. 

 

Also, has this problem perhaps been addressed in newer versions of the Nios2 tools? 

 

Thanks for your help, 

-AJP
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
616 Views

How different are the object files? 

I don't believe the gcc code has changed recently, so maybe 

you are passing different options to the compiler. 

However you may need to sort out how to copy the program you built on linux over to the laptop for debugging. 

(This relies on you being able to run the debugger without reruning the compiler.)
0 Kudos
Altera_Forum
Honored Contributor II
616 Views

I never looked at the intermediate objects directly, so I don't know about the differences at that stage. 

 

As for the completed elfs, it's kinda difficult to quantify how different they are but the windows debugger couldn't make heads or tails of any of the addresses it was getting from the running binary. I diffed the objdumps and noticed significant differences in the asm generated. 

 

The 9.0 nios build scripts don't show the full command when building each file. I used the same project files on both Windows and Linux though, so wouldn't it stand to reason that the nios build scripts would use the same settings? 

 

If there is any other info I can provide, let me know! 

 

Thanks :-)
0 Kudos
Reply