Skip to content

fix #23524 - Cross-compiling to macos crashes on Windows - #23525

Open
rainers wants to merge 1 commit into
dlang:stablefrom
rainers:issue23524
Open

fix #23524 - Cross-compiling to macos crashes on Windows#23525
rainers wants to merge 1 commit into
dlang:stablefrom
rainers:issue23524

Conversation

@rainers

@rainers rainers commented Aug 5, 2026

Copy link
Copy Markdown
Member

missing call of MachObj_init

Not urgent, but also low risk for stable.

Comment thread compiler/test/compilable/objc_class.d Outdated
@@ -1,4 +1,5 @@
// EXTRA_OBJC_SOURCES:
// also check cross compilation
// REQUIRED_ARGS: -os=osx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// REQUIRED_ARGS: -os=osx
// REQUIRED_ARGS: -target=x86_64-apple-darwin

This should fix the problems on 32-bit (i686 macOS not supported anymore), and also hopefully avoids problems for LDC (no -os support for ldmd2, only -target). DMD doesn't seem to support macos as OS, only osx (non-standard AFAIK) and darwin.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh well, on the other hand LDC would only be testing this for that one target, incl. when running on macOS arm64 natively, so that's not ideal. So maybe PERMUTE_ARGS?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used -target=x86_64-darwin at first, but that conflicts with -m32 that is added to the command line.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, that additional annoyance...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overwriting -m32 with a required -m64 seems to work

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me, I'll remove these REQUIRED_ARGS then for LDC, no point in using it as cross-compile smoke test there.

version (Windows)
{
import dmd.backend.mscoffobj;
objmod = MsCoffObj_init(&objbuf, srcfile, null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this seems to be the only call of that function?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call is hidden in the mixin at

mixin(genRetVal("init(objbuf, filename, csegname)"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants