Что касается:
/tmp/cc7ETq9C.s:508: Error: registers may not be the same -- `strexb r0,r0,[r1]'
/tmp/cc7ETq9C.s:533: Error: registers may not be the same -- `strexh r0,r0,[r1]'
/tmp/cc7ETq9C.s:533: Error: registers may not be the same -- `strexh r0,r0,[r1]'
на CodeSourcery рекомендуют сделать следующее:
Цитата
Question
When compiling applications that contain or use the Cortex Microcontroller Software Interface Standard e.g. CMSIS (http://www.onarm.com/cmsis/) you may receive the following errors:
/tmp/ccaxp69S.s: Assembler messages:
/tmp/ccaxp69S.s:463: Error: registers may not be the same -- `strexb r0,r0,[r1]'
/tmp/ccaxp69S.s:488: Error: registers may not be the same -- `strexh r0,r0,[r1]'
How do I fix these "registers may not be the same" errors? Where do they come from?
Answer
Some versions of the CMSIS contain invalid inline assembly of the following form:
uint32_t __STREXB(uint8_t value, uint8_t *addr)
{
uint32_t result=0;
asm volatile ("strexb %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
return(result);
}
The first constraint =r on variable result is not correct, it should be =&r to indicate that the two registers used should not be the same e.g. early-clobber (this is required by the ARM Instruction Set Architecture).
To fix the error you must locate the invalid inline assembly and change the =r to =&r for the result register variable.
Often it is difficult to determine which source file was used to generate /tmp/ccaxp69S.s, to help with that problem add -save-temps to the compiler invocation to save the intermediate output to the current directory for your review.
This entry was last updated on 8 February 2012.
When compiling applications that contain or use the Cortex Microcontroller Software Interface Standard e.g. CMSIS (http://www.onarm.com/cmsis/) you may receive the following errors:
/tmp/ccaxp69S.s: Assembler messages:
/tmp/ccaxp69S.s:463: Error: registers may not be the same -- `strexb r0,r0,[r1]'
/tmp/ccaxp69S.s:488: Error: registers may not be the same -- `strexh r0,r0,[r1]'
How do I fix these "registers may not be the same" errors? Where do they come from?
Answer
Some versions of the CMSIS contain invalid inline assembly of the following form:
uint32_t __STREXB(uint8_t value, uint8_t *addr)
{
uint32_t result=0;
asm volatile ("strexb %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
return(result);
}
The first constraint =r on variable result is not correct, it should be =&r to indicate that the two registers used should not be the same e.g. early-clobber (this is required by the ARM Instruction Set Architecture).
To fix the error you must locate the invalid inline assembly and change the =r to =&r for the result register variable.
Often it is difficult to determine which source file was used to generate /tmp/ccaxp69S.s, to help with that problem add -save-temps to the compiler invocation to save the intermediate output to the current directory for your review.
This entry was last updated on 8 February 2012.
Т. е. сваливают всё не на компилятор, а на неграмотную строку в инлайн ассемблере. Может это и правильно?
Проверил их свежим тулчейном - работает.
PS Проверял только на старых проектах с CMSISv1.3