Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit 5b6dfe2

Browse files
Create mostly-static linked images when fully static is not supported
1 parent 8ceae84 commit 5b6dfe2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

build-scripts/graal.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,18 @@ switch (process.platform) {
6464
case 'linux':
6565
// On linux, statically link all libraries. Allows usage on systems
6666
// which are missing or have incompatible versions of GLIBC.
67+
// Only linux x86 architectures can fully statically link
6768
// See https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/
6869
if (process.arch !== 'arm64') {
69-
NATIVE_IMAGE_BUILD_ARGS.unshift('--libc=musl');
70+
NATIVE_IMAGE_BUILD_ARGS.unshift('--static', '--libc=musl');
71+
} else {
72+
NATIVE_IMAGE_BUILD_ARGS.unshift('--static-nolibc');
7073
}
71-
NATIVE_IMAGE_BUILD_ARGS.unshift('--static');
7274
break;
75+
case 'darwin': {
76+
NATIVE_IMAGE_BUILD_ARGS.unshift('--static-nolibc');
77+
break;
78+
}
7379
}
7480

7581
runCommand(`native-image${process.platform === 'win32' ? '.cmd' : ''}`, NATIVE_IMAGE_BUILD_ARGS, spawnOpts)

0 commit comments

Comments
 (0)