Commit graph

20 commits

Author SHA1 Message Date
SANO,Masatoshi aa0fa1c56e Add ARM64 Windows platform support
Add complete ARM64 Windows (AArch64 WoA) support to SBCL.  This
enables building and running SBCL natively on Windows 11 ARM devices.

Key design decisions:
- x18 register reserved as TEB pointer (Windows ARM64 ABI requirement),
  matching the existing Darwin reservation
- Safepoint GC with fake_foreign_function_call to save register context
  for precise stack scanning (ARM64 uses separate C and control stacks)
- VEH (Vectored Exception Handling) for ARM64, decoding BRK instructions
  which Windows reports as EXCEPTION_ILLEGAL_INSTRUCTION
- sb_udivmodti4 takes hi/lo split arguments to avoid __uint128_t ABI
  issues on LLP64 where unsigned long is 32 bits
- FP exception traps disabled (ARM64 Windows does not deliver FP
  exceptions even with FPCR trap bits set)
- Dynamic space pages committed on demand (Windows reserves but does
  not commit the full dynamic space upfront)

New files:
- src/runtime/Config.arm64-win32: Build configuration
- src/runtime/arm64-win32-os.c: OS layer (VEH, context access, FP)
- src/runtime/arm64-win32-os.h: Platform header
- .github/workflows/windows-arm64.yml: CI workflow

Modified files grouped by subsystem:

Runtime (ARM64-specific):
- arm64-arch.c: Windows memory APIs, LLP64-safe pointer storage,
  sb_udivmodti4 split-argument ABI, static space NIL header guard
- arm64-assem.S: Windows calling conventions for call_into_lisp and
  call_into_c, TlsGetValue for thread pointer, x18 reservation

Runtime (Windows general):
- win32-os.c: ARM64 safepoint page handling, BRK exception decode,
  ARM64 VEH, dynamic space page commit, ARM64 debug printing

Compiler:
- vm.lisp: Reserve x18 on Windows (matching Darwin)
- c-call.lisp: Don't zero control-stack-pointer on Windows (not FFCA)
- parms.lisp: Address space layout for Windows ARM64
- tramps.lisp: Save CSP to thread for GC, don't zero CSP on Windows
- genesis.lisp: GC_SAFEPOINT_PAGE_ADDR for non-x86-64 platforms
- parms.lisp (generic): Update safepoint space comment
- debug-int.lisp: NFP handling for ARM64 Windows
- float-trap.lisp: Disable FP traps on ARM64 Windows
- coreparse.c: ARM64 guard for TEXT_SPACE_START assignment

Build system:
- make-config.sh: ARM64 Windows detection and feature flags
- make-windows-installer.sh: ARM64 architecture in installer

CI:
- linux-arm64.yml, mac.yml: Robustness fixes for repo naming
- windows-arm64.yml: New workflow for ARM64 Windows builds

Tests:
- subr.sh: Auto-detect sbcl.exe on Windows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 21:44:09 +03:00
Douglas Katzman a3e29ded44 Add FIXME
I'm not sure which test to blame: sb-posix.impure for being too sensitive
or run-sbcl.test.sh for changing the source tree.
I kinda feel that affecting the tree is the greater sin but I could also
see an argument that the DIRECTORY test needs better isolation.
2023-11-07 15:08:03 -05:00
Douglas Katzman ea0e1f96e1 Use /tmp more in shell tests
Anything that invokes 'use_test_subdirectory' should go to /tmp, not just
a few scripts that overrode TEST_BASEDIR. After this there are approximately
6 files that will fail if pwd isn't writable. Most involve run-compiler.sh
and also filesys tests. Plus there's a hack in run-sbcl.sh without which
it would already fail when writing into /tmp.
2022-10-07 13:54:25 -04:00
Stas Boukarev 23e5fa5e49 Put --disable-ldb back into subr.sh 2021-02-03 23:02:39 +03:00
Stas Boukarev 57f0140859 Darwin ARM64 support.
Not complete yet.
2021-02-03 22:54:31 +03:00
Stas Boukarev 3ecf4d7124 tests: more --lose-on-corruption 2020-05-22 03:28:28 +03:00
Stas Boukarev 72a9e7db0b Fix elfcore.test.sh 2020-01-30 13:34:45 +03:00
Douglas Katzman e8022aeefc Fix editcore regression 2020-01-29 20:18:09 -05:00
Stas Boukarev 7ef5809068 --disable-ldb and --lose-on-corruption for some tests. 2019-10-04 17:49:49 +03:00
Jan Moringen 2d4fe5cd49 Fix "tests: run-tests.sh accepts --evaluator-mode commandline option" commit
Commandline argument handling in tests/subr.sh was wrong.
2015-11-02 14:59:50 +01:00
Jan Moringen 073eae269f tests: run-tests.sh accepts --evaluator-mode commandline option
Tests are run under the specified SB-EXT:*EVALUATOR-MODE*.
2015-10-31 17:44:51 +01:00
Stas Boukarev 1f704cd4ff Fix where tests are trying to find contribs. 2013-10-17 11:33:26 +04:00
Jim Wise 4afcad7842 Fix on Solaris by accounting for /bin/sh there.
Solaris' /bin/sh does not grok $(...), so use `...` instead.

