[QBS] qbs and Altera NIOS toolchain

Richard Weickelt richard at weickelt.de
Sat Jul 11 19:39:08 CEST 2015

> The only problem I have is that the linker (Altera always links with
> gcc or g++) expectd a very special switch -msys-crt0=<path to crt0>.
> Unfortunatly this switch must be given to g++ _before_ giving the
> object files to link:
> nios2-elf-g++ -msys-crt='crt0.o' -o app.elf a.o b.o
> I read the sources of GenericGCC.qbs and gcc.js but didn't found a way
> to achive this.

If You don't find any cpp module property, e.g. linkerFlags for abuse, You
could write a shell wrapper script as a replacement for nios2-g++. That
script calls nios2-g++ and either inserts -msys-crt='crt0.o' hardcoded
before passing the others arguments or re-arranges all command line
arguments according to Your needs. In the latter case You provide
-msys-crt=XY via cpp.linkerFlags and use the wrapper script to move it to
the desired position.

You have to adjust cpp.linkerName and cpp.linkerPath according to Your
script's name and location.


More information about the Qbs mailing list