Skip to content

Build with -fno-threadsafe-statics #599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
arodland opened this issue Mar 29, 2016 · 1 comment
Closed
1 task done

Build with -fno-threadsafe-statics #599

arodland opened this issue Mar 29, 2016 · 1 comment
Assignees
Milestone

Comments

@arodland
Copy link

What kind of issue is this?

  • Feature Request. Start by telling us what problem you’re trying to solve. Often a solution
    already exists! Don’t send pull requests to implement new features without first getting our
    support. Sometimes we leave features out on purpose to keep the project small.

It looks like you should add -fno-threadsafe-statics to the default build flags. I ported an Arduino Due project to platform.io and the build size got twice as big. On some investigation I found that a whole mess of exception handling code was being included (despite -fno-exceptions) with pio that wasn't included when building with arduino. I tracked it down to FrameworkArduino/USB/PluggableUSB.cpp, specifically the static PluggableUSB_ obj; line, which brings in __cxa_guard_acquire, which brings in the whole rest of the mess. Adding build_flags = -fno-threadsafe-statics in my platformio.ini brings the text size down from 89776 to 40208. The Arduino IDE builds with this flag since 1.5.8 (arduino/Arduino#107).

@valeros valeros self-assigned this Mar 29, 2016
@valeros valeros added this to the 2.8.7 milestone Mar 29, 2016
@valeros
Copy link
Member

valeros commented Mar 29, 2016

Thanks! Fixed in development version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants