Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions bazel/toolchain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ cc_args(
name = "llvm-libc_args",
actions = ["@rules_cc//cc/toolchains/actions:link_actions"],
args = [
"--unwindlib=none",
"-nostdlib++",
"-nostartfiles",
"-Wl,-lc++",
"-Wl,-lm",
],
visibility = ["//visibility:private"],
)
Expand Down
10 changes: 1 addition & 9 deletions src/rp2_common/pico_clib_interface/include/llvm_libc/sys/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@

#include <__llvm-libc-common.h>

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

typedef long suseconds_t;

struct timeval {
time_t tv_sec;
suseconds_t tv_usec;
};
#include <llvm-libc-types/struct_timeval.h>

struct timezone {
int tz_minuteswest;
Expand Down
9 changes: 9 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,8 +5,10 @@
*/

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

#include <llvm-libc-types/ssize_t.h>

Expand Down Expand Up @@ -65,6 +67,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
Loading