Skip to content

Commit

Permalink
Update Clang toolchain used by Bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
petrhosek committed Dec 28, 2024
1 parent 969f589 commit bdc98d7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
16 changes: 8 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,34 +54,34 @@ http_archive(
http_archive(
name = "clang_linux-x86_64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "6c599d1aba568236064c340d7813324849896d5a4e2f3fd8225a8c31bfcbf884",
sha256 = "dd4b3b0fc7186a4da2b52796b251e0757aefac4813f9f635982954fec3337d2e",
type = "zip",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/linux-amd64/+/git_revision:2b0a708f41dd6291ee744704d43febc975e3d026",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/linux-amd64/+/git_revision:9d3f9f47e6e630b8308562297757e0911be03a18",
)

http_archive(
name = "clang_win-x86_64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "f49ba4123ee3958f2b47289d017a5b3f1ca01f82dd7a2168c45412c18101fd13",
sha256 = "21092395df915ee5a899a832a592b137c9ea07fbc91e49ac6069ea0083d31899",
type = "zip",
# Windows doesn't like `:` in the produced filename, so replace it with `%3A`.
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/windows-amd64/+/git_revision:2b0a708f41dd6291ee744704d43febc975e3d026".replace("git_revision:", "git_revision%3A"),
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/windows-amd64/+/git_revision:9d3f9f47e6e630b8308562297757e0911be03a18".replace("git_revision:", "git_revision%3A"),
)

http_archive(
name = "clang_mac-x86_64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "d3516f2eb4c12d17ae77ee84c9226fbea581d4fb806910ceac4717d5adfcf748",
sha256 = "bb397fdce21d068ea40fefa9618993baa4907a248f996f18316c8fa6ca24dee2",
type = "zip",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-amd64/+/git_revision:2b0a708f41dd6291ee744704d43febc975e3d026",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-amd64/+/git_revision:9d3f9f47e6e630b8308562297757e0911be03a18",
)

http_archive(
name = "clang_mac-aarch64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "68e551f41c7e9473063b09819f6ab8ec6e7e53677f4078189656cb14dc52984b",
sha256 = "dad5583f96eabc913c1930d923c53a105d6ed73f56ca32451ea79ad70e495b0f",
type = "zip",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-arm64/+/git_revision:2b0a708f41dd6291ee744704d43febc975e3d026",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-arm64/+/git_revision:9d3f9f47e6e630b8308562297757e0911be03a18",
)

new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

#include <llvm-libc-types/time_t.h>
#include <llvm-libc-types/struct_timespec.h>

typedef long suseconds_t;
#include <llvm-libc-types/suseconds_t.h>

struct timeval {
time_t tv_sec;
Expand Down
8 changes: 8 additions & 0 deletions src/rp2_common/pico_clib_interface/llvm_libc_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <math.h>
#include <stdbool.h>
#include <stddef.h>
#include <sys/time.h>

Expand Down Expand Up @@ -65,6 +66,13 @@ ssize_t __llvm_libc_stdio_write(__unused void *cookie, const char *buf, size_t s
return size;
}

bool __llvm_libc_timespec_get_utc(struct timespec *ts) {
int64_t absolute_time = (int64_t)get_absolute_time();
ts->tv_sec = (time_t)(absolute_time / 1000000);
ts->tv_nsec = (long)(absolute_time % 1000000 * 1000);
return true;
}

void __cxa_finalize(__unused void *dso) {}

void __attribute__((noreturn)) __llvm_libc_exit(__unused int status) {
Expand Down

0 comments on commit bdc98d7

Please sign in to comment.