Skip to content

toolchain: enable supports_pic in all C++ toolchains - #89

Merged
srp-platform-zuul[bot] merged 1 commit into
release-2503from
toolchain-supports-pic
Nov 23, 2026
Merged

srp-platform-zuul[bot] merged 1 commit into
release-2503from
toolchain-supports-pic

Conversation

@Mateusz-Krajewski

@Mateusz-Krajewski Mateusz-Krajewski commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Prepare for dynamic lib
Enables the supports_pic feature in all platform C++ toolchains:

  • arm-cortex_a8-linux-gnueabihf (BBB, armv7),
  • arm-cortex_a8-linux-gnueabihf macOS 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 .so loaded 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 a linkshared target for the target platform links.

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.
@Mateusz-Krajewski Mateusz-Krajewski self-assigned this Nov 23, 2026
@srp-platform-zuul
srp-platform-zuul Bot merged commit 9d07276 into release-2503 Nov 23, 2026
2 checks passed
@srp-platform-zuul
srp-platform-zuul Bot deleted the toolchain-supports-pic branch November 23, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants