Forum Discussion

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

GNU tools for NiosII

Hello,

I am looking for information about application building without using NiosII IDE and Altera HAL. I'd like use GNU tools only.

Does anybody have experiences with direct using GNU tools for NiosII application building or have some simple example for NiosII?

Regards,

Radim

2 Replies

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

    The simplest thing you can do to build your application without the ide is to create a shell script containing something like:

    nios2-elf-gcc -O2 -o <project.elf> <source file.c> <another source file.c>

    Of course you can use options other than -O2 if appropriate.

    You&#39;ll need some startup code, so you should probably copy crt0.S from the HAL into your project before modifying it, and it will be easier to start from a HAL generated linker script.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by wombat@Mar 16 2005, 03:59 PM

    the simplest thing you can do to build your application without the ide is to create a shell script containing something like:

    nios2-elf-gcc -o2 -o <project.elf> <source file.c> <another source file.c>

    of course you can use options other than -o2 if appropriate.

    you&#39;ll need some startup code, so you should probably copy crt0.s from the hal into your project before modifying it, and it will be easier to start from a hal generated linker script.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=5420)

    --- quote end ---

    --- Quote End ---

    What about support for C++?

    Is there a GNU version of something like nios2-elf-g++ ?

    I would like to compile C++ for NIOS2 in Linux...