We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
The example about c++ progran under DS-5 CPP directory is compiled by me with the armcc ,not gcc. But there is an error when compile。
Error: C3321E: automatic configuration failed - could not determine configuration from GCC
make: *** [arm_linux_config.xml] Error 1
I do not know the reason. Please tell me the answer. Thanks!
Answered on a different thread - if building a linux application we recommend just using gcc. If a bare metal app, no special options needed.
Hi zgyypmmm,
Can you go into more detail about where you got the example/project from?
The reason this error occurs is because you're attempting to use the --arm_linux_* configuration options. The way this usually works is to pass the path of GCC and the GNU linker to ARMCC and have it determine from the GCC spec output (gcc -dumpspecs will give you a good example) where the library paths and where the other tool paths live. Unfortunately, this option isn't really supported anymore within ARMCC since it isn't really compatible with modern GCC multilib configurations common on modern Linux distributions.
Is this a bare metal project or something you want to run on Linux?
Ta,
Matt
Hi mwsealey,
Thank your answer!
Now I want to build a bare metal project on the Cortex-A5 soc and NOT to use the linux OS。 The project is coded by C++。 I want to use the ARMCC to compile the project。 So I test the CPP project under the DS-5 tool。
The --arm-_inux_* parameter sets are for the linux application and armcc does not support these parameter now? Is it correct?
If I want to build a bare metal project, I only use the armcc to compile the c++ project without the --arm_linux_* parameter? And the lib and headfile which the bare metal project need are under the inlude directory and lib directory under the DS-5 install directory?. I do not care the "SYSROOT=../distribution/filesystem/armv5t_mtx" parameter and directory?. The directory "SYSROOT" is for the linux apliaction?. Are all correct? Please give me an answer! Thanks!
Select File -> New -> C++ Project from the menu.
Then select Bare Metal Executable, empty project, and ARM Compiler 5 as the compiler. Give the project a name. and click OK.
In the Project Explorer view, select your project, right click, New -> File, and create a file with a .cpp ending (this is a necessary ending).
Write some code therein, for example:
#include <iostream> using namespace std; int main() { cout << "Hello C++ World" << endl; return 0; }
This should now just build when you select from the menu Project -> Build Project.
If my bare metal c++ project use the GNU extesion, I must only use the arm-linux-gnueabifh-* tool or the arm-none-linux-gnueabi-* tool to compile the project and now the armcc tool can not meet the requirment. Is it correct? thanks!
You can use those compilers ("DS-5 GCC" in the Toolchain Editor or selected when you create the Project) but you have to be careful. By default they will try and source standard libraries which target Linux.
The sysroot is important, as it not only provides the base locations of the standard libraries but the include locations, it is a simpler way of passing in all the defaults with one option, rather than having a very, very large and hard to maintain list of -I and -isystem (somewhat equivalent to armcc -J). You can do tricks like pass "-nostdlib" and "-nostdinc" and provide all the include and library information you need manually within the toolchain settings, but having a valid sysroot is important.
What you will have probably better success with is to take the Linaro bare metal compiler and install it, adding it to your path. The "Bare Metal Executable" GCC is set to "arm-none-elf" or "arm-none-eabi" which this compiler provides. You can find it here:
http://www.linaro.org/downloads/
Way, way down at the bottom "Bare Metal". A hint: when using this compiler, if you wish to use semihosting you will need to either supply "-specs=rdimon.spec" to the compiler while linking, and if you want any kind of "file" IO you will need to reimplement certain functions as per the specifications for the "newlib" C library which is somewhat documented here:
http://wiki.osdev.org/Porting_Newlib
Thank your detail answer! Thank you again!