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 support for loongarch64 #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wuruilong01
Copy link

Failed to compile on debian, this PR solves the problem. Link to detailed error cause: https://buildd.debian.org/status/fetch.php?pkg=haskell-termonad&arch=loong64&ver=4.5.0.0-1&stamp=1713881680&raw=0

@cdepillabout
Copy link
Owner

@wuruilong01 Thanks for letting me know about this.

Could you give me more information about this? What's loong64?

It appears that the build error from the page you've linked is saying that the test suite can't be run because the -N RTS option doesn't exist. Is this only a problem for the test suite (which would be unexpected...)? Or is the actual binary affected by this as well?

I was (naively?) under the impression that all platforms supported the -N RTS option. Are there other platforms that don't support it?

@wuruilong01
Copy link
Author

LoongArch is a new RISC ISA, which is independently designed by Loongson Technology. LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit version (LA32S) and a 64-bit version (LA64).

Loongson and LoongArch documentations:
https://github.com/loongson/LoongArch-Documentation

The ISAs, ABIs and OS we support are:
ISA: LoongArch64
ABI: LP64d
OS: Linux

Open-source tool chain (Binutils, Gcc and glibc) are already upstream.

@wuruilong01
Copy link
Author

I was (naively?) under the impression that all platforms supported the -N RTS option. Are there other platforms that don't support it?

I didn't do much experimenting, but saw the data and the connections are as follows:https://github.com/commercialhaskell/stack/issues/680

@cdepillabout
Copy link
Owner

It appears that the build error from the page you've linked is saying that the test suite can't be run because the -N RTS option doesn't exist. Is this only a problem for the test suite (which would be unexpected...)? Or is the actual binary affected by this as well?

I was (naively?) under the impression that all platforms supported the -N RTS option. Are there other platforms that don't support it?

Do you have any thoughts on these questions?

I'm somewhat reluctant to add more conditionals to the cabal file to support an architecture I don't use and I have never heard of. But if this is a common thing, I'm willing to think about it. What do other projects do here? I would have expected that most Haskell projects (that are shipping an executable) set the -N RTS option.

I skimmed through commercialhaskell/stack#680, but at least the first couple posts are talking about how -N doesn't work well on machines with high numbers of cores. It sounds like you're more talking about an architecture that just doesn't have the -N option at all for GHC.

@wuruilong01
Copy link
Author

Since loongarch is already supported by the open source toolchain(Binutils, Gcc and glibc), I think it is a mature architecture and it makes sense to support loongarch.
When supporting other ghc-related packages for debian, I have also encountered many architectures(arm, riscv) that commonly choose to block the -N RTS option, linked below: https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1069701;filename=add- support-for-loong64.patch;msg=5

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