Skip to content

Add pic feature to QNX cc_toolchain_config#108

Open
nradakovic wants to merge 1 commit into
mainfrom
nira_fix_qnx_pic
Open

Add pic feature to QNX cc_toolchain_config#108
nradakovic wants to merge 1 commit into
mainfrom
nira_fix_qnx_pic

Conversation

@nradakovic

Copy link
Copy Markdown
Member

Introduce a pic feature that passes -fPIC for compile/assemble actions when the pic variable is available, and register it in the toolchain feature list.

resolves #107

Introduce a `pic` feature that passes -fPIC for compile/assemble
actions when the `pic` variable is available, and register it in
the toolchain feature list.
@nradakovic nradakovic self-assigned this Jul 16, 2026
Copilot AI review requested due to automatic review settings July 16, 2026 15:13
@nradakovic nradakovic added the bug Something isn't working label Jul 16, 2026
@nradakovic nradakovic added the feature New feature request label Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing pic feature to the QNX cc_toolchain_config template so Bazel’s PIC builds (e.g., shared libraries producing .pic.o) actually compile/assemble with -fPIC when the pic build variable is present. This aligns the QNX template with the existing Linux template behavior and addresses issue #107.

Changes:

  • Introduce a pic feature that injects -fPIC for compile and assemble-related actions gated by expand_if_available = "pic".
  • Register the new pic feature in the toolchain’s feature list alongside supports_pic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AlexanderLanin

Copy link
Copy Markdown
Member

AI-assisted review (Claude):

Severity: Critical: 0, Important: 0, Suggestions: 0

The change is a faithful port of the Linux template's pic_feature (identical flag_set structure and expand_if_available = "pic" gating), registered directly after supports_pic_feature — matching the Linux ordering. qcc accepts -fPIC as passed through to the underlying GCC frontend, so no QNX-specific adjustment is needed.

Coverage looks fine: tests/feature_verification:pic_test already builds pic_test_lib with linkstatic = False, so it exercises .pic.o compilation and would fail before this fix. No new test needed.

LGTM.

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

Labels

bug Something isn't working feature New feature request

Projects

Status: No status
Status: Backlog

Development

Successfully merging this pull request may close these issues.

Bug: QNX toolchain missing pic feature — -fPIC not applied, shared libs fail to link

3 participants