TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

4.5 KiB

Third-party source policy

The generated thirdparty/ directory is intentionally ignored by Git. Every third-party source dependency must instead be declared by a script under tools/ with all of the following information:

  • an immutable upstream version or commit;
  • the canonical download URL;
  • a SHA-256 checksum for every downloaded archive or individual source file;
  • an explicit list of files copied into the build tree, or an explicitly documented complete release tree for source-port candidates;
  • the upstream license file.

Run the common fetch entry point before compiling:

./tools/fetch-thirdparty.sh

make invokes this command automatically. Each dependency has a dedicated fetch-*.sh script, while fetch-thirdparty.sh is only the common entry point. A matching local version marker makes repeated invocations offline and effectively free. Third-party source must not be committed directly.

Run the upstream integration probes separately:

make thirdparty-smoke

This target requires Meson 1.3 or newer for mlibc. It configures a headers-only mlibc sysroot and builds a deliberately small hosted Toybox. Neither candidate is installed into the TypePHP-OS disk image by this probe.

OpenLibm

Only the architecture/compatibility headers and C sources required by TypePHP-OS's current x86_64 double-precision math ABI are installed. The selection keeps unused implementations out of the freestanding payload.

LLVM compiler-rt builtins

The source selection provides the x86-64 128-bit integer shift, multiply, divide, and remainder helpers. It is compiled into build/libcompiler-rt-builtins.a and linked after every kernel, bootstrap C, and TypePHP Nano userspace object set. The builtins.elf smoke command forces signed and unsigned 128-bit division so the archive is tested as a real linker dependency instead of merely being compiled.

mlibc

  • Upstream: https://github.com/managarm/mlibc
  • Version: v7.0.0
  • Commit: 7c2a178142625cc9852e59a1a090468c61a62d3b
  • Archive SHA-256: 56d62366a6a15bc3fd8741bebcb311ca543553f7b734b1e780aeae33691bd621

The complete release tree is retained as a libc porting reference. The smoke target configures mlibc's official Meson build in headers-only/demo-sysdeps mode and compiles a TypePHP-OS API header probe. mlibc 7.0's implementation build requires C++23 and GCC 13 or newer, while TypePHP-OS keeps C++17 as its runtime baseline. Its implementation therefore does not replace the current small libc yet; doing so also requires a real TypePHP-OS sysdeps port.

The mlibc 6 series does not have one uniform compiler baseline. Releases 6.0 and 6.1 request C++20 and do not contain the GCC 13 gate added later, so they are more practical with an older compiler. Releases 6.2 and 6.3 already request C++23. None of them satisfies TypePHP-OS's C++17 baseline unchanged; using 6.0/6.1 would therefore be a separate port/toolchain choice rather than a transparent downgrade of the pinned reference.

Toybox

The hosted probe enables only cat, date, echo, pwd, and uname; it does not enable Toybox's shell or process-management commands. The undefined host ABI is written to build/thirdparty-smoke/toybox-undefined-symbols.txt. ioctl is a system-call API used by Toybox's shared C support library, not a Toybox command. None of those five applet source files calls it directly, but the common terminal/daemon helpers still leave an ioctl reference in the hosted binary. Toybox is therefore intentionally not linked into TypePHP-OS. The project will not implement ioctl or termios merely to satisfy it; adoption requires pruning the unused common helpers or completing a different compatible libc/runtime path.