Discussion:
About rtems compilation
Nicolás Alvarez
2014-08-12 19:23:29 UTC
Permalink
Hi!

I need to compile rtems without any optimization flags, how can I set this?

Best Regards,

*Nicolás Alvarez*
Mohammed Khoory
2014-08-13 01:40:23 UTC
Permalink
Post by Nicolás Alvarez
Hi!
I need to compile rtems without any optimization flags, how can I set this?
Best Regards,
Nicolás Alvarez
I'm not sure if this is the best way to do it but it works for me. The way I do it is, before performing the RTEMS compilation, I set the following environment variables using the export command in the shell:

CFLAGS_FOR_BUILD="-O0"
CFLAGS_FOR_TARGET="-O0"

I then configure, make, and make install as usual. I assume this also works if you're using the source builder. You can also add "-g" in those variables to enable debugging symbols, which can be very useful.
Mohammed Khoory
2014-08-14 00:34:15 UTC
Permalink
Post by Mohammed Khoory
Post by Nicolás Alvarez
Hi!
I need to compile rtems without any optimization flags, how can I set
this?
Post by Nicolás Alvarez
Best Regards,
Nicolás Alvarez
I'm not sure if this is the best way to do it but it works for me. The way
I do it is, before performing the RTEMS compilation, I set the following
CFLAGS_FOR_BUILD="-O0"
CFLAGS_FOR_TARGET="-O0"
I then configure, make, and make install as usual. I assume this also works
if you're using the source builder. You can also add "-g" in those
variables to enable debugging symbols, which can be very useful.
Just a small correction. It seems that you only need to set CFLAGS_FOR_TARGET. CFLAGS_FOR_BUILD doesn't need to be set if you only want to disable optimization for the target build.

I've realized this after noticing that CFLAGS_FOR_BUILD was used for the host compiler, not for the cross-compiler.
Loading...