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
[SR-124] Port Swift to Linux x86 32-bit #42746
Comments
Comment by Isaac Gouy (JIRA) Yes please, there still is an Ubuntu 15.10 labelled: "32-bit – for machines with less than 2GB RAM" |
Comment by Vivek Pandya (JIRA) I am starting with setting up required development environment and compiling swift on 32 bit ubuntu 14.04 LTS. |
Comment by Vivek Pandya (JIRA) I change build-script-impl so that I can build for Linux-i686 case. It successfully build cmark , llvm . But it can not link clang . I used gold instead of ld but I came to know that mmap is not able to allocate a huge memory area around 1.5GB while linking , so linking of clang 3.8 failed. |
Enabling hugepages in the kernel won't solve the issue, you also need a linker that can make use of them. I think you can achieve success in this project easier with cross-compilation from a 64-bit kernel. You'd need to cross-compile swift compiler itself, and the libraries. The swift compiler would be native 32-bit. |
Comment by Vivek Pandya (JIRA) I have read about similar problem for android-kernel compilation and for them hugepages has solved the issue. The gold linker may use it.
|
They won't be compiling it, they would be using a pre-compiled package. |
Comment by Vivek Pandya (JIRA) For cross compiling should I temporarily set NATIVE_TOOLS_DEPLOYMENT_TARGETS = linux-i686 ? I read in the build-script-impl that for cross compiled tools it will compile for 2 times. |
Comment by Vivek Pandya (JIRA) while Cross compiling through 64 bit kernel I am getting error. It compiles llvm cmark and swift successfully for x86_64 arch but then it tries to build for i686 arch and llvm still refers to macosx version of table-gen due to this code:
|
vivekvpandya (JIRA User), can you tell me the exact invocation you used to cross-compile? I'd like to work on getting rid of those FIXMEs in the build script, and it would help to know exactly which arguments you're passing it. Thanks! |
Comment by Vivek Pandya (JIRA) Hi Brain Ivan Gesiak , |
> If you want to see other changes I can post changed build-script-impl code to gist. Please do! Would love to get on the same page. |
Comment by Vivek Pandya (JIRA) here is my build-script-impl gist https://gist.github.com/vivekvpandya/371ea611ab03c9bfc35b |
Thanks, vivekvpandya (JIRA User)! Just a note: you can specify $ utils/build-script -R -- --cross-compile-tools-deployment-targets="linux-i686" I don't have any insight on the rest of your changes. I'm also interesting in supporting cross-compilation in the build script--we should exchange notes here or in a new issue. |
Comment by Vivek Pandya (JIRA) I see that you are working on merging build-script and build-impl-script. I will give one more try to cross-compile. In mean time let me know if I can help you in merging build-script , build-impl-script. |
Comment by Vivek Pandya (JIRA) If any one trying to cross-compile swift for 32 bit Linux from 64 bit version , I would suggest to download 32 bit version of libstdc++ and other required libs and make sure that clang -m32 is able to compile and link a 32 bit ELF binary. |
Comment by Chris Donnelly (JIRA) Can anyone confirm otherwise? My understanding is there is still no i686 build in the wild, and that current build functions fail ungracefully for these machines. The current comments here from January do not seem to assist in 3.0 release. Would love to see the releases broaden to support both 32bit linux and ppc to name just two. |
Comment by Maksim Rogov (JIRA) Would like to see a 32bit port as well. |
Comment by Lescai Ionel (JIRA) Any news on this? |
Comment by Lescai Ionel (JIRA)
Got it working with apple/swift from December and latest libdispatch repo. Have errors after from master, but I'll tackle them after I make a PR with the current changes. |
Comment by Rex Fenley (JIRA) ionel.lescai (JIRA User) any updates? Did your PRs make it through? |
Comment by Lescai Ionel (JIRA) rexmas (JIRA User), no. Haven't had time to work on it anymore. Here's the PR: apple/swift-corelibs-libdispatch#345 ... Didn't have a chance to make PRs for my changes on apple/swift, and they didn't work with HEAD anyway 🙁 Here's my branch: https://github.com/ionel71089/swift/tree/ubuntu32 |
Comment by Rex Fenley (JIRA) Ah, thanks for sharing. I haven't worked with the compiler before, but I'll take a look and see if I can do anything useful, worth a shot. |
Additional Detail from JIRA
md5: 38bf3e8bffbcd48ecf45dbb1c6996fe5
Issue Description:
Right now Swift only targets 64-bit x86. A 32-bit port might be interesting.
The text was updated successfully, but these errors were encountered: