-
Notifications
You must be signed in to change notification settings - Fork 8
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
common bazel cxx toolchain for Linux and Mac #1
Merged
Changes from 50 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
4279f48
Initial import.
sayrer ff05708
Delete .DS_Store
sayrer 87424ea
Add .gitignore
sayrer 7826a68
space patrol
sayrer f5ec2cb
Add script to generate WORKSPACE.
sayrer 431fef7
Better python
sayrer ca6db21
Move sysroot BUILD file
sayrer 2eb8356
Working sysroot download.
sayrer e1faabb
generate workspace from script
sayrer 00fabc3
Rename main script.
sayrer afd19e4
Add gtest.BUILD
sayrer c43aaad
Working mac build
sayrer 7ab8fea
Remove old cc wrapper.sh
sayrer 68a0cbc
Adjust CROSSTOOL verbosity
sayrer fa2413c
A few more tests.
sayrer f13a1e2
Add travis file
sayrer 87684d9
Change to trusty for now
sayrer 0029001
Remove java 9
sayrer 58b2749
Adjust package names
sayrer ddb9f07
Remove moar Java
sayrer 9391e37
Update gtest template, require stdlib on linux
sayrer 69ee417
Fix BUILD file
sayrer bb6c6af
Unset gcc/g++
sayrer bd66bf0
nostdlib
sayrer d8f7c99
Change link style of stdlib
sayrer 902b5f6
Remove link options
sayrer 749225a
verbose compile
sayrer 7e9a7ed
Fix defines for libcxx
sayrer aa98226
Try adding osx to .travis.yml
sayrer 61584f8
Fix travis syntax
sayrer d4f624f
Too many builds
sayrer ac392d0
Try adding a .bzl file to load the repositories.
sayrer 56a3b28
Add BUILD file.
sayrer 2e97881
Fix BUILD for repos.
sayrer dbe4658
Add BUILD file for stdlib
sayrer e7c51eb
Fix .bzl typo
sayrer 414e8d4
Update generate script
sayrer b64e018
Moving build files around.
sayrer 50c6067
Move toolchain build files.
sayrer a5883ea
Update .gitignore
sayrer 3ce8edc
Remove BUILD file for old dir
sayrer f07b238
Fix quotation style
sayrer 10ba322
Generated with scripts/generate_workspace.py
sayrer 0609dfb
Fix sysroot
sayrer fb608ff
Address comment from lucas on status code checks.
sayrer c3b9933
Adjust visibility of tool_wrappers
sayrer d0d24b3
Add argparse
sayrer 229c7a3
Merge branch 'add_mac' of https://github.com/vsco/bazel-toolchains in…
sayrer 6544031
Only ignore the system c++ include directories.
sayrer 4800e54
Add system frameworks.
sayrer 4fe8c10
Fix exception
sayrer 36ed347
Update README.md
sayrer 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 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,3 @@ | ||
**/.DS_Store | ||
**/*.pyc | ||
bazel-* |
This file contains 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,34 @@ | ||
matrix: | ||
include: | ||
- os: linux | ||
dist: trusty | ||
sudo: required | ||
language: java | ||
- os: osx | ||
osx_image: xcode8.3 | ||
language: java | ||
|
||
env: | ||
global: | ||
- BAZEL_VERSION=0.5.2 | ||
|
||
before_install: | ||
- echo $TRAVIS_OS_NAME; | ||
- unset CC | ||
- unset CXX | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get autoremove openjdk-9-jre-headless openjdk-9-jdk oracle-java9-installer; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get purge openjdk-9-jre-headless openjdk-9-jdk oracle-java9-installer; fi | ||
- mkdir -p ${HOME}/bazel/install | ||
- pushd ${HOME}/bazel/install | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget --no-clobber https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel_${BAZEL_VERSION}-linux-x86_64.deb; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo dpkg -i bazel_${BAZEL_VERSION}-linux-x86_64.deb; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install bazel; fi | ||
- popd | ||
|
||
script: | ||
- bazel test --crosstool_top=//tools/cpp:default-toolchain //src/... | ||
|
||
notifications: | ||
email: false | ||
slack: false |
This file contains 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 |
---|---|---|
@@ -1 +1,11 @@ | ||
# bazel-toolchains | ||
## Prequisites | ||
|
||
On macOS, run `xcode-select --install` in Terminal. | ||
|
||
## Running the Python scripts | ||
|
||
The files in the `scripts/` directory are written in Python. Follow these [instructions](http://docs.python-guide.org/en/latest/starting/installation/) to install a version of Python that comes with the necessary tools for installation of third party libraries. On macOS, this means `brew install python`, and then following the instructions printed by `brew info python`. | ||
|
||
Once that's working, type `pip install requests` to install the necessary dependencies. | ||
|
||
From the root of this repository, type `python scripts/generate_workspace.py --rev="" | ||
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. I think this is missing a trailing `. |
This file contains 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,13 @@ | ||
# Chromium toolchain corresponding to Chromium 61.0.3153.4 | ||
|
||
load("//toolchains:repositories.bzl", "bazel_toolchains_repositories") | ||
bazel_toolchains_repositories() | ||
|
||
# GTest | ||
new_http_archive( | ||
name = "gtest", | ||
url = "https://github.com/google/googletest/archive/release-1.8.0.zip", | ||
sha256 = "f3ed3b58511efd272eb074a3a6d6fb79d7c2e6a0e374323d1e6bcbcc1ef141bf", | ||
build_file = "build_files/gtest.BUILD", | ||
strip_prefix = "googletest-release-1.8.0/googletest", | ||
) |
This file contains 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,5 @@ | ||
filegroup( | ||
name = "build_files", | ||
srcs = glob(["*.BUILD"]), | ||
visibility = ["//visibility:public"], | ||
) |
This file contains 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,17 @@ | ||
cc_library( | ||
name = "main", | ||
srcs = glob( | ||
["src/*.cc"], | ||
exclude = ["src/gtest-all.cc"] | ||
), | ||
hdrs = glob([ | ||
"include/**/*.h", | ||
"src/*.h" | ||
]), | ||
copts = [ | ||
'-Iexternal/gtest/include', | ||
'-Wno-unused-const-variable', | ||
], | ||
linkopts = ["-v"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains 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,95 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "ar", | ||
srcs = [ | ||
"bin/ar", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "as", | ||
srcs = [ | ||
"bin/as", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "ld", | ||
srcs = [ | ||
"bin/ld", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "ld.bfd", | ||
srcs = [ | ||
"bin/ld.bfd", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "ld.gold", | ||
srcs = [ | ||
"bin/ld.gold", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "nm", | ||
srcs = [ | ||
"bin/nm", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "objcopy", | ||
srcs = [ | ||
"bin/objcopy", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "objdump", | ||
srcs = [ | ||
"bin/objdump", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "ranlib", | ||
srcs = [ | ||
"bin/ranlib", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "readelf", | ||
srcs = [ | ||
"bin/readelf", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "strip", | ||
srcs = [ | ||
"bin/strip", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "binutils_components", | ||
srcs = [ | ||
":ar", | ||
":as", | ||
":ld", | ||
":ld.bfd", | ||
":ld.gold", | ||
":nm", | ||
":objcopy", | ||
":objdump", | ||
":ranlib", | ||
":readelf", | ||
":strip", | ||
], | ||
) |
This file contains 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,21 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "clang", | ||
srcs = [ | ||
"bin/clang", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "lib", | ||
srcs = glob(["lib/**"]), | ||
) | ||
|
||
filegroup( | ||
name = "compiler_components", | ||
srcs = [ | ||
":clang", | ||
":lib", | ||
], | ||
) |
This file contains 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,27 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "clang", | ||
srcs = [ | ||
"bin/clang", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "include", | ||
srcs = glob(["include/**"]), | ||
) | ||
|
||
filegroup( | ||
name = "lib", | ||
srcs = glob(["lib/**"]), | ||
) | ||
|
||
filegroup( | ||
name = "compiler_components", | ||
srcs = [ | ||
":clang", | ||
":include", | ||
":lib", | ||
], | ||
) |
This file contains 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,88 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "libcxx_includes", | ||
srcs = glob(["include/**/*"]) | ||
) | ||
|
||
cc_library( | ||
name = "cxxlib", | ||
copts = [ | ||
"-fPIC", | ||
"-fstrict-aliasing", | ||
"-nostdinc++", | ||
"-std=c++11", | ||
], | ||
hdrs = glob(["src/support/runtime/*.ipp"]), | ||
includes = ["include"], | ||
defines = [ | ||
"_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS", | ||
"_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS", | ||
"_LIBCPP_BUILDING_LIBRARY", | ||
"LIBCXX_BUILDING_LIBCXXABI" | ||
|
||
# This resets the visibility to default only for the various | ||
# flavors of operator new and operator delete. These symbols | ||
# are weak and get overriden by Chromium-provided ones, but if | ||
# these symbols had hidden visibility, this would make the | ||
# Chromium symbols hidden too because elf visibility rules | ||
# require that linkers use the least visible form when merging, | ||
# and if this is hidden, then when we merge it with tcmalloc's | ||
# operator new, hidden visibility would win. However, tcmalloc | ||
# needs a visible operator new to also override operator new | ||
# references from system libraries. | ||
# TODO(lld): Ask lld for a --force-public-visibility flag or | ||
# similar to that overrides the default elf merging rules, and | ||
# make tcmalloc's gn config pass that to all its dependencies, | ||
# then remove this override here. | ||
#"_LIBCPP_OVERRIDABLE_FUNC_VIS=__attribute__((__visibility__(\"\"default\"\"")))", | ||
], | ||
srcs = [ | ||
"src/algorithm.cpp", | ||
"src/any.cpp", | ||
"src/bind.cpp", | ||
"src/chrono.cpp", | ||
"src/condition_variable.cpp", | ||
"src/debug.cpp", | ||
"src/exception.cpp", | ||
"src/functional.cpp", | ||
"src/future.cpp", | ||
"src/hash.cpp", | ||
"src/ios.cpp", | ||
"src/iostream.cpp", | ||
"src/locale.cpp", | ||
"src/memory.cpp", | ||
"src/mutex.cpp", | ||
"src/new.cpp", | ||
"src/optional.cpp", | ||
"src/random.cpp", | ||
"src/regex.cpp", | ||
"src/shared_mutex.cpp", | ||
"src/stdexcept.cpp", | ||
"src/string.cpp", | ||
"src/strstream.cpp", | ||
"src/system_error.cpp", | ||
"src/thread.cpp", | ||
"src/typeinfo.cpp", | ||
"src/utility.cpp", | ||
"src/valarray.cpp", | ||
"src/variant.cpp", | ||
"src/include/atomic_support.h", | ||
"src/include/config_elast.h", | ||
], | ||
deps = [ | ||
"@org_chromium_libcxxabi//:include", | ||
] | ||
) | ||
|
||
cc_library( | ||
name = "cxx", | ||
hdrs = [ | ||
"libcxx_includes", | ||
"@org_chromium_libcxxabi//:include", | ||
], | ||
deps = [ | ||
"@org_chromium_libcxxabi//:cxxabi", | ||
":cxxlib" | ||
], | ||
) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that
prequisite
might not be a word