amalgamation.md: document platform dependency of HAL gems

Amalgamated files include HAL gem source code selected at build time,
making them platform-specific. Document this as expected behavior.

Ref #6726.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-03-02 10:34:55 +09:00
parent b9a1a1fb23
commit 02877f043a
+11
View File
@@ -11,6 +11,7 @@ Amalgamation combines all mruby source files into a single `mruby.c` and
- **Single compilation unit**: Enables better compiler optimization
- **No build system required**: Compile directly with any C compiler
- **Portable**: No external dependencies beyond standard C library
(but see [Platform-Dependent Gems](#platform-dependent-gems) below)
## Generating Amalgamation
@@ -75,6 +76,16 @@ The following gems work with amalgamation:
- `mruby-io` (with `hal-posix-io`)
- `mruby-task` (with `hal-posix-task`)
### Platform-Dependent Gems
Gems that use a HAL (Hardware Abstraction Layer) include
platform-specific code in the amalgamation. For example, if
`mruby-io` selects `hal-posix-io` on Linux, the generated `mruby.c`
contains POSIX-specific code and cannot be compiled on Windows.
If you need amalgamated files for multiple platforms, generate them
separately for each target platform (or cross-build configuration).
### Excluded Gems
Binary gems (`mruby-bin-*`) are automatically excluded as they contain