How to query a toolchain for flag sets resulting from a supported feature? #21696
Unanswered
nicholasjng
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently porting a CMake project over to Bazel, and it's going quite well. The project has quite a few different configuration options, which I've been mostly implementing with config settings and flags.
For the project, I set up a GitHub Actions job capturing the compile / link commands for all major platforms in an example project on both Bazel and CMake, and have found a few differences which I now want to equalize, or at least understand what they mean.
TLDR: I'm building a
cc_binary
inlinkshared
mode, which is packaged into a Python wheel. Most notably, with the CMake implementation on Linux, the resulting shared library is linked against a static librarylibnanobind.a
, while in Bazel, a lot ofxxx.pic.o
targets are built and stitched together by the linker in the end, I'm assuming because of thepic
feature.Is there a quick way of querying the current cc toolchain for features and their resulting flag sets in a build? (And maybe more specifically, is this PIC linkage the same as linking a static lib whose targets are built with
-fPIC
?)Beta Was this translation helpful? Give feedback.
All reactions