Skip to content

Commit

Permalink
[wip] update llvm toolchain to 18.1.8
Browse files Browse the repository at this point in the history
Additionally, remove sysroot patching as the 18.x LLVM toolchain
releases are built for Ubuntu 18.04.

Change-Id: I954b5e2f4dba7109e3deb3aa47d5011eab20e2bc
  • Loading branch information
oliverlee committed Aug 28, 2024
1 parent 8ab48da commit 4cd050e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 257 deletions.
89 changes: 48 additions & 41 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,44 +29,11 @@ http_archive(
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
)

BAZEL_BOOTLIN_COMMIT = "d15e4b4c3a984668d1d6bd5f3ca032efecae5cb1"

http_archive(
name = "bazel_bootlin",
integrity = "sha256-kBlWjcV2AXGblkqCNxg1/bs2c6YLrLHqLgSbwsAcCl8=",
strip_prefix = "bazel_bootlin-{commit}".format(
commit = BAZEL_BOOTLIN_COMMIT,
),
url = "https://github.com/oliverlee/bazel_bootlin/archive/{commit}.tar.gz".format(
commit = BAZEL_BOOTLIN_COMMIT,
),
)

load("@bazel_bootlin//:defs.bzl", "bootlin_toolchain")

bootlin_toolchain(
name = "gcc_toolchain",
# x86-64-v3 should cover CPUs released after ~2015.
# see https://www.phoronix.com/news/GCC-11-x86-64-Feature-Levels.
architecture = "x86-64-v3",
# see https://toolchains.bootlin.com/releases_x86-64-v3.html
buildroot_version = "bleeding-edge-2023.08-1",
extra_cxx_flags = [
"-fdiagnostics-color=always",
"-Wduplicated-cond",
"-Wduplicated-branches",
"-Wlogical-op",
"-Wuseless-cast",
"-Wshadow=compatible-local",
] + COMMON_CXX_WARNINGS + CXX_STANDARD,
libc_impl = "glibc",
)

TOOLCHAINS_LLVM_COMMIT = "ade23e0e37c5308162c012a4f4224459c1c4fa22"
TOOLCHAINS_LLVM_COMMIT = "192cf04bbb11b29a8ca6756e269d27a840bfa14b"

http_archive(
name = "toolchains_llvm",
integrity = "sha256-w3ZChtMXOMPuczl1aCct33Hx29RDmYkgNY/XlwItdH8=",
integrity = "sha256-ZLAPgTjxvbBiZ3otGw0NSuAwLGDG+NhtlsblEL09Q4c=",
strip_prefix = "toolchains_llvm-{commit}".format(
commit = TOOLCHAINS_LLVM_COMMIT,
),
Expand All @@ -75,16 +42,18 @@ http_archive(
),
)

load("//tools:llvm_toolchain_dependencies.bzl", "llvm_toolchain_dependencies")
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies")

llvm_toolchain_dependencies()
bazel_toolchain_dependencies()

load("//tools:llvm_toolchain.bzl", "llvm_toolchain")
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")

# https://github.com/bazel-contrib/toolchains_llvm/blob/192cf04bbb11b29a8ca6756e269d27a840bfa14b/toolchain/internal/repo.bzl
llvm_toolchain(
name = "llvm_toolchain",
cxx_flags = {
"": [
"-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
"-stdlib=libc++",
"-Wshadow",
] + COMMON_CXX_WARNINGS + CXX_STANDARD,
Expand All @@ -96,15 +65,49 @@ llvm_toolchain(
link_libs = {
"": ["-fsanitize-link-c++-runtime"],
},
linux_x86_64_sysroot = "@gcc_toolchain_files//x86_64-buildroot-linux-gnu/sysroot",
llvm_version = "17.0.2",
stdlib = {
"": "builtin-libc++",
},
llvm_version = "18.1.8",
)

# register llvm first, it has better error messages
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")

llvm_register_toolchains()

BAZEL_BOOTLIN_COMMIT = "d15e4b4c3a984668d1d6bd5f3ca032efecae5cb1"

http_archive(
name = "bazel_bootlin",
integrity = "sha256-kBlWjcV2AXGblkqCNxg1/bs2c6YLrLHqLgSbwsAcCl8=",
strip_prefix = "bazel_bootlin-{commit}".format(
commit = BAZEL_BOOTLIN_COMMIT,
),
url = "https://github.com/oliverlee/bazel_bootlin/archive/{commit}.tar.gz".format(
commit = BAZEL_BOOTLIN_COMMIT,
),
)

load("@bazel_bootlin//:defs.bzl", "bootlin_toolchain")

bootlin_toolchain(
name = "gcc_toolchain",
# x86-64-v3 should cover CPUs released after ~2015.
# see https://www.phoronix.com/news/GCC-11-x86-64-Feature-Levels.
architecture = "x86-64-v3",
# see https://toolchains.bootlin.com/releases_x86-64-v3.html
buildroot_version = "bleeding-edge-2023.08-1",
extra_cxx_flags = [
"-fdiagnostics-color=always",
"-Wduplicated-cond",
"-Wduplicated-branches",
"-Wlogical-op",
"-Wuseless-cast",
"-Wshadow=compatible-local",
] + COMMON_CXX_WARNINGS + CXX_STANDARD,
libc_impl = "glibc",
)

register_toolchains(
"@gcc_toolchain//:toolchain",
)
Expand Down Expand Up @@ -217,3 +220,7 @@ py_library(
commit = MARKDOWN_EMBED_CODE_COMMIT,
),
)

load("//tools:local_config_info.bzl", "local_config_info")

local_config_info(name = "local_config_info")
2 changes: 1 addition & 1 deletion src/detail/arg_fmt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class arg_fmt_fn

public:
template <class T>
constexpr decltype(auto) operator()(const T & arg) const
constexpr decltype(auto) operator()(const T& arg) const
{
return impl(priority<3>{}, arg);
}
Expand Down
203 changes: 0 additions & 203 deletions tools/llvm_toolchain.bzl

This file was deleted.

12 changes: 0 additions & 12 deletions tools/llvm_toolchain_dependencies.bzl

This file was deleted.

0 comments on commit 4cd050e

Please sign in to comment.