Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Nios2 IDE produces different binaries in Windows vs. Linux

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

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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 :-)