Description
The QNX toolchain config declares supports_pic (so Bazel produces .pic.o objects) but never defines the pic feature that injects -fPIC. Objects for shared libraries are therefore compiled without -fPIC.
Affected configs
aarch64-qnx — build failure
x86_64-qnx — latent (missing -fPIC masked by permissive linker)
Analysis results
Actual result
aarch64-unknown-nto-qnx8.0.0-ld: pic_test_lib.pic.o: relocation R_AARCH64_ADR_PREL_PG_HI21
against symbol `_ZTV13PICAwareClass' which may bind externally can not be used when making a
shared object; recompile with -fPIC
ERROR: Build did NOT complete successfully
Expected result
Shared-library objects are compiled with -fPIC and link successfully on both x86_64-qnx and aarch64-qnx.
Root cause
templates/qnx/cc_toolchain_config.bzl.template defined supports_pic_feature but was missing the pic feature present in the Linux template, which adds -fPIC via flag_group(flags = ["-fPIC"], expand_if_available = "pic").
Solution
Add the pic feature (mirroring the Linux config) and register it after supports_pic_feature.
Error Occurrence Rate
Reproducible
How to reproduce
bazel test --config aarch64-qnx //:all_tests (must be run on QQVP)
Supporting Information
No response
Classification
Major
First Affected Release
not released (main)
Last Affected Release
not released (main)
Expected Fixed Release
before release (main)
Category
Description
The QNX toolchain config declares
supports_pic(so Bazel produces.pic.oobjects) but never defines thepicfeature that injects-fPIC. Objects for shared libraries are therefore compiled without-fPIC.Affected configs
aarch64-qnx— build failurex86_64-qnx— latent (missing-fPICmasked by permissive linker)Analysis results
Actual result
Expected result
Shared-library objects are compiled with
-fPICand link successfully on bothx86_64-qnxandaarch64-qnx.Root cause
templates/qnx/cc_toolchain_config.bzl.templatedefinedsupports_pic_featurebut was missing thepicfeature present in the Linux template, which adds-fPICviaflag_group(flags = ["-fPIC"], expand_if_available = "pic").Solution
Add the
picfeature (mirroring the Linux config) and register it aftersupports_pic_feature.Error Occurrence Rate
Reproducible
How to reproduce
Supporting Information
No response
Classification
Major
First Affected Release
not released (main)
Last Affected Release
not released (main)
Expected Fixed Release
before release (main)
Category