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

Cannot boot Nim on Loongarch64 #24118

Open
litlighilit opened this issue Sep 16, 2024 · 3 comments
Open

Cannot boot Nim on Loongarch64 #24118

litlighilit opened this issue Sep 16, 2024 · 3 comments

Comments

@litlighilit
Copy link
Contributor

Description

Loongarch64 linux support was once added, but currently I'm trying to compile Nim on it but it failed on csource_v2's build.

Nim Version

2.1.99 (source code)

Current Output

Error: no C code generated for: [Linux: Loongarch64]

Expected Output

(compile)

Known Workarounds

After a large time of search and exploring, I've finally make a built Nim on Loongarch64, but in a very ungraceful way:

As loongarch64 is always little endianess, and it used to be mips compatible.

I tried to manually modify csources_v2/makefile (of course later I found this file is generated by tools/niminst/makefile.nimf, and that's why I report issue here instead of csources_v2 repo)

and copied mips64el's build code for loongarch64.

In this way Nim compiles.

Additional Information

One thing to note is that maybe due to my mistake when manual modifying, the built Nim's configure rrally becomes as if on mips64el...

I've run kock test locally in this Loongarch64 mechine, and it only failed 3 tests currently.

(at least one of them is due to the problem mentioned above)

@litlighilit
Copy link
Contributor Author

litlighilit commented Sep 16, 2024

Any more info can be provided if required.


In fact I once thought I was close to solve it, till I found the building script(makefile) was generated instead of hand-writting...

@ringabout
Copy link
Member

@litlighilit It seemed to be fixed by #23672 you may try koch csource

@litlighilit
Copy link
Contributor Author

litlighilit commented Sep 17, 2024

Well, partly fixed.

But things in csource_v2 repo hadn't been updated along with that pr.

So still cannot compile.

We need upload c_code which is for loongarch64 in csources_v2.

Finally users on loongarch64 can use c_code (of course users only need to run ./build_all.sh after c_code was once generated) to compile a new Nim of current version.


P.S.
I was going on this progress but unfortunately I had to leave my loongarch64 mechine for a while... So currently I may not finish it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants