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

Add s390x build #55

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add s390x build #55

wants to merge 2 commits into from

Conversation

perklet
Copy link
Collaborator

@perklet perklet commented Mar 13, 2024

No description provided.

@bjia56
Copy link
Collaborator

bjia56 commented Apr 12, 2024

I've tried looking at using Zig to build for s390x on a different project, but wasn't successful. The compiler support isn't fully working. Perhaps it would be a better short term solution to have curl_cffi sdists compile libcurl-impersonate from source if it cannot find a precompiled binary?

@perklet
Copy link
Collaborator Author

perklet commented Apr 12, 2024

That would require quite a lot of dependencies for compiling.

@bjia56
Copy link
Collaborator

bjia56 commented Apr 12, 2024

True, though in most cases it wouldn't be necessary since the prebuilts can be downloaded. I'm thinking it'd only require the dependencies on less commonly used platforms.

Alternatively, could skip using Zig for this and compile with system gcc on a s390x container, emulated via docker/qemu. I'm not sure what the minimum glibc is on s390x so it might not be necessary to use Zig just for pinning 2.17

@bjia56
Copy link
Collaborator

bjia56 commented Apr 12, 2024

According to this, s390[x] glibc had an abi breakage in 2.19, so that might be a safe minimum to aim for.
https://lwn.net/Articles/605607/

@bjia56
Copy link
Collaborator

bjia56 commented Apr 12, 2024

Tried again to use Zig (to compile cpython) targeting s390x, it looks like the built-in llvm 17's linker does not support elf64_s390 and that was added in llvm 18. Until Zig upgrades llvm again, I would think a viable short-term solution is to use the gcc s390x cross compilation toolchain.

@bjia56
Copy link
Collaborator

bjia56 commented Apr 12, 2024

It probably would have worked if zig cc supported using a different linker, but unfortunately that capability was intentionally omitted

@bjia56
Copy link
Collaborator

bjia56 commented Oct 17, 2024

@perklet mind if I take over on this PR? Latest zig nightly builds appear to have enough s390x support for a successful Python interpreter build, so I think this can also proceed

@perklet
Copy link
Collaborator Author

perklet commented Oct 17, 2024

Thanks! assigned to you.

@bjia56
Copy link
Collaborator

bjia56 commented Oct 17, 2024

Unfortunate discovery: boringssl has no s390x support and has historically rejected patches to add support: https://boringssl-review.googlesource.com/c/boringssl/+/37544/1

I think there's nothing more we can do here until boringssl project revisits that decision, or there's a suitable replacement.

@bjia56
Copy link
Collaborator

bjia56 commented Oct 17, 2024

A possible option is to switch to this for just the s390x build: https://github.com/linux-on-ibm-z/boringssl/tree/patch-s390x-Aug2023

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.

2 participants