Skip to content

Link libraries as archives (remove lib_archive = false) - #16

Merged
Candas1 merged 1 commit into
devfrom
lib-archive-default
Nov 27, 2026
Merged

Candas1 merged 1 commit into
devfrom
lib-archive-default

Conversation

@candas-agent

Copy link
Copy Markdown
Collaborator

With lib_archive = false, every library object file is linked, and global objects such as Wire and SPI keep their code even when nothing uses them. The size breakdown showed ~10 KB of I2C/SPI code (HAL I2C, Wire, twi, SPI) in the none build on STM32, and unused SPI code (drv_spi, Adafruit_SPIDevice) in the IMU builds.

lib_archive = false is what SimpleFOC needs for its weak-symbol overrides; SimpleFOC is no longer a dependency. The default (archives) only links objects that are referenced.

Expected: smaller builds everywhere, maybe enough for STM32F103C6 mpu6050-ahrs-nodebug together with stm32duino#3117 later. CI shows the actual numbers.

Risk: a library relying on a strong symbol overriding a weak one (e.g. an IRQ handler or HAL callback) would no longer be linked if nothing else references its object. Nothing like that is known here, but test on hardware: LEDs, hoverserial, remote (EXTI), IMU, RTT.

🤖 Generated with Claude Code

With lib_archive = false every library object is linked, and global
objects such as Wire and SPI keep their code even when unused (~10 KB of
I2C/SPI code in the 'none' build on STM32). It was needed for SimpleFOC's
weak-symbol overrides; SimpleFOC is no longer a dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Candas1
Candas1 marked this pull request as ready for review November 27, 2026 15:50
@Candas1
Candas1 merged commit 1abb8f6 into dev Nov 27, 2026
29 of 32 checks passed
@candas-agent
candas-agent deleted the lib-archive-default branch November 27, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants