From ca0dc49f64dee9579bcfb6ef2e9e6af90a23dd45 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Thu, 21 Nov 2024 23:28:58 +0100 Subject: [PATCH] Improve support for Windows cross compilation on targets with case sensitive file systems. --- msvc_build_libraries.py | 9 ++++++--- releasenotes.md | 1 + src/compiler/linker.c | 7 ++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/msvc_build_libraries.py b/msvc_build_libraries.py index ad6c8bded..98e368b0c 100755 --- a/msvc_build_libraries.py +++ b/msvc_build_libraries.py @@ -234,10 +234,13 @@ lib = list((OUTPUT / "VC/Tools/MSVC/").glob("*/lib"))[0] SDK_OUTPUT.mkdir(exist_ok=True) +def copy(src, dst): + shutil.copy(src, dst.lower()) + for arch in archs: out_dir = SDK_OUTPUT / arch - shutil.copytree(ucrt / arch, out_dir, dirs_exist_ok=True) - shutil.copytree(um / arch, out_dir, dirs_exist_ok=True) - shutil.copytree(lib / arch, out_dir, dirs_exist_ok=True) + shutil.copytree(ucrt / arch, out_dir, copy_function=copy, dirs_exist_ok=True) + shutil.copytree(um / arch, out_dir, copy_function=copy, dirs_exist_ok=True) + shutil.copytree(lib / arch, out_dir, copy_function=copy, dirs_exist_ok=True) print("Congratulations! The 'msvc_sdk' directory was successfully generated.") diff --git a/releasenotes.md b/releasenotes.md index 63ed30947..d08efcbc5 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -6,6 +6,7 @@ - Allow splat in initializers. - Init command will now add `test-sources` to `project.json` #1520 - `a++` may be discarded if `a` is optional and ++/-- works for overloaded operators. +- Improve support for Windows cross compilation on targets with case sensitive file systems. ### Fixes - Fix bug where `a > 0 ? f() : g()` could cause a compiler crash if both returned `void!`. diff --git a/src/compiler/linker.c b/src/compiler/linker.c index baf82ba14..60508eac6 100644 --- a/src/compiler/linker.c +++ b/src/compiler/linker.c @@ -47,11 +47,8 @@ static const char *ld_target(ArchType arch_type) default: error_exit("Architecture currently not available for cross linking."); } - } - - static void linker_setup_windows(const char ***args_ref, Linker linker_type, const char *output_file) { add_plain_arg(compiler.build.win.use_win_subsystem ? "/SUBSYSTEM:WINDOWS" : "/SUBSYSTEM:CONSOLE"); @@ -179,8 +176,8 @@ static void linker_setup_windows(const char ***args_ref, Linker linker_type, con linking_add_link(&compiler.linking, "ntdll"); linking_add_link(&compiler.linking, "user32"); linking_add_link(&compiler.linking, "shell32"); - linking_add_link(&compiler.linking, "Shlwapi"); - linking_add_link(&compiler.linking, "Ws2_32"); + linking_add_link(&compiler.linking, "shlwapi"); + linking_add_link(&compiler.linking, "ws2_32"); linking_add_link(&compiler.linking, "legacy_stdio_definitions"); // Do not link any.