From d2c99ebd85efc2e19adac2bf942fa0329f9d59a3 Mon Sep 17 00:00:00 2001 From: Rainer Date: Wed, 5 Aug 2026 08:36:24 +0200 Subject: [PATCH] fix #23524 - Cross-compiling to macos crashes on Windows missing call of MachObj_init --- compiler/src/dmd/glue/package.d | 10 +--------- compiler/test/compilable/objc_class.d | 5 ++++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/compiler/src/dmd/glue/package.d b/compiler/src/dmd/glue/package.d index 80f73770393b..568dc7cdee00 100644 --- a/compiler/src/dmd/glue/package.d +++ b/compiler/src/dmd/glue/package.d @@ -1259,15 +1259,7 @@ private void obj_start(ref OutBuffer objbuf, const(char)* srcfile) rtlsym_reset(); clearStringTab(); - version (Windows) - { - import dmd.backend.mscoffobj; - objmod = MsCoffObj_init(&objbuf, srcfile, null); - } - else - { - objmod = Obj.initialize(&objbuf, srcfile, null); - } + objmod = Obj.initialize(&objbuf, srcfile, null); OutBuffer buf; buf.write("DMD "); diff --git a/compiler/test/compilable/objc_class.d b/compiler/test/compilable/objc_class.d index 57d4b0d6cfde..45c3db67c8f0 100644 --- a/compiler/test/compilable/objc_class.d +++ b/compiler/test/compilable/objc_class.d @@ -1,4 +1,7 @@ -// EXTRA_OBJC_SOURCES: +// also check cross compilation, ensure targeting 64-bit +// REQUIRED_ARGS: -m64 -os=osx +// doesn't compile with mingw option -mscrtlib=msvcrt120 +// DISABLED: win32 import core.attribute : selector;