-
Notifications
You must be signed in to change notification settings - Fork 37
Support building cross compilers #177
Comments
The relevant wiki items are: |
See also these And from the toplevel |
@thomie thanks so much for adding the links.
(from the Makes me wonder if one might want to explicitly tell the build that one is using the exactly same version to build the cross compiler. E.g. say you build a full stage2 compiler from source and use that to build the cross compiler. In that case, I don't see why one could not use stage0's ghc library. Of course in the general case, it's too old. |
I guess that looking at the GIT commit should be enough to decide it. Em domingo, 17 de janeiro de 2016, Moritz Angermann <
|
For porting GHC it's also very good to have an option to build stage2 compiler while cross-compiling. You will then be theoretically able to move ghc-stage2 to the target platform and use it as a native compiler... |
@kgardas for porting certainly. But technically I don't consider a stage2 compiler a cross compiler anymore, as it targets the same platform it runs on. |
Tried a few times but never succeeded in building GHC Stuck:
which is similar to https://ghc.haskell.org/trac/ghc/ticket/11058 Also tried lower versions, but failed for some other confusing reasons. @bgamari @angerman Is there any suggestion what cross-compile setup for |
@izgzhen That looks like with GCC. You need a |
Added a
Tried adding If I add
|
@izgzhen so I was working with Nix, and I just modified the shell script wrapping gcc to include the flag. I think the key difference here is that made sure that the flag always got to the gcc targeting the target platform, and never to the "build cc" gcc targeting the host platform. My guess is your second error is that latter gcc being confused. |
Hmm...so you wrapped But this doesn't quite work for me. I think my
|
Odd. Perhaps your tool chain actually was built targeting different 32-bit arm variant? |
Aha, I found it. Grepping give me |
I have no idea why my |
Try putting armv7a (no dash now) in the triple. |
Still not working: I added several wrapper like below:
and
|
Solved the
And according to GCC ARM options:
|
I believe the previously failed |
I suspect you need to instead pass |
Being curious, I just tried
It sounds like |
The above wasn't actually caused by a missing |
This applies to both build systems alike, but I now understand there are |
I've been hacking on this from time to time in the past month, but it turns out to be quite difficult to take care of. I'll keep working on this, but it might take longer than I initially anticipated. The first problem is that after #380, the "size doesn't match" in #349 is not solved by that in fact. I compared and tweaked the command line arguments for a long time, but it never worked so well. |
#401 has given us a working compiling GHC tested on one emulated ARM platform, but it is still crude and needs a lot of polishing. I'll collect the bits needed to be done in future here:
|
The above tidbits are all checked, and the remaining few issues are filed as described above. I think we can close this issue now. Cc @snowleopard |
maybe after #410 is merged |
I'll close it since #410 is done. |
We basically need to build the
stage1
compiler and then buildall the libs using the
stage1
compiler, but we do not need tobuild the
stage2
compiler, as thestage2
compiler would runon the
target
, which we do not intend to do.The text was updated successfully, but these errors were encountered: