WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: What is the recommended compile flags for rpi extensions?  (Read 6246 times)

Offline Akane

  • Jr. Member
  • **
  • Posts: 71
    • My home server by RaspberryPi
What is the recommended compile flags for rpi extensions?
« on: May 19, 2014, 06:30:39 AM »
Hi there.

There is no recommendation of compile flags for rpi extensions on tinycore wiki.
(http://wiki.tinycorelinux.net/wiki:creating_extensions)
So we should decide them.

I think the best flags are below:
CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard -Os -pipe"
CXXFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard -fno-exceptions -fno-rtti -Os -pipe"

How do you think about them?
If it were OK, I would edit the wiki page.

Regards,
Akane.
Sorry for my terrible English.
Country: Japan
Interested in: HPC, low-level programming, embedded system and so on

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: What is the recommended compile flags for rpi extensions?
« Reply #1 on: May 19, 2014, 06:47:00 AM »
You can omit

Code: [Select]
-march=armv6 -mfpu=vfp -mfloat-abi=hard
as these are the default settings of the tool-chain. Choose the proper -O settings for the application you are building. -Os can be good in general, but use -O2 when speed is critical like codecs, fft and math libraries, etc.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Akane

  • Jr. Member
  • **
  • Posts: 71
    • My home server by RaspberryPi
Re: What is the recommended compile flags for rpi extensions?
« Reply #2 on: May 19, 2014, 07:25:53 AM »
Hi bmarkus.

Thanks for your reply.

Now I see that the flags can be omitted.
But as for optimization flag, since tinycore is designed as "Tiny Linux",
we should usually use "-Os" flag.

Based on these, I will edit the wiki page.

Thanks,
Akane.
Sorry for my terrible English.
Country: Japan
Interested in: HPC, low-level programming, embedded system and so on

Offline JJF

  • Newbie
  • *
  • Posts: 7
Re: What is the recommended compile flags for rpi extensions?
« Reply #3 on: July 22, 2015, 10:45:08 AM »
Maybe someone can post the flags for compiling for the RPi2 here, too?! Does only armv6 change to armv7 or are there other optimisations recommended?

I know this thread is over a year old, but it's linked in the Wiki article about creating extensions and it would be nice to keep it up to date for new users - like me  ;D

Thanks and cheers, JJ

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: What is the recommended compile flags for rpi extensions?
« Reply #4 on: July 22, 2015, 11:03:29 AM »
In most cases there are no benefits to build for armv7 and you risk it will not run on armv6. Except few minor cases like intensive use of neon, build it for armv6. Options used currently to build extensions:

Code: [Select]
-O2 -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline JJF

  • Newbie
  • *
  • Posts: 7
Re: What is the recommended compile flags for rpi extensions?
« Reply #5 on: July 22, 2015, 04:58:03 PM »
Ok, thanks for the reply.

The mfpu=vfp argument leads to an error with gcc in the .configure script for bluez5 compiling. Without that, it works fine. I hope leaving that out is no big deal.
But if it is, i don't know if this is the right place to discuss...

Cheers, JJ

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11592
Re: What is the recommended compile flags for rpi extensions?
« Reply #6 on: July 22, 2015, 05:07:38 PM »
Hi JJF
According to bmarkus in reply #1 of this thread:
Quote
You can omit

Code: [Select]
-march=armv6 -mfpu=vfp -mfloat-abi=hard
« Last Edit: July 22, 2015, 05:15:52 PM by Rich »

Offline JJF

  • Newbie
  • *
  • Posts: 7
Re: What is the recommended compile flags for rpi extensions?
« Reply #7 on: July 22, 2015, 05:15:53 PM »
Ok that seems to work, thanks! ... Now it's time to build my first TC extension. :)