-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
FreeBSD/arm support #976
base: master
Are you sure you want to change the base?
FreeBSD/arm support #976
Conversation
@mflatt I was told you might want to take a look at this PR. Thanks. |
I've merged this change, but I'd like to leave the PR open until I can investigate the JIT crash. Does the build crash attempting to run |
When running racketcgc. I did not gather any debugging information yet... |
My attempts to run FreeBSD on an ARM machine (Raspberry Pi) haven't worked out, so far. In case the problem is easy to track down, can you try starting |
The Raspberry Pi probably doesn't have enough RAM (depending on the model). What problems did you have? I made a mistake and my BeagleBone is offline now, but I will try to debug this once it's back up. |
I couldn't get it to boot after |
Are you using an image from ftp.freebsd.org? It was suggested on IRC that the SD card might be failing. The RPI is very picky about SD cards... Can you try a different SD card? |
Yes, I tried from ftp.freebsd.org. I tried a couple of SD cards, including a SanDisk (which I think I saw recommended somewhere), but that could still be it. |
It seems like the JIT is generating an invalid instruction:
|
These instructions don't make a lot of sense... More debugging tomorrow.
|
You'll probably have to tell gdb explicitly to decode Thumb instructions with Since it's an illegal-instruction error, which may mean the JIT is generating the wrong instructions for your machine, what does Thanks for your help! |
Our gdb is quite old, so it doesn't have that option... Maybe you're right and it's a Thumb instruction that this gdb can't parse.
|
The preprocessor output says that Thumb is not supported, so the JIT shouldn't generate Thumb instructions, anyway. I see that "racket/src/racket/src/lightning/arm/asm.h" doesn't specifically recognize |
That didn't help. :( |
I got FreeBSD running on an RPI2. Unfortunately, the JIT seems to work in that configuration, so I'm still stuck on this problem. |
How are you enabling the JIT? In sconfig.h? The processor on the BeagleBoard is similar to the one on the RPI2, so it's likely that I made a mistake. |
I added It should work the same to add the definition in "sconfig.h", though. I had to install libffi, because the sources bundled with Racket didn't build. Did you install libffi via the package manager, too? |
Yup, installed libffi and used roughly the same configure arguments as you did (you made a mistake in -DMZ_USE_JIT_I386, right?). I used the port arguments: env CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib configure --disable-lt --enable-shared --enable-pthread |
Can you email me your racketcgc binary? |
Good idea: http://www.cs.utah.edu/~mflatt/tmp/racketcgc |
That crashes exactly the same way. Guess there's something special about this CPU... |
It's possible that the JIT is generating instructions that fall outside the spec, where different processors treat the undefined behavior in different ways. That has happened one time before. In that previous case, though, we were able to get disassembly from gdb to help track down the problem. In this case, since the disassembly at the crash point doesn't make sense, it seems more likely that a jump is going wrong. Does a It's a long shot, but what if you change |
A bit different:
However, this is the same crash:
|
I'm not working on this anymore. Shall we close? |
The arrival of Racket CS seems like a good reason to close this. |
These changes enable compilation on FreeBSD/arm. The ARM JIT compiler doesn't work on this platform (it crashes, I did not investigate).