Forum Discussion

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

How to use nios2-corss compile tool in command line

Hello,

I want to use the nios2-corss compile tool in command line (my operating system is Ubuntu 11.10). I want use this tool to compile some source files into ".so" files.

In command line terminal, I inputted "nios2-", and hit key Tab twice.

After thar I got this:


nios2-build-project               nios2-gdb-server-wrapped
nios2-configure-sof               nios2-ide
nios2-console                     nios2-import-project
nios2-create-application-project  nios2-iss
nios2-create-system-library       nios2-srec2flash
nios2-debug                       nios2-stackreport
nios2-delete-project              nios2-stackreport.pl
nios2-download                    nios2-studio
nios2-flash-programmer            nios2-terminal
nios2-flash-programmer-wrapped    nios2-terminal.sh
nios2-gdb-server                  nios2-terminal-wrapped

None of them seemed like tool I need.

Can anyone give me some advice?

3 Replies

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

    Are you trying to compile shared libraries for linux running on the nios2?

    If so you'll need the cross compiler & tool chain for the target linux - not the toolchain released as part of the Altera IDE (etc).

    (There will be subtle differences in the object file headers.)

    Search likely parts of the disk for nios2-elf-*
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Are you trying to compile shared libraries for linux running on the nios2?

    If so you'll need the cross compiler & tool chain for the target linux - not the toolchain released as part of the Altera IDE (etc).

    (There will be subtle differences in the object file headers.)

    Search likely parts of the disk for nios2-elf-*

    --- Quote End ---

    What do you mean by shared libraries?

    I'm trying to use the toolchain released as part of the Altera IDE.

    I want to know the command line instruction to call the compiler inside nios II IDE

    in order to change the makefile to generate library files that can be used with nios II. Will this be possible without uclinux system?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You said you wanted to generate a .so - they are shared (dynamically loaded) libraries, and only apply to operating systems.

    If you want to run compiler the IDE runs - in order to use your own makefiles (etc) - then just search for the directory they are in.

    Something like:

    find / -name '*nios2-elf-*' 2>/dev/null

    is rather brutal, but should work.

    Possibly they aren't installed with that prefix, so try looking for '*objdump*' instead.

    Another alternative is to download the compiler and toolchain sources and build it youself. Details (and some compiler patches) are on the wiki.