How to build os image including gcc g++ tool chain for ARM platform?

2.1k views Asked by At

I am trying to build an OS image for TI OMAP4 Pandaboard. The downloaded BSP can be built but very limited without gcc g++ compiler. I think it much difficult to add the tool chain in QNX Momentics IDE, because there are so many files to be added. Can I manually modify the buildfile to do it? If possible, please give me an example. Thanks in advance.

2

There are 2 answers

2
maverick On

No, it is not possible to run g++ on your TI OMAP4 Pandaboard (unless you build g++ from sources for the ARM platform using the existing QNX toolchain running on an X86 platform).

Why not possible: QNX releases their build tools only for X86-based hosts. The currently supported host OS-es include some variants of Windows, Linux and QNX but the precondition is that the host hardware is X86-based.

Likely you do not actually want to build your library on the target hardware; it should not matter where you actually do the build (except in very special cases where you build some source code based on user input, etc.)

What you need to do is build your library on your development host using the ARM toolchain (QCC if you want to use the high-level tools; ntoarmv7-g++ if you want to use the familiar g++ interface). Once you have your binary you can include it in the .ifs file. You just need to include a line in the .build file, similar to the following example:

/path/on/targetfs/yourbinary=/path/on/buildmachine/yourbinary

If your build environment is configured so that mkifs finds your binary then you can omit the "path/on/buildmachine" part.

If you are fine with having the binary on your target under /proc/boot then you can omit the "/path/on/targetfs/ part as well.

For ease of development it would usually be more convenient for you to store your binary on the SD card with a FAT filesystem. Then you can just copy your binary to the SD without having to rebuild the .ifs file.

Finally, once you get experienced you will want to export a part of your host-machine's filesystem via CIFS or NFS and mount it directly from your target. This will save all the trouble of having to copy files (and, possibly, reboot the target) in each build cycle. But this is far off from your original question.

5
kmort On

I think you are trying to get the QNX C/C++ compiler to run on your target board. Correct?

If so, rather than installing the Runtime Kit, you install the QNX Software Development Platform and you should be good to go.

You can also use the System Builder to customize your QNX OS, but this is going to be harder than just using the QNX SDP.

One other note: QNX uses qcc for C and QCC for C++ instead of gcc. They both use gcc under the hood, but to compile on QNX, use qcc instead of gcc.