Repository navigation
toolchain: enable supports_pic in all C++ toolchains - #89
Merged
Merged
Conversation
Without it Bazel does not build the PIC variant of the dependencies, so cc_binary(linkshared = True) (e.g. a MAVLink radio driver plugin) fails to link with "recompile with -fPIC" on BBB (armv7, also the macOS-hosted variant) and RPi Zero 2W (aarch64 musl). Ordinary binaries stay without -fPIC.
This was referenced Nov 22, 2026
Mateusz-Krajewski
marked this pull request as ready for review
November 22, 2026 20:44
bartoszsnieg
approved these changes
Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepare for dynamic lib
Enables the
supports_picfeature in all platform C++ toolchains:arm-cortex_a8-linux-gnueabihf(BBB, armv7),arm-cortex_a8-linux-gnueabihfmacOS variant,aarch64-linux-musl(RPi Zero 2W).Without it Bazel does not build the PIC variant of the dependencies, so a
cc_binary(linkshared = True)(e.g. a MAVLink radio driver plugin.soloaded by MavlinkDaemon) fails to link with "recompile with -fPIC". Ordinary binaries are built exactly as before (no-fPIC): Bazel uses the PIC variant only for what goes into a shared object.Why separately: srp now uses the platform toolchains directly (Simba-Avionic/srp#564 removes its local copy of the armv7 toolchain), so the E220 plugin in srp links on BBB/RPi once a platform package with this change is published. The MAVLink stack (#80) carries the same change for armv7/aarch64; after this is merged it adds nothing there.
How to test:
bazel build --config=bbb-platform/ RPi builds of the existing targets (unchanged output for regular binaries), and alinksharedtarget for the target platform links.