[windows] Make def
generation work with objs containing LLVM bitcode
#23742
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-CPP
Issues for C++ rules
type: feature request
Description of the feature request:
LLVM already has LTO support on Windows (full or thin). However, if you turn on LTO the created object files would contain llvm bitcode instead of being native objects. This breaks
def
generation when thewindows_export_all_symbols
feature is enabled, as thedef_parser
cannot parse those object files anymore to find the symbols (Unrecognized file format in 'bazel-out/.../a.obj'
).One option here is apparently adding bitcode object support to the
def_parser
tool.Another option, which seems more straightforward, is having the cc toolchain accepting an additional
nm
tool (maybe alist_symbols
action withaction_config
, together with a feature to pass the flags), and havedef_parser
delegating the object files to thenm
tool (if enabled) to list the symbols. I think it's fair to assume that if someone uses LTO on windows with LLVM they will havellvm-nm
available as well.This is pretty much the only (bazel-side) obstacle before enabling LTO on Windows.
Which category does this issue belong to?
C++ Rules
What underlying problem are you trying to solve with this feature?
Currently you can't turn on LTO on Windows if you enable the
windows_export_all_symbols
feature.Which operating system are you running Bazel on?
Windows
What is the output of
bazel info release
?release 7.3.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
https://stackoverflow.com/questions/57082617/building-tensorflow-with-ltcg
https://groups.google.com/g/bazel-discuss/c/IDOsuyJLzZI/m/GxEll6vHDwAJ
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: