Skip to content
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

Remove use of whole-archive #677

Merged
merged 3 commits into from
Oct 7, 2019
Merged

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Oct 2, 2019

Add C source files wrapper library

Allow to not archive HAL/LL object files to core.a.
This avoid the linker to select weak definitions instead of non-weak ones when 'whole-archive' option is not used.

See:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15833.html

This allow to save lot of space.
Example for BluePill F103C8 AnalogReadSerial sketch with USB CDC enabled:

  • With whole-archive:

Sketch uses 22976 bytes (35%) of program storage space. Maximum is 65536 bytes.
Global variables use 3532 bytes (17%) of dynamic memory, leaving 16948 bytes for local variables. Maximum is 20480 bytes.

  • Without whole-archive:

Sketch uses 18972 bytes (28%) of program storage space. Maximum is 65536 bytes.
Global variables use 3176 bytes (15%) of dynamic memory, leaving 17304 bytes for local variables. Maximum is 20480 bytes.

Full build without whole-archive and source files built-in library:
build_result.log

@fpistm fpistm added this to In progress in STM32 core based on ST HAL via automation Oct 2, 2019
@fpistm fpistm force-pushed the whole-archive branch 2 times, most recently from 6df672a to e2d24ab Compare October 4, 2019 12:48
Allow to not archive HAL/LL object files to core.a.
This avoid the linker to select weak definitions instead
of non-weak ones when 'whole-archive' option is not used.

See:
 http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15833.html

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Due to a bug in the arm none eabi gcc with lto which raise
an unresolved reference if syscall is in the archive (_sbrk,...)

See:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15833.html

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant