Repository navigation
Add support for Haiku on x86_64 - #25
Open
duncanmcqueen wants to merge 1 commit into
Open
duncanmcqueen wants to merge 1 commit into
duncanmcqueen wants to merge 1 commit into
Conversation
Add Haiku (x86_64-*-haiku*) as a host: - configure.ac: the host case, and the Makefiles for src/os/haiku. Haiku has dlopen() in libroot, so libdl is not needed. - src/os/haiku/os.c: get the stack base, the number of CPUs and the physical memory from the Haiku kernel kit (get_thread_info() and get_system_info()). Haiku uses LIBRARY_PATH for native libraries. - src/os/haiku/x86_64: the same files as src/os/bsd/x86_64. Haiku uses the System V AMD64 calling convention. - src/class.c: the scandir() filter on Haiku takes a const argument. Tested on Haiku R1/beta6 x86_64 with GNU Classpath (ingelabs master) and the Haiku AWT peer: the default interpreter (inlining, direct, threaded), threads, the garbage collector, AWT and Swing programs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
duncanmcqueen
added a commit
to duncanmcqueen/bekaffe
that referenced
this pull request
Oct 16, 2026
JamVM (ingelabs/jamvm) now builds and runs on Haiku x86_64 with the same GNU Classpath build and the same Haiku peer as Kaffe. AWT, Swing, applets and sound work, and it is 17 to 36 times faster than Kaffe. - patches/jamvm/: the Haiku port, and a fix that stops user class loaders from defining java.* classes. Both are offered upstream as ingelabs/jamvm#25 and #24. - src/build-jamvm.sh and src/run-jamvm.sh: build JamVM on Haiku against the Classpath install, and run classes with it. - src/build.sh: get jni.h from the Classpath install, not from Kaffe. - README, front page news and development notes: how to build JamVM, and the test results (Kaffe regression suite, stress test, speed). Kaffe stays the default VM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
This pull request adds Haiku on x86_64 as a host. JamVM then builds and runs on Haiku with GNU Classpath (ingelabs
masterwith the Haiku patches in ingelabs/classpath#61 and the pull requests that it needs).I use JamVM as the VM for BeKaffe, an AWT/Swing toolkit for GNU Classpath on Haiku. Until now BeKaffe used Kaffe, which is archived.
Changes
configure.ac: the host casex86_64-*-haiku*, and the Makefiles forsrc/os/haiku. Haiku hasdlopen()inlibroot, thuslibdlis not necessary.src/os/haiku/os.c: the stack base, the number of CPUs and the physical memory come from the Haiku kernel kit (get_thread_info()andget_system_info()). Haiku usesLIBRARY_PATHto find native libraries.src/os/haiku/x86_64/: the same files assrc/os/bsd/x86_64/. Haiku uses the System V AMD64 calling convention.src/class.c: on Haiku, thescandir()filter function takes aconstargument (as on Linux and macOS).The change does not touch the code for the other hosts.
How to build
On Linux, run
./autogen.sh(the files that it adds must be real files, not symbolic links, when you copy the tree to Haiku). On Haiku:javaccomes from the Haiku OpenJDK 8 package.Results
Haiku R1/beta6 x86_64 (hrev60228), GCC 13.3.0, QEMU/KVM with 6 CPUs. The default configuration (inlining, direct, threaded, with run-time relocation checks) builds without errors and without new warnings.
jamvm -versionand a hello program:Hello from JamVM 2.1.0 on Haiku amd64, CPUs=6.wait()/notify(),interrupt(), timedwait(), finalizers,NullPointerException, array bounds andStackOverflowError. 10 of 10 runs passed.javax.sound.sampledoutput work with the Haiku toolkit.CliTest: collections, formatting,BigDecimal, regular expressions, file I/O, threads, processes, network and system properties) passes.Speed, against Kaffe 1.1.10-pre (interpreter) with the same Classpath build on the same machine:
fib(30), an array loop, strings andHashMap)I also ran the Kaffe regression suite (149 tests) on JamVM: 129 tests pass. Most of the other tests compare exception messages and stack trace formats with Kaffe's text, or test Kaffe internals. Two results can be useful to you:
ProhibitedClassshowed that a user class loader can definejava.lang.Object. Do not let user class loaders define classes in java.* #24 fixes this.SecurityMandoes not stop. It also does not stop on OpenJDK 8, so it is not a JamVM problem: the test's security manager asks for a class that does not exist, and each class path lookup calls the security manager again.AI assistance
An AI model (Claude Code, by Anthropic) wrote this change, the tests and this text. The repository owner directed the work and checked the results. Please review it as you review other contributions.
🤖 Generated with Claude Code