Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure CI: Use mimalloc for Linux and macOS packages #3759

Merged
merged 2 commits into from
Jun 22, 2021

Conversation

kinke
Copy link
Member

@kinke kinke commented Jun 12, 2021

No description provided.

@kinke
Copy link
Member Author

kinke commented Jun 12, 2021

For Windows, the trade-off is that we'd have to link ldc2.exe against the shared MSVC++ runtime, meaning that using it would newly require an installed MSVC++ runtime (not sure if the one from VS 2015 would suffice (which might come with Win10), or whether it'd have to be the 2019 one). I'm a bit sceptical.

@kinke
Copy link
Member Author

kinke commented Jun 12, 2021

@JohanEngelen: Have you tried it on macOS as well? Does it need some extra CMake option there?

@JohanEngelen
Copy link
Member

I've only tried it on Linux. I know that Orip at Weka also had similar problems on macOS (Aborting from rt/sections_elf_shared.d(195) Could not determine TLS range). The documentation, https://microsoft.github.io/mimalloc/overrides.html, is not so clear about whether it should work on macOS or not (static.c does look like it supports macOS though).

@jacob-carlborg
Copy link
Contributor

I know that Orip at Weka also had similar problems on macOS (Aborting from rt/sections_elf_shared.d(195) Could not determine TLS range)

I'm not sure if it's related or not, but implementation to get the TLS range on Darwin is using malloc_size. If malloc_size is not overridden (according to https://microsoft.github.io/mimalloc/overrides.html, it looks like it's not), it might cause problems.

@kinke
Copy link
Member Author

kinke commented Jun 19, 2021

[It's apparently working fine now with the MI_OSX_ZONE CMake option, but I have no idea what it does.]

@JohanEngelen
Copy link
Member

As new v1.7.2 seems to fully support it now according to their changelog.
@kinke kinke changed the title Azure CI: Use mimalloc for Linux and macOS x64 packages Azure CI: Use mimalloc for Linux and macOS packages Jun 20, 2021
@kinke
Copy link
Member Author

kinke commented Jun 20, 2021

@p0nce: It'd be awesome if you could download the macOS arm64 artifact and give it a quick whirl (any little module should do), to check whether they really fixed the M1 issues in the latest version.

@p0nce
Copy link
Contributor

p0nce commented Jun 20, 2021

@kinke can do before 23h CEST , I'm not at home right now

@kinke
Copy link
Member Author

kinke commented Jun 20, 2021

Perfect, thx, no hurry.

@p0nce
Copy link
Contributor

p0nce commented Jun 21, 2021

  • both macOS artifacts (x86_64 and arm64) pass intel-intrinsics test
  • both macOS artifacts (x86_64 and arm64) can build a working hello world
  • for some reason I have trouble building a shared library with the arm64 native LDC, but the x86_64 works for both target
  • for the arm64 LDC, you need to use the provided DUB else it will fail
    So all in all I'd say no problem with these artifacts.

@kinke
Copy link
Member Author

kinke commented Jun 21, 2021

Thx a lot for testing Guillaume.

for some reason I have trouble building a shared library with the arm64 native LDC

Care to elaborate a bit? I can't imagine this having anything to do with the allocator here (and would expect the same issue with v1.27.0-beta1, maybe related to LLVM 12), but I'm still interested.

@p0nce
Copy link
Contributor

p0nce commented Jun 22, 2021

Yes, probably unrelated.
My build log finish with: https://pastebin.com/raw/xk73aLdy
There are mentions of x86_64 even though everything was built with -mtriple=arm64-apple-macos
No such problem with the cross-compiler artifact.

@kinke
Copy link
Member Author

kinke commented Jun 22, 2021

Okay that looks like your Apple clang for linking somehow defaults to x64 here, probably requiring an explicit -Xcc=-target -Xcc=arm64-apple-macos in the LDC cmdline.

@kinke kinke merged commit cc3826d into ldc-developers:master Jun 22, 2021
@kinke kinke deleted the mimalloc branch June 22, 2021 16:42
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.

4 participants