-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now that we're downloading arbitrary versions of clang, if we want to actually use the C++ standard library in cross-compilation environments, we need to compile it too. bazel doesn't make that super easy for now, as there is no facility for transitioning between a no-stdlib-C++ compiler and a with-stdlib-C++ compiler automatically. Thus we currently require cc_binary nodes to manually link in the libcxx label.
- Loading branch information
Showing
8 changed files
with
153 additions
and
16 deletions.
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 |
---|---|---|
|
@@ -17,5 +17,6 @@ | |
cc_binary( | ||
name = "example1", | ||
srcs = ["example1.cc"], | ||
deps = ["@org_llvm_libcxx//:libcxx"], | ||
linkstatic = 1, | ||
) |
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
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
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
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,56 @@ | ||
# -*- python -*- | ||
|
||
# Copyright 2019 Josh Pieper, jjp@pobox.com. | ||
# | ||
# 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"]) | ||
|
||
filegroup( | ||
name = "raw_headers", | ||
srcs = glob(["include/**"]), | ||
) | ||
|
||
cc_library( | ||
name = "headers", | ||
hdrs = [":raw_headers"], | ||
) | ||
|
||
cc_library( | ||
name = "libcxx", | ||
hdrs = glob(["include/**"]), | ||
srcs = glob([ | ||
"src/*.cpp", | ||
"src/include/*.h", | ||
"filesystem/*.cpp", | ||
"filesystem/*.h", | ||
]), | ||
textual_hdrs = glob([ | ||
"src/support/runtime/**", | ||
]), | ||
copts = [ | ||
"-Iexternal/org_llvm_libcxx/src/include", | ||
"-Iexternal/org_llvm_libcxx/src", | ||
"-D_LIBCPP_BUILDING_LIBRARY", | ||
"-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER", | ||
"-DLIBCXX_BUILDING_LIBCXXABI", | ||
"-DLIBCXX_CXX_ABI=libstdc++", | ||
"-DNDEBUG", | ||
"-fvisibility-inlines-hidden", | ||
], | ||
includes = ["include"], | ||
deps = [ | ||
":headers", | ||
"@org_llvm_libcxxabi//:libcxxabi", | ||
], | ||
) |
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,45 @@ | ||
# -*- python -*- | ||
|
||
# Copyright 2019 Josh Pieper, jjp@pobox.com. | ||
# | ||
# 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"]) | ||
|
||
filegroup( | ||
name = "raw_headers", | ||
srcs = glob(["include/**"]), | ||
) | ||
|
||
cc_library( | ||
name = "libcxxabi", | ||
hdrs = [":raw_headers"], | ||
srcs = glob([ | ||
"src/*.cpp", | ||
"src/*.hpp", | ||
"src/*.h", | ||
"src/include/*.h", | ||
"src/demangle/*.h", | ||
], exclude = [ | ||
"src/stdlib_new_delete.cpp", | ||
"src/cxa_noexception.cpp", | ||
]), | ||
copts = [ | ||
"-Iexternal/org_llvm_libcxx/include", | ||
"-D_LIBCPP_BUILDING_LIBRARY", | ||
"-DNDEBUG", | ||
"-fvisibility-inlines-hidden", | ||
], | ||
includes = ["include"], | ||
deps = ["@org_llvm_libcxx//:headers"], | ||
) |
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
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