-
-
Notifications
You must be signed in to change notification settings - Fork 261
Add support for Windows host and targets, ARM64 and x86_64 #642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ArchangelX360
wants to merge
12
commits into
bazel-contrib:master
Choose a base branch
from
ArchangelX360:archangelx360/llvm_windows_host_target
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+492
−83
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b2f7dd3
Add support for Windows target and host
ArchangelX360 ea004bd
Disable `cxx_builtin_include_directories` temporarily for Windows target
ArchangelX360 14e160f
Clean TODOs
ArchangelX360 b03daa2
Clarify TODOs
ArchangelX360 7e4b81a
Ensure backward compatibility with custom-build LLVM toolchains
ArchangelX360 c16ca8a
Use a more idiomatic key mutation (review comment)
ArchangelX360 a864350
Remove UNIX specific libraires from Windows repo toolchain (review co…
ArchangelX360 7dcecbc
Remove Windows libclang, never relevant
ArchangelX360 f8e038e
Fix comments
ArchangelX360 944bd4c
Fix cross-compilation `gcc` tool call on Windows
ArchangelX360 96cdedd
Fix backward compatibility with eventual custom LLVM toolchains
ArchangelX360 e68cd8f
Drop support for `lib_legacy` on Windows hosts
ArchangelX360 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,214 @@ | ||
| # Copyright 2021 The Bazel Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| # Some targets may need to directly depend on these files. | ||
| exports_files(glob( | ||
| [ | ||
| "bin/*", | ||
| "lib/**", | ||
| "include/**", | ||
| "share/clang/*", | ||
| ], | ||
| allow_empty = True, | ||
| )) | ||
|
|
||
| ## LLVM toolchain files | ||
|
|
||
| ALL_DLLS = glob(["bin/*.dll"], allow_empty=True) | ||
|
|
||
| filegroup( | ||
| name = "clang", | ||
| srcs = [ | ||
| "bin/clang.exe", | ||
| "bin/clang++.exe", | ||
| "bin/clang-cpp.exe", | ||
| "bin/clang-cl.exe", | ||
| "bin/lld-link.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "ld", | ||
| # Not all distributions contain wasm-ld. | ||
| srcs = [ | ||
| "bin/ld.lld.exe", | ||
| "bin/ld64.lld.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "include", | ||
| srcs = glob( | ||
| [ | ||
| "include/**/c++/**", | ||
| "lib/clang/*/include/**", | ||
| ], | ||
| ), | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "all_includes", | ||
| srcs = glob( | ||
| ["include/**"], | ||
| allow_empty = True, | ||
| ), | ||
| ) | ||
|
|
||
| # This filegroup should only have source directories, not individual files. | ||
| # We rely on this assumption in system_module_map.bzl. | ||
| filegroup( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fmeum any FUD around source directories on windows? |
||
| name = "cxx_builtin_include", | ||
| srcs = [ | ||
| "include/c++", | ||
| "lib/clang/{LLVM_VERSION}/include", | ||
| ], | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "extra_config_site", | ||
| srcs = glob(["include/*/c++/v1/__config_site"], allow_empty = True) | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "bin", | ||
| srcs = glob(["bin/**"]), | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "lib", | ||
| srcs = [ | ||
| # Include the .lib files in the linker sandbox even though they will | ||
| # not be available at runtime to allow sanitizers to work locally. | ||
| # Any library linked from the toolchain to be released should be linked statically. | ||
| "lib/clang/{LLVM_VERSION}/lib", | ||
| ], | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "lib_legacy", | ||
| srcs = [], # no reported Windows exec usage on older version of Bazel | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "ar", | ||
| srcs = [ | ||
| "bin/llvm-ar.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "as", | ||
| srcs = [ | ||
| "bin/clang.exe", | ||
| "bin/llvm-as.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "nm", | ||
| srcs = [ | ||
| "bin/llvm-nm.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "llvm-lib", | ||
| srcs = [ | ||
| "bin/llvm-lib.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "objcopy", | ||
| srcs = [ | ||
| "bin/llvm-objcopy.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "objdump", | ||
| srcs = [ | ||
| "bin/llvm-objdump.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "profdata", | ||
| srcs = [ | ||
| "bin/llvm-profdata.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "dwp", | ||
| srcs = [ | ||
| "bin/llvm-dwp.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "ranlib", | ||
| srcs = [ | ||
| "bin/llvm-ranlib.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "readelf", | ||
| srcs = [ | ||
| "bin/llvm-readelf.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "strip", | ||
| srcs = [ | ||
| "bin/llvm-strip.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "symbolizer", | ||
| srcs = [ | ||
| "bin/llvm-symbolizer.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "clang-tidy", | ||
| srcs = [ | ||
| "bin/clang-tidy.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "clang-format", | ||
| srcs = [ | ||
| "bin/clang-format.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "git-clang-format", | ||
| srcs = [ | ||
| "bin/git-clang-format.exe", | ||
| ] + ALL_DLLS, | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "libclang", | ||
| srcs = ["lib/libclang.lib"], | ||
| ) | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.