diff options
author | quantimnot <54247259+quantimnot@users.noreply.github.com> | 2021-10-26 02:33:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 08:33:26 +0200 |
commit | 3ecb369ca1a12754486429bda4ab0bc60f9b86d7 (patch) | |
tree | 1d661b402d5be6edcc16bfb291e4efcfd1e43869 | |
parent | 582468da1cc266d0dd922ec5c620713bbc45d02a (diff) | |
download | Nim-3ecb369ca1a12754486429bda4ab0bc60f9b86d7.tar.gz |
Document file changes that may be needed for add a new platform (#19055)
Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
-rw-r--r-- | doc/intern.rst | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/intern.rst b/doc/intern.rst index fe0d333fd..e8fb4ac86 100644 --- a/doc/intern.rst +++ b/doc/intern.rst @@ -207,6 +207,42 @@ implementation uses C's `setjmp`:c: function to store all registers on the hardware stack. It may be necessary that the new platform needs to replace this generic code by some assembler code. +Files that may need changed for your platform include: + +* `compiler/platform.nim` + Add os/cpu properties. +* `lib/system.nim` + Add os/cpu to the documentation for `system.hostOS` and `system.hostCPU`. +* `compiler/options.nim` + Add special os/cpu property checks in `isDefined`. +* `compiler/installer.ini` + Add os/cpu to `Project.Platforms` field. +* `lib/system/platforms.nim` + Add os/cpu. +* `lib/pure/include/osseps.nim` + Add os specializations. +* `lib/pure/distros.nim` + Add os, package handler. +* `tools/niminst/makefile.nimf` + Add os/cpu compiler/linker flags. +* `tools/niminst/buildsh.nimf` + Add os/cpu compiler/linker flags. + +If the `--os` or `--cpu` options aren't passed to the compiler, then Nim will +determine the current host os, cpu and endianess from `system.cpuEndian`, +`system.hostOS` and `system.hostCPU`. Those values are derived from +`compiler/platform.nim`. + +In order for the new platform to be bootstrapped from the `csources`, it must: + +* have `compiler/platform.nim` updated +* have `compiler/installer.ini` updated +* have `tools/niminst/buildsh.nimf` updated +* have `tools/niminst/makefile.nimf` updated +* be backported to the Nim version used by the `csources` +* the new `csources` must be pushed +* the new `csources` revision must be updated in `config/build_config.txt` + Runtime type information ======================== |