Discussion:
[ARM cortex-m0] sync built-in functions for atomic memory access
Mallikarjun Goudar
2014-07-30 05:59:02 UTC
Permalink
Hi,
I would like to use sync built-in functions for atomic memory access
fro the target arm cortex-m0.
But i do get error when i use them.

For example:
int main(void)
{
int x = 2;
__sync_add_and_fetch(&x, 1);

return x;
}


I get following error:
undefined reference to `__sync_add_and_fetch_4'

I used following command:
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -c test.c

Thanks for your help,
Mallikarjuna
Sandeep Kumar Singh
2014-07-30 08:38:37 UTC
Permalink
Hi Mallikarjun,
Post by Mallikarjun Goudar
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -c test.c
I built toolchain with gcc-4.9.0 source code and I just ran your test case with your used provided
Command. It is running without any error.

Regards,
Sandeep Kumar Singh
Senior Technical member staff, AESBU - Infotainment & Clusters
KPIT Technologies Limited
Phone: +91-20-66525000 | cell: +91-9730704579
Mallikarjun Goudar
2014-07-31 08:26:15 UTC
Permalink
Hi Sandeep,
Thanks for the information. I will try with 4.9.0. Previously i was
using 4.7.3 gcc tools.

//mallikarjuna

Continue reading on narkive:
Loading...