Draft
Conversation
The arm64 port patch somewhat heavy-handedly reworked the dictionary allocation, essentially ruining other platforms. Most notably, the extra mprotect() is going to fail, because it requires the memory to be page-aligned. Let's use mmap directly, so that we 1.) always get page-aligned memory and 2.) can set the protection flags right away, simplifying the whole thing. I have zero idea why arm64 is a special case, with the custom heap management. Perhaps some Mac-specific oddity. This has been tested on Linux with x86, arm, and mips targets. Fixes: 95a5761 ('Add support for arm64.')
It relies on native (1x0) word that's only implemented or used on arm64.
Otherwise all other platforms are broken:
${BP}/forth/lib/1x0.fth:52: (1x0) ?
make: *** [emuofw.rom] Error 1
Fixes: 95a5761 ('Add support for arm64.')
The arm64 port broke them all:
${BP}/forth/kernel/metacompile.fth:700: \t64-t ?
make: *** [emuofw.rom] Error 1
I have no idea what this does, I cargo-culted it.
Fixes: 95a5761 ('Add support for arm64.')
The arm64 port, apparently accidentally, dropped the conditional that
checked if "host_cpu" exists, ruining the construction of HOSTDIR if
there's none in the environment:
./build emuofw.rom
forth: Can't open dictionary file ${HOSTDIR}/../build/builder.dic
make: *** [Makefile:6: emuofw.rom] Error 1
make: Leaving directory 'cpu/x86/pc/emu/build'
Bring it back.
Fixes: 95a5761 ('Add support for arm64.')
It's only there on arm64. This presumably breaks "see" on that platform,
but that's possibly better than breaking all other platforms:
--- Rebuilding tools.dic
--- Cmd: ${HOSTDIR}/x86forth ${BP}/cpu/x86/build/kernel.dic ../tools.bth
${BP}/forth/lib/decomp.fth:40: create-cf? ?
--- Saving tools.dic ---
Fixes: 95a5761 ('Add support for arm64.')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The arm64 port broke 32-bit architectures.
This PR is marked draft, because it restores other arches at expense of last commit breaking arm64 in a way I don't know how to fix. Maybe @iamtooch can help beating this into shape?