How can I tell the linker/compiler not to use memset/memcpy function which use FPU registers?
For example: SCIOPTA allows to limit the use of the FPU for certain tasks (to improve task-switching). Tasks without FPU may not use FPU registers. But the compiler/linker uses optimized versions of memset() which results in an exception.
I tried to compile C files with --fpu none, but this produces link-timer errors.
The C libraries provided in ARM Compiler 5.04 contains several variants of the memmove/memset routines, and the linker selects which variantto use according to the build attributes in the files being linked. If a file included in the link has an attribute indicating that it uses FPU instructions then the linker takes that to mean it is OK to use the variants of memmove/memset which use FPU instructions.
Obviosuly this does not work in your special case if your application could be using FPU instruction but only under special cirumstances.
One way around this is to create your own copy of the C library and remove the variants of memmove/memset that use FPU instructionfrom the library. Then the linker will have to use the non FPU variants of memmove/memset.
Copy the version of the ARM C library that you are linking with (here I am assuming it is c_2.l, the library name convention used is documented athttp://infocenter.arm.com/help/topic/com.arm.doc.dui0475j/chr1358938936497.html.Use the --info=libraries option to the linker to list the libraries your application is actually linking with):
cp $ARMLIB/armlib/c_2.l c_2.l
List all files in the library that containt the NEON variants of memmove/memset/etc (this step is just informative):
armar -t c_2.l | grep rt_neon_mem
Remove these files from your copy of your library
armar -d c_2.l `armar -t c_2.l | grep rt_neon_mem` Now use this modified c_2.l library to link with your application; the application should not longer be using versions of memmove/memset which contain FPU instructions.
Ok, thanks. I will give it a try.