diff --git a/.bazelrc b/.bazelrc index c47472bdad..56bc13880b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,11 @@ +# Exclude all system include directories on macOS. +# TODO: Use {compiler_version} variable. +build:macos --copt=-nostdinc +build:macos --copt=-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include +build:macos --copt=-isystem/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include +build:macos --copt=-isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include +build:macos --copt=-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/include + # Enable configurations specific to the host platform. common --enable_platform_specific_config diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 52b44d3ba8..b1689ebb5d 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -148,6 +148,8 @@ versioned_http_file( versioned_http_archive( name = "curl", build_file = "//bazel/third_party/curl:curl.BUILD", + patch_args = ["-p1"], + patches = ["//bazel/third_party/curl:{version}.patch"], sha256 = "78a06f918bd5fde3c4573ef4f9806f56372b32ec1829c9ec474799eeee641c27", strip_prefix = "curl-{version}", url = "https://curl.se/download/curl-{version}.tar.gz", diff --git a/bazel/third_party/curl/7.85.0.patch b/bazel/third_party/curl/7.85.0.patch new file mode 100644 index 0000000000..2a7500cc35 --- /dev/null +++ b/bazel/third_party/curl/7.85.0.patch @@ -0,0 +1,16 @@ +diff --git a/lib/easy_lock.h b/lib/easy_lock.h +index d96e56b8d..92e963240 100644 +--- a/lib/easy_lock.h ++++ b/lib/easy_lock.h +@@ -24,6 +24,11 @@ + + #include "curl_setup.h" + ++#if defined(URBIT_RUNTIME_CPU_AARCH64) && defined(URBIT_RUNTIME_OS_DARWIN) ++#undef HAVE_ATOMIC ++#undef HAVE_STDATOMIC_H ++#endif ++ + #define GLOBAL_INIT_IS_THREADSAFE + + #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600