-
Notifications
You must be signed in to change notification settings - Fork 50
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
mips64 support #54
Comments
There was some weird black magic involved with forcing ARCH_ELFSIZE=32. You better ask [email protected] if you want to change it. Why do you force -fPIC? Isn't it better to force MKSTATICLIB=no? |
The black magic seems to be less so, its simply the rumpkern Makefile unconditionally setting it and the lack of _LP64 meaning a condition sets it wrong, its much cleaner than before. I seem to remember the -fPIC was due to some MIPS instruction set oddness, will check again, once I find out why everything segfaults... |
without -fPIC you get
SO looks like something was compiled without -fPIC that should be... |
If can propose changing the ARCH_ELFSIZE on some NetBSD list (e.g. port-mips) and nobody objects, I can change it. For the second one, note that the shared lib is being build from the .a, not the _pic.a. bsd.own.mk claims:
So would be interesting to know, why this doesn't hold. You compiler doesn't use abicalls? |
ARCH_ELFSIZE is correctly defined elsewhere in src/sys/arch/mips/include/elf_machdep.h it is only sys/rump/librump/rumpkern/arch/mips/Makefile.inc that has it wrong. src/sys/arch/mips/include/elf_machdep.h:
So adding the same ifdef to librump seems trivially correct... |
On the -fPIC issue it seems the correct thing is to add -mabicalls instead, which is not the default. Testing this. |
Well, there was some big lossage with ARCH_ELFSIZE, and note that the Makefile definition postdates the ARCH_ELFSIZE stuff in elf_machdep.h Anyway, ARCH_ELFSIZE should only affect code which grovels with ELF data structures. |
There is some code that uses ELF data structures somewhere, although most of the errors are just about redefinitions. What do you mean "big lossage"? |
-mabicalls without -fPIC still doesn;t work... suspect MKPICLIB=yes may be better behaved... |
I don't quite remember the details, it was >4 years ago. I think some builds broke due to assumptions that the mip64 code made. Hard to say what's the right way to proceed with the PIC libs, I don't know enough about the MIPS ABIs, and my copy of See MIPS Run is in a box !here. |
Fixed issues with big endian mips. I think merging the mips and mips64 selection code in buildrump.sh probably sane. |
I should put my notes into this ticket... not sure where I put them. The ARCH_ELFSIZE thing is a weird mips-ism, whereby they use 32bit elf format is used on 64 bit kernels for booting reasons, a process that requires some munging. This makes no real sense for rump, which should just use the normal platform elf, so it needs some rump conditionals to fix. The PIC issues are due to historical issues where all mips code is supposed to be PIC anyway, so you do not need to build special pic/nopic object files. But your (non Netbsd) host may not be set up to actually build fully pic, hence the flags tweaking which is also on 32 bit, where -fPIC is added. |
Building machine-level atomic ops would be nice too, but don't think it's strictly speaking required for support (see list in rumpkern/Makefile.rumpkern) |
I am not convinced that the toolchain I currently have on my mips boxes generates working mips64 code, I think I need to experiment with a mips64 native build. However the following patch lets it compile:
|
Now seems close to working
Expects to have _LP64 defined so need along the lines of (plus for big endian)
sys/rump/librump/rumpkern/arch/mips/Makefile.inc always defines ARCH_ELFSIZE=32 should be like sys/rump/librump/rumpkern/arch/powerpc/Makefile.inc which tests for which one to use.
However patching for those all the tests are segfaulting so something else is wrong.
The text was updated successfully, but these errors were encountered: