-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
howto cross-compile to get to work for powerpc e500v2 #117361
Comments
You are using a tier 2 target. Can you compile any programs successfully? It's not clear to me from your description that this is not a miscompile. |
@saethlin nope, no programs seems to runs on the |
Try |
I'm confused, you said QoriQ, but then you said you're targeting MPC8548? Which is it? No, they're not necessarily guaranteed to be compatible: ignore the vendor's claims otherwise and approach this empirically. |
You use a vendor-provided (and thus possibly patched?) gcc, so it seems plausible to me that LLVM might have a different model of the CPU capabilities. Can you use clang to build, instead of gcc, for this target, and get working binaries? Or even a stock gcc? You also made a typo: |
Indeed, Synology provide a GCC toolchain for each arch. The
That would require me to build a clang (or gcc) cross-compiler for this arch? Probably feasible but, I did try in the past using gcc in order to have a newer (and identical) version for all targets but I did not managed to assemble all the pieces together properly... |
LLVM-based compilers are always cross-compilers, that I've seen? You can use an x86_64-linux clang, or likewise for rustc, to emit code for PowerPC. The usual clang builds include codegen components for all their supported targets, I think. |
Regarding this: do they patch it? |
No clue. And I was reviewing our own native llvm build that we provide part of synocli-devel package, we're dropping down to version 9 of llvm for archs that uses gcc <= 5.1... Which includes |
Rust ships LLVM 17. |
GCC is a GPL project, so if you have been given the software, you also have the right to demand the source code, including its patches. ( also if you saw any messages between this and "Rust ships LLVM 17" from me: I'm blaming them all on the cat finding a few macro-commands and the enter key. ) |
@workingjubilee so while my cycles where rather limited I did manage to make a bit of mileage over the last month... In my current PR SynoCommunity/spksrc#5879 I was able to automate building a rustc compiler supporting Why you might ask? because it hapens that resulting binaries contains So now in one hand I do have a rustc compiler with tier 3 But sadly the end-result binaries still contains Question I have, what am I missing? If someone else stumbles on this and wonder howto:
Where my config file refers to Synology toolchain tools:
|
@workingjubilee and @saethlin and @wycats I believe I have found where the issue is ... When building my The rust toolchain do build just fine, but I noticed that
My theory is that when building any software afterward and linking to these libraries, it will necessarely fail as result holds incompatible Now why? I am providing the necessary
Help would be much appreciated, thnx in advance! |
Support for |
@glaubitz perhaps you can assist in providing me hints as to why things are not working out? quick background, synocommunity is spksrc framework github project to build package for Synology NAS on multiple archs (armv5, v7, v8, x86_64, ppc, etc). All other archs are well supported from a rust point of view with the exception of qoriq being a powerpc gnuspe tier 3 target. My current PR in order to support rust for qoriq is SynoCommunity/spksrc#5879 To build rust support I'm using Synology DSM 6.2.4 toolchain for that specific arch. Toolchain bundle file is located here https://sourceforge.net/projects/dsgpl/files/Tool%20Chain/DSM%206.2.4%20Tool%20Chains/PowerPC%20QorIQ%20Linux%202.6.32/qoriq-gcc493_glibc220_hard_qoriq-GPL.txz/download gcc provided part of the toolchain is Configuration file I'm using is the following:
Arch gcc specific flags we've been using since ever are Hopefully what I'm missing is obvious... but your help would be more than welcomed ... |
This relates to SynoCommunity spksrc project to build and package various open source software to run on Synology NAS.
I've been running into an issue where rust code cross-compiled for powerpc arch segfault (more specifically
qoriq
). The exact same code builds perfectly fine for all other archs (armv5, v7, aarch64, x86_64, i686). Ref: SynoCommunity/spksrc#5847 SynoCommunity/spksrc#5684I've took two different approaches:
RUSTFLAGS
to reproduce our CFLAGS used-mcpu=8548 -mhard-float -mfloat-gprs=double
SynoCommunity/spksrc@90ad41dpowerpc-unknown-linux-gnuspe
<<-- testing code only in my local branch for nowoption 1
Using default
powerpc-unknown-linux-gnu
along withRUSTFLAGS = -Ctarget-cpu=e500
lead to the exact same result, seftault at startup. I may not be using the right RUSTFLAGS?option 2
As for option 2 I feel I'm digging my own hole as I'm unable to build a
powerpc-unknown-linux-gnuspe
target using Synology provided toolchain and toolkit. I'm able to build up to stage1 & stage2 but unable to create a fully working target using cargo along with either my stage1 or stage2 builds... (clearly there is something I'm not fully understanding). Here's what I have so far:Where it then fails:
The error relates to llvm (enven though it did built it succesfully during either stage1 or stage2):
option 3
Now, further reading and as option 3 I may be able to "rebuild" tier 1
powerpc-unknown-linux-gnu
by adding the proper target features such as #117347 . But guessing I'd have to run through the same procession as option 2 ?The text was updated successfully, but these errors were encountered: