Jump to content


Photo

CFLAGS and CXXFLAGS ??


  • Please log in to reply
3 replies to this topic

#1 beowulf

  • Member
  • 25 posts

0
Neutral

Posted 12 October 2010 - 19:51

Hi all,


I have a little doubt with these 2 variables
. I have tested 3 CDK environments :

1) Dbox2 CDK use this flags :

CFLAGS="-pipe -Os"
CFLAGS="-pipe -Os"

2) Dreambox 500 CDK use this flags :

CFLAGS="-mcpu=405 -msoft-float -mmultiple -mstring -meabi -pipe -Os -ggdb3 -DHAVE_DREAMBOX_HARDWARE"
CXXFLAGS="-mcpu=405 -msoft-float -mmultiple -mstring -meabi -pipe -Os -ggdb3 -DHAVE_DREAMBOX_HARDWARE"

3) Dreambox 600 Openpli CDK use this flags :

CFLAGS="-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
CXXFLAGS="-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -fpermissive"


could someone explain to me the differences between the 3 options ??

is necessary to use these flags to compile for each machine ??
Thanks in advance,

Re: CFLAGS and CXXFLAGS ?? #2 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 12 October 2010 - 20:34

CFLAGS are used by gcc, CXXFLAGS by g++ (e.g. for c++ code)

You need both, or use CPPFLAGS instead (which are actually preprocessor flags, but should be passed to both gcc and g++)

Re: CFLAGS and CXXFLAGS ?? #3 beowulf

  • Member
  • 25 posts

0
Neutral

Posted 13 October 2010 - 17:38

yes, but I wanted to say that the difference between each other?

CFLAGS="-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2" it's more optimized for dreambox600 as CFLAGS="-pipe -Os"
or what is that differentiates each other??

For example I have compiled software with CFLAGS="-mcpu=405 -msoft-float -mmultiple -mstring -meabi -pipe -Os -ggdb3 -DHAVE_DREAMBOX_HARDWARE" and executed on dreambox600 and works ok. And similars...

How do you know which flags are appropriate for your machine?
This is my curiosity...

regards,

Re: CFLAGS and CXXFLAGS ?? #4 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 13 October 2010 - 17:44

read gcc manuals, and do some benchmarking. That's the only way to find the best options


1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


    Bing (1)