Files
codex/patches/llvm_windows_arm64_powl.patch
T

30 lines
1.1 KiB
Diff

# What: provide and link MinGW's ARM64 long-double `powl` compatibility shim.
# Why: Windows ARM64 uses 64-bit long doubles, but LLVM's Bazel source list
# omits the upstream `powl -> pow` implementation and its default link flags
# omit the MinGW extension archive that owns the shim.
diff --git a/runtimes/mingw/crt_sources.bzl b/runtimes/mingw/crt_sources.bzl
index aa085df..f45f99d 100644
--- a/runtimes/mingw/crt_sources.bzl
+++ b/runtimes/mingw/crt_sources.bzl
@@ -417,6 +417,7 @@ MINGWEX_TEXTUAL_SRCS = [
]
MINGWEX_ARM64_SRCS = [
+ "math/arm-common/powl.c",
"math/sincos.c",
"math/sincosf.c",
"math/arm-common/sincosl.c",
diff --git a/toolchain/args/windows/BUILD.bazel b/toolchain/args/windows/BUILD.bazel
index 8d28a93..f8f6d49 100644
--- a/toolchain/args/windows/BUILD.bazel
+++ b/toolchain/args/windows/BUILD.bazel
@@ -47,6 +47,7 @@ cc_args(
"-L{mingw_crt_library_search_path}",
# Clang will respect the user's chosen CRT variant.
+ "-lmingwex",
] + select({
"//constraints/windows/crt:msvcrt": [
# msvcrt.dll plus compatibility objects provided by mingw-w64.