Note that all recent versions of Solaris have included /bin/bash, but
I'm not sure the impact of using #!/bin/bash instead of #!/bin/sh on
some of our other platforms.
2013-10-13 17:22:19 -04:00
Stas Boukarev a291e16679 tests/subr.sh: Fix sed invocation for Solaris. 2013-08-30 05:09:24 +04:00
Francois-Rene Rideau c0569c5f51 make it possible to run tests on an installed SBCL
Allow override of SBCL location via TEST_SBCL_HOME,
 TEST_SBCL_RUNTIME, and TEST_SBCL_CORE.

 Allow override of temporary file location via TEST_DIRECTORY. (Some
 tests still write to /tmp, though -- so user beware!)

 Small unrelated whitespace / style-warning fixes.
2012-10-07 15:15:25 +03:00
Joshua Elsasser c5e9ad7d24 Insure that the test for bug 881445 runs with a large enough dynamic space. 2011-11-22 23:29:13 -08:00
Nikodemus Siivola 2a0f851524 make DELETE-FILE respect *DEFAULT-PATHNAME-DEFAULTS*
MERGE-PATHNAMES to get an absolute pathname. (Using TRUENAME would be wrong,
  since then we would delete files pointed to by symbolic links, and not the
  symbolic links themselves -- a nasty regression that would be!)

  Also remove the "for error checking" TRUENAME call from there: unlink will
  give us an errno that tells what we need to know -- and lo! there is one
  race condition less in the system.

  Previously using relative pathnames it was possible to accidentally delete
  the wrong file.

  Fixes lp#882877.

  NB: currently DELETE-DIRECTORY and RENAME-FILE use TRUENAME with just the
      aforementioned unfortunate consequence, but I'm hesitant to change them
      during the freeze -- so dealing with this issue in them will have to
      wait a bit.
2011-10-30 22:44:44 +02:00
Nikodemus Siivola 26d0559df8 1.0.42.7: fix shell scripts on Solaris (and FreeBSD?)
* Patch by Josh Elsasser, lp#615497.

 * Fixes for run-sbcl.sh and tests/subr.sh on Solaris, some of which I
   believe were also necessary on FreeBSD.

 * A missing #include needed on Solaris is also added.
2010-08-31 12:46:41 +00:00
Juho Snellman dca2074084 1.0.41.55: Solaris fixes
* Remove bashisms.
     * Conditionalize out some constants and functions that
       don't exist on Solaris.
     * Patch from Jim Wise.
2010-08-23 23:21:27 +00:00
Richard M Kreuter a42922aef9 1.0.13.1: Various cleanups and touchups in tests/
* Tests written in shell modified to use shell functions, rather than
  variables, so that tests written in shell can run when the build
  directory's absolute pathname contains whitespace (as home
  directories might tend to on Windows).

* tests/subr.sh: new file, with some shell functions, variables, and
  settings to support the above.  Files in the test suite written in
  shell should source this file.

* Factored code for creating and cleaning up temporary directories for
  tests written in shell that touch the file system.  Test scripts
  written in shell should now call "use_test_subdirectory" to create
  and chdir to a test directory, and the shell should clean out the
  test directory at exit time.

* Most tests written in shell now quote filenames that derive from the
  truename of the current working directory or from an environment
  variable, as such names may contain whitespace.  (Variables set to
  non-offending constant strings in the script itself need not be
  quoted this way.)

* tests/filesys.test.sh was not prepared to deal with a TRUENAME that
  resolves all symbolic links in a pathname, as a soon-to-be-committed
  TRUENAME will; "/tmp" on MacOSX is a symbolic link to
  "/private/tmp".  POSIX pwd(1) takes a -P option to resolve symbolic
  links in the working directory's path, so we'll try that.

* Tests now supply --no-userinit, --no-sysinit arguments, so that we
  don't need to conditionalize these for win32.

* Some tests written in shell changed from using --eval <string> to
  heredocs, which allows the Lisp code the be formatted nicer and
  avoids some shell quotation headaches (not all, of course).

* Minor shell errors corrected in some tests.  Notable example:

    program; if [ $? != $value ]; then echo failed $?; fi

  Because "[" is a child process, after the test $? is set to the exit
  status of the "["; the exit status of "program" is lost.
2007-12-28 19:46:57 +00:00