Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Downgrade GMP to 6.2.1 due missing symbols #3

Merged
merged 1 commit into from
Apr 28, 2024
Merged

Conversation

luislavena
Copy link
Owner

Appears when combined with Zig for cross-compilation, v6.3.0 of GMP reports missing symbols when targetting x86_64 and aarch64 Linux musl.

This is not present when cross-compiling to macOS versions or when compiling natively (using cc from hydrofoil-crystal), which is even weirder considering that hydrofoil-crystal 1.11 and 1.12 already uses v3.19 of Alpine as base and that was already using GMP v6.3.0.

Downgrading until I can investigate this further.

cc @zw963

Appears when combined with Zig for cross-compilation, v6.3.0 of GMP
reports missing symbols when targetting x86_64 and aarch64 Linux musl.

This is not present when cross-compiling to macOS versions or when
compiling natively (using `cc` from hydrofoil-crystal), which is even
weirder considering that hydrofoil-crystal 1.11 and 1.12 already uses
v3.19 of Alpine as base and that was already using GMP v6.3.0.

Downgrading until I can investigate this further.
@luislavena luislavena merged commit 188d75a into main Apr 28, 2024
2 checks passed
@zw963
Copy link

zw963 commented Apr 28, 2024

It works, thank you!

@zw963
Copy link

zw963 commented Apr 28, 2024

One more advice about gem update.

Since we drop version from macOS targets, Can we use same name as Crystal target name instead?

Rename:

x86_64-apple-darwin -> x86_64-darwin
aarch64-apple-darwin -> aarch64-darwin

Because the left linux target name same as Crystal target too, this will be more consistent.

@luislavena
Copy link
Owner Author

I'm not sure I understand your request: the Linux target is arch-linux-musl. The macOS target is arch-apple-darwin and that is what is passed to Crystal as platform.

@luislavena luislavena deleted the downgrade-gmp branch April 28, 2024 17:48
@zw963
Copy link

zw963 commented Apr 29, 2024

I'm not sure I understand your request: the Linux target is arch-linux-musl. The macOS target is arch-apple-darwin and that is what is passed to Crystal as platform.

Please check Crystal platform definition in official document. (check following screenshot too)

image

there is no -apple- in the middle for the macOS target

@luislavena
Copy link
Owner Author

@zw963 that seems inconsistent to what crystal version and the platform triplet processing does:

$ crystal version
Crystal 1.12.1 (2024-04-11)

LLVM: 18.1.4
Default target: aarch64-apple-darwin23.4.0

And normalization is done by LLVM:

So: not planning on dropping -apple- from the platform triplet, (arch, vendor, operating system), independently of what Crystal shows on their tiers options as I'm not following Crystal's usage (which is inconsistently showing darwin in one side, then macOS in another).

@luislavena
Copy link
Owner Author

As I said on the Crystal forums post: you're welcome to grab this code and adapt to your needs, if you want it named differently, be my guess and modify it on your own for your own purpose and usage, you're not forced or obligated to share these changes back.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants