Allow .S files in C++ Starlark cc_common.compile. #13155
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
.S files are (typically handwritten) assembly files that require
preprocessing, compared to their lower-capital .s counterparts that can
be compiled directly into object files.
Native cc_library rules already allow .S files in srcs [1]. However, the
Starlark cc_common.compile srcs argument doesn't accept them. This
change adds .S files to the list of valid srcs for cc_common.compile.
This is required for building AOSP, as there are handwritten source files in
Android's libc with the .S extension [2] that will be compiled through
Starlark C++ rules, e.g. directly into .o files.
[1] https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCppRuleClasses.java;l=280;drc=35de1e352459729f95d552b6ae5af9ce7d00a943
[2] https://cs.android.com/search?q=f:%5C.S$&sq=