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

ldrex and strex instructions unsupported on (some) aarch32 #4955

Closed
bremner opened this issue Mar 21, 2024 · 8 comments
Closed

ldrex and strex instructions unsupported on (some) aarch32 #4955

bremner opened this issue Mar 21, 2024 · 8 comments
Labels
arch:aarch32 Problems related to Aarch32 (arm32) architecture build Build failures, Makefiles, Zuo scripts, autoconf, building instructions, etc. upstream

Comments

@bremner
Copy link

bremner commented Mar 21, 2024

What version of Racket are you using?

8.12 on

model name : ARMv7 Processor rev 2 (v7l)
Features        : half thumb fastmult vfp edsp thumbee vfpv3 tls idiva idivt vfpd32 lpae

This might be related to the fact that our only aarch32 machines are actually aarch64 machines
in emulation mode.

What program did you run?

./configure --enable-pb --enable-mach=tpb32l

or

./configure

What should have happened?

the build should complete

If you got an error message, please include it here.

/tmp/ccgkTVKT.s: Assembler messages:
/tmp/ccgkTVKT.s:1129: Error: selected processor does not support `ldrex r12,[r1]' in ARM mode
/tmp/ccgkTVKT.s:1132: Error: selected processor does not support `strex r7,r3,[r1]' in ARM mode
/tmp/ccgkTVKT.s:1187: Error: selected processor does not support `ldrex r12,[r2]' in ARM mode
/tmp/ccgkTVKT.s:1190: Error: selected processor does not support `strex r7,r1,[r2]' in ARM mode
/tmp/ccgkTVKT.s:1261: Error: selected processor does not support `ldrex r12,[r2]' in ARM mode
/tmp/ccgkTVKT.s:1264: Error: selected processor does not support `strex r7,r6,[r2]' in ARM mode
/tmp/ccgkTVKT.s:1353: Error: selected processor does not support `ldrex r12,[r2]' in ARM mode
/tmp/ccgkTVKT.s:1356: Error: selected processor does not support `strex r7,r6,[r2]' in ARM mode
/tmp/ccgkTVKT.s:3677: Error: selected processor does not support `ldrex r12,[r0]' in ARM mode
/tmp/ccgkTVKT.s:3680: Error: selected processor does not support `strex r7,r1,[r0]' in ARM mode
/tmp/ccgkTVKT.s:3759: Error: selected processor does not support `ldrex r12,[r0]' in ARM mode
/tmp/ccgkTVKT.s:3762: Error: selected processor does not support `strex r7,r2,[r0]' in ARM mode

Full log is at
https://buildd.debian.org/status/fetch.php?pkg=racket&arch=armel&ver=8.12%2Bdfsg1-6&stamp=1711006676&raw=0
Please include any other relevant details
e.g., the operating system used or how you are running the code.

@mflatt
Copy link
Member

mflatt commented Mar 21, 2024

I think the solution is to change line 92 of "racket/src/ChezScheme/c/atomic.h" to

#elif defined(__arm__) && ((arm_isa_version >= 6) || (__ARM_ARCH >= 6))

With that change, I'm able to compile the Chez Scheme kernel using arm-linux-gnueabi-gcc.

@shhyou shhyou added arch:aarch32 Problems related to Aarch32 (arm32) architecture build Build failures, Makefiles, Zuo scripts, autoconf, building instructions, etc. labels Mar 21, 2024
@bremner
Copy link
Author

bremner commented Mar 22, 2024 via email

@mflatt
Copy link
Member

mflatt commented Mar 22, 2024

On arm_isa_version: I don't know. I copied it from the earlier check for ARMv7 in the same file. I must have gotten that earlier test from somewhere, maybe by checking predefined flags in some compiler's preprocessor, but I no longer remember.

The latest compilation failure you're showing is for tarm32le instead of tpb32l. Is that intentional, or did it happen despite configuring with --enable-mach=tpb32l? The tarm32le port requires at least ARMv6.

@bremner
Copy link
Author

bremner commented Mar 23, 2024 via email

@mflatt
Copy link
Member

mflatt commented Mar 24, 2024

It appears that the problem is keeping the generated C text all in memory before splitting it into multiple files. Using a temporary file reduces peak memory use by a factor of 10 or so, making the memory use on the order of 100MB instead of 1GB. I'll work on a Chez Scheme PR in that direction.

@shhyou shhyou removed the racket-cs Specific to Racket-on-Chez label Mar 24, 2024
@shhyou shhyou closed this as completed Apr 24, 2024
@bremner
Copy link
Author

bremner commented Apr 24, 2024 via email

@sorawee
Copy link
Collaborator

sorawee commented Apr 24, 2024

The fix is in the ChezScheme repo, which is linked above by the GitHub interface (cisco/ChezScheme#820). I think you need to open the GitHub webpage to be able to see it. That is, you won't see it when viewing from email.

For reference, the commit is then later included to the Racket repo as dbce392733569b6d910b66286c95d2fb2d6c91ff.

@shhyou
Copy link
Collaborator

shhyou commented Apr 24, 2024

shuhung @.***> writes:
Closed #4955 as completed.
Do you have a commit reference? I see plans / suggestions to fix, but nothing to cherry-pick cheers, d

From #4955:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch:aarch32 Problems related to Aarch32 (arm32) architecture build Build failures, Makefiles, Zuo scripts, autoconf, building instructions, etc. upstream
Projects
None yet
Development

No branches or pull requests

4 participants