-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Restore native armv7 support for NetBSD 10.0 #13146
Comments
I don't have physical hardware to try this out so I've used QEMU emulating a cortex-a15, roughly following these instructions on macOS ARM64.
I made the changes to configure.ac as you have here. However I ran into three issues:
Ignoring that with CFLAGS of
Which is used in runtime/arm.S. Not sure why the feature detection on NetBSD fails, that instruction should be available on a cortex-a15 using thumb encoding. This is what NetBSD knows about the processor: armv7# cpuctl identify 0
cpu0: isa features: Swap, Bitcount, Bitfield, CmpBranch, Coproc=0, Debug
cpu0: isa features: Divde=2, Endian, Except, Except_AR, Extend=2, IfThen
cpu0: isa features: Immediate, Interwork=3, Jazelle, LoadStore, MemHint=4
cpu0: isa features: MultAccessInt=0, Mult=2, MultS=3, MultU=2, PSR_AR
cpu0: isa features: Reversal=2, Saturate, SIMD=3, SVC, SynchPrim=2, TabBranch
cpu0: isa features: ThumbCopy, TrueNOP, ThumbEE_Extn, Unpriv=2, WithShifts=4
cpu0: isa features: Writeback, SMC, Barrier, SynchPrim_frac, PSR_M, SWP
cpu0: memory model: VMSA-Support=5, Outermost-Shareability=1
cpu0: memory model: Shareability-Levels=1, Auxiliary-Registers=2
cpu0: memory model: Innermost-Shareability=1, Branch-Predictor=2
cpu0: memory model: Unified-TLB=4, Mem-Barrier=2, WFI-Stall=1
cpu0: memory model: Cache-Maintenance-MVA=1, Cache-Maintenance-Set/Way=1
cpu0: memory model: BP-Maintenance=2, Maintenance-Broadcast=2
cpu0: memory model: Coherent-Tablewalk=1, Cached-Memory-Size=2
cpu0: processor features: ThumbEE=1, Jazelle=3, Thumb=1, ARM=1, Programmer=1
cpu0: processor features: Security=0, M-profile=0, Virtualization=0
cpu0: processor features: Generic-Timer=1
cpu0: media and VFP features: ASIMD-Registers=2, Single-Precision=2
cpu0: media and VFP features: Double-Precision=2, Divide=1, Square-Root=1
cpu0: media and VFP features: VFP-Rounding-Modes=1, Flush-To-Zero=1
cpu0: media and VFP features: Default-NaN=1, ASIMD-Load/Store=1
cpu0: media and VFP features: ASIMD-Integer=1, ASIMD-SPFP=1, ASIMD-HPFP=1
cpu0: media and VFP features: VFP-HPFP=1, ASIMD-FMAC=1
armv7# uname -a
NetBSD armv7 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 2024 [email protected]:/usr/src/sys/arch/evbarm/compile/GENERIC evbarm If I replace that section of code to output the older style
List of unexpected errors:
tests/lib-dynlink-pr4839/'test.ml' with 1.2.2.17 (ocamlopt.byte)
tests/lib-dynlink-pr4839/'test.ml' with 1.2.2.5 (ocamlopt.byte)
tests/lib-systhreads/'testyield.ml' with 1.1.1 (bytecode)
tests/lib-dynlink-pr4839/'test.ml' with 1.2.2.11 (ocamlopt.byte)
Summary:
2519 tests passed
43 tests skipped
414 tests failed
161 tests not started (parent test skipped or failed)
4 unexpected errors
3141 tests considered Can you provide more details on the physical hardware being used? And try replicating this using a checkout of https://github.com/ocaml/ocaml/tree/4.14 |
The sak.c compile error is fixed in 284244a and f54b3ac. The fix needs to be backported to support recent NetBSD in 4.14. I am running on an Allwinner A83T, 8 Cortex A-7 cores. These should be ISA compatible with A-15 because some systems put both in the same SOC. If I assemble "cbz r1,1f" I get the same error as you. I will try to figure out why we are seeing different code generation. |
My system (hardware, NetBSD 10) assembles arm.S with defines |
Running NetBSD 9.4 under qemu I find the expected variables in Makefile.config
The compile command I regenerated configure with autoconf 2.71. The original in git was generated with autoconf 2.69. My base git hash is fdffa5c. |
With a bit more testing over the weekend I can get the right variables in Makefile.config.
My changes are on https://github.com/tmcgilchrist/ocaml/tree/netbsd-arm-fixes. Running The assembler error is no longer present and was likely due to my error with configuration. |
I tested the branch netbsd-arm-fixes on NetBSD 10.0 with real hardware and got the expected results – native code passes tests except testyield.ml which also fails with the bytecode compiler. |
I ended up assigning this to @tmcgilchrist since he has opened 13161
which I think will fix thie present issue.
|
The 4.14 branch configure script does not enable native compiler support for armv7 on NetBSD 10.0. The patch below enables the native compiler. All expected tests pass except testyield.ml which also fails with the bytecode compiler. See issue #12415.
uname -a reports
The text was updated successfully, but these errors were encountered: