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

musl support #325

Merged
merged 1 commit into from
Dec 2, 2023
Merged

musl support #325

merged 1 commit into from
Dec 2, 2023

Conversation

lrvick
Copy link
Contributor

@lrvick lrvick commented Nov 28, 2023

Simple patch to add musl support.

There is no reliable way to detect musl I am aware of, but we can detect glibc which defines _USE_GNU, then we fall back to musl.

This successfully builds on alpine.

LMK if this approach works for you, and I can at least take a look at CI.

Linking #324

@thepowersgang
Copy link
Owner

Well, it passes CI.
I assume that you've tested it with your own musl setup?

@lrvick
Copy link
Contributor Author

lrvick commented Nov 30, 2023

It works in alpine's musl, though for some reason not with my own build of musl, which is likely a problem on my end I am currently debugging still.

 (50.0% 1r,0w,0b/2t): proc_macro v0.0.0
:0:0 warn:0:Multiple panic_runtime crates loaded - panic_abort-0_0_0 and panic_unwind-0_0_0
/usr/lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/ld: output-1.54.0/libstd.rlib.o: in function `ZRG3cD15std0_0_0_H190003sys4unix5cvt_r2gCfG1c_AH18closureI_open_c_840g':
libstd.rlib.c:(.text.ZRG3cD15std0_0_0_H190003sys4unix5cvt_r2gCfG1c_AH18closureI_open_c_840g+0x41): undefined reference to `open64'
/usr/lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/ld: output-1.54.0/libstd.rlib.o: in function `ZRG4cD15std0_0_0_H190003sys4unix2fs5lstat0g':
libstd.rlib.c:(.text.ZRG4cD15std0_0_0_H190003sys4unix2fs5lstat0g+0x8e): undefined reference to `lstat64'
collect2: error: ld returned 1 exit status
C Compiler failed to execute - error code 256

@lrvick
Copy link
Contributor Author

lrvick commented Dec 1, 2023

Confirmed the above was related to gcc13 removing automatic includes of stdint, which was fixed in later versions of rust. We will need to backport a patch to make rust 1.54 libstd compile with gcc13 but a non issue for this PR.

I have now confirmed builds both in alpine and my own from-scratch musl-based distro with musl 1.2.4 and GCC12.

@thepowersgang thepowersgang merged commit 6cc28a5 into thepowersgang:master Dec 2, 2023
8 checks passed
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.

None yet

2 participants