Skip to content

Commit c529ba7

Browse files
committed
[GR-65257] Espresso: Add note for macOS in README
PullRequest: graal/20885
2 parents ec221fc + 051382a commit c529ba7

File tree

2 files changed

+45
-7
lines changed

2 files changed

+45
-7
lines changed

docs/reference-manual/java-on-truffle/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,22 @@ Espresso passes the Java Compatibility Kit (JCK or TCK for Java SE).
3333
Espresso is available as a standalone distribution that provides a Java 21 environment.
3434
You can download a standalone based on Oracle GraalVM or GraalVM Community Edition.
3535

36-
1. Download the Espresso 24.2 standalone for your operating system:
36+
1. Download the Espresso 24.2.1 standalone for your operating system:
3737

38-
* [Linux x64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.0-linux-amd64.tar.gz)
39-
* [Linux AArch64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.0-linux-aarch64.tar.gz)
40-
* [macOS x64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.0-macos-amd64.tar.gz)
41-
* [macOS AArch64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.0-macos-aarch64.tar.gz)
42-
* [Windows x64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.0-windows-amd64.zip)
38+
* [Linux x64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.1-linux-amd64.tar.gz)
39+
* [Linux AArch64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.1-linux-aarch64.tar.gz)
40+
* [macOS x64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.1-macos-amd64.tar.gz)
41+
* [macOS AArch64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.1-macos-aarch64.tar.gz)
42+
* [Windows x64](https://gds.oracle.com/download/espresso/archive/espresso-java21-24.2.1-windows-amd64.zip)
4343

4444
2. Unzip the archive:
45+
46+
> Note: If you are using macOS Catalina and later you may need to remove the quarantine attribute:
47+
```shell
48+
sudo xattr -r -d com.apple.quarantine <archive>.tar.gz
49+
```
50+
51+
Extract:
4552
```shell
4653
tar -xzf <archive>.tar.gz
4754
```

espresso/docs/hacking.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ $ cd ../vm
8282
$ mx --dy /espresso,/sulong maven-deploy --tags=public --all-suites --all-distribution-types --version-suite=sdk --suppress-javadoc
8383
```
8484

85-
You can now depend on the jars using a version like `24.2.0-SNAPSHOT`.
85+
You can now depend on the jars using a version like `24.2.1-SNAPSHOT`.
8686

8787
## `mx espresso-embedded ...`
8888

@@ -113,12 +113,43 @@ $ mx espresso --java.JavaHome=/path/to/java/11/home -version
113113

114114
## Limitations
115115

116+
### Linux
117+
116118
Espresso relies on glibc's [dlmopen](https://man7.org/linux/man-pages/man3/dlopen.3.html) to run on HotSpot, but this approach has limitations that lead to crashes e.g. `libnio.so: undefined symbol: fstatat64` . Some of these limitations can be by avoided by defining `LD_DEBUG=unused` e.g.
117119

118120
```bash
119121
$ LD_DEBUG=unused mx espresso -cp mxbuild/dists/jdk1.8/espresso-playground.jar com.oracle.truffle.espresso.playground.Tetris
120122
```
121123

124+
### macOS
125+
126+
On macOS there is nothing like `dlmopen` available, therefore `jvm-ce` does not work. However, there is another mode available where libraries can be executed via Sulong (internally called `nfi-llvm`). This requires the OpenJDK libraries to be compiled with the Sulong toolchain, such builds are available through `mx fetch-jdk` with a `-llvm` suffix. Unfortunately this mode is only supported on `darwin-amd64`, so on an Apple Silicon machine the `x86_64` emulator Rosetta 2 must be used:
127+
128+
```bash
129+
$ arch -arch x86_64 zsh
130+
131+
$ export MX_PYTHON=`xcode-select -p`/usr/bin/python3
132+
$ file $MX_PTYHON
133+
/Applications/Xcode16.2.app/Contents/Developer/usr/bin/python3: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64]
134+
/Applications/Xcode16.2.app/Contents/Developer/usr/bin/python3 (for architecture x86_64): Mach-O 64-bit executable x86_64
135+
/Applications/Xcode16.2.app/Contents/Developer/usr/bin/python3 (for architecture arm64): Mach-O 64-bit executable arm64
136+
137+
$ # the important part above is that there is also a Mach-O included for x86_64
138+
139+
$ cd $graal/espresso
140+
$ mx fetch-jdk # fetch JDK latest, 21 and 21-llvm
141+
142+
$ export ESPRESSO_JAVA_HOME=<JDK21 path for amd64>
143+
$ export LLVM_JAVA_HOME=<JDK21-llvm path for amd64>
144+
$ export JAVA_HOME=<JDK-latest path for amd64>
145+
146+
$ # Note: ESPRESSO_JAVA_HOME and LLVM_JAVA_HOME must match regarding version.
147+
148+
$ mx --env jvm-ce-llvm build
149+
150+
```
151+
152+
122153
## _Espressoⁿ_ Java-ception
123154

124155
Espresso can run itself. **Self-hosting requires a Linux distribution with an up-to-date glibc.**

0 commit comments

Comments
 (0)