EmbDev.net

Forum: ARM programming with GCC/GNU tools GNU issues for cpp


von Sujit P. (sujit_p)


Rate this post
useful
not useful
GCC issue 1:

We are working on the STM32F0 series, where the src code is in C++ and 
the compiler used is the GCC ARM (version 4.4.1) which compiles fine.
However when we changed the GCC compiler to 4.7.3 we are observing 
linker issues as below:
undefined reference to '_isatty'

Can anyone suggest a solution for the same?

*****************************************************

GCC issue 2:

We are working on the STM32F0 series, where the src code is in C++ and 
the compiler used is the GCC ARM (version 4.4.1) which compiles fine.

We are observing that the compiler is behaving weird while dividing 
variables.

i.e.
var1 = var2/2  => OK
var1 = var2/3  => FAIL! (runtime issue, compiles fine)

var1 = var2/8  => OK
var1 = var2/6  => FAIL! (runtime issue, compiles fine)

Seems it behaves weird for some specific values of the divider.
We have verified the issue thru thorough testing so theres no doubt left 
about the observation.
Now we are trying to find a soln/workaround for the same.

Any such experiences with the GCC ARM compiler would be helpful.

von Dr. Sommer (Guest)


Rate this post
useful
not useful
Sujit P. wrote:
> Can anyone suggest a solution for the same?
Define an empty dummy function:
1
void _isatty () {}
, compile & link. Then disassemble the code and see where it used, and 
remove that code.

Sujit P. wrote:
> var1 = var2/8  => OK
This will be optimized to a bitshoft (var2 >> 3)
> var1 = var2/6  => FAIL! (runtime issue, compiles fine)
Did you specify the correct ARM Core (Cortex-M0)? That core does not 
have a hardware division unit, you have to ensure the compiler generates 
software division code.

von Sujit P. (sujit_p)


Rate this post
useful
not useful
Hi,

can any one have a working CPP template.
so that i can use that as an example to proceed.

von Meth (Guest)


Rate this post
useful
not useful
You don't need a "CPP template", you need a "project template". Correct 
compiler options and linker file etc.

Since you not even replied to the question which core you're using, it's 
obviously not very urgent, and you'll be fine after taking your time 
reading the documentation.

von Sujit P. (sujit_p)


Rate this post
useful
not useful
Cortex M0
and wrking on STM32F051.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.