Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/mx.compiler/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@
],
"exports" : [
"* to com.oracle.graal.graal_enterprise,org.graalvm.nativeimage.pointsto,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.llvm,com.oracle.svm.svm_enterprise,org.graalvm.nativeimage.base",
"org.graalvm.compiler.core.common to jdk.internal.vm.compiler.management,org.graalvm.nativeimage.agent.tracing",
"org.graalvm.compiler.core.common to jdk.internal.vm.compiler.management,org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.objectfile",
"org.graalvm.compiler.debug to jdk.internal.vm.compiler.management,org.graalvm.nativeimage.objectfile",
"org.graalvm.compiler.hotspot to jdk.internal.vm.compiler.management",
"org.graalvm.compiler.nodes.graphbuilderconf to org.graalvm.nativeimage.driver",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static boolean isOpen(int fd) {
result = LinuxStat.fstat64(fd, stat);
} else if (Platform.includedIn(Platform.DARWIN.class)) {
DarwinStat.stat stat = StackValue.get(DarwinStat.stat.class);
result = DarwinStat.fstat(fd, stat);
result = DarwinStat.fstat_aarch64(fd, stat);
} else {
throw VMError.shouldNotReachHere("Unsupported platform");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
*/
package com.oracle.svm.core.posix.headers.darwin;

import com.oracle.svm.core.util.VMError;
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
import org.graalvm.nativeimage.c.CContext;
import org.graalvm.nativeimage.c.function.CFunction;
import org.graalvm.nativeimage.c.struct.CField;
Expand Down Expand Up @@ -53,10 +56,42 @@ public interface stat extends PointerBase {
}

@CFunction("fstat$INODE64")
public static native int fstat(int fd, stat buf);
@Platforms({Platform.DARWIN_AMD64.class})
public static native int fstat_amd64(int fd, stat buf);

@CFunction("fstat")
@Platforms({Platform.DARWIN_AARCH64.class})
public static native int fstat_aarch64(int fd, stat buf);

@Platforms(Platform.DARWIN.class)
public static int fstat(int fd, stat buf) {
if (Platform.includedIn(Platform.AMD64.class)) {
return fstat_amd64(fd, buf);
} else if (Platform.includedIn(Platform.AARCH64.class)) {
return fstat_aarch64(fd, buf);
} else {
throw VMError.shouldNotReachHere();
}
}

public static class NoTransitions {
@CFunction(value = "fstat$INODE64", transition = CFunction.Transition.NO_TRANSITION)
public static native int fstat(int fd, stat buf);
@Platforms({Platform.DARWIN_AMD64.class})
public static native int fstat_amd64(int fd, stat buf);

@CFunction(value = "fstat", transition = CFunction.Transition.NO_TRANSITION)
@Platforms({Platform.DARWIN_AARCH64.class})
public static native int fstat_aarch64(int fd, stat buf);

@Platforms(Platform.DARWIN.class)
public static int fstat(int fd, stat buf) {
if (Platform.includedIn(Platform.AMD64.class)) {
return fstat_amd64(fd, buf);
} else if (Platform.includedIn(Platform.AARCH64.class)) {
return fstat_aarch64(fd, buf);
} else {
throw VMError.shouldNotReachHere();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ protected CCharPointer strdupImpl(CCharPointer src) {
return PosixLibC.strdup(src);
}

@Platforms(Platform.LINUX.class)
private static PointerBase dlmopen(Lmid_t lmid, String filename, int mode) {
try (CTypeConversion.CCharPointerHolder pathPin = CTypeConversion.toCString(filename)) {
CCharPointer pathPtr = pathPin.get();
Expand All @@ -105,6 +106,7 @@ private static PointerBase dlmopen(Lmid_t lmid, String filename, int mode) {
/**
* A single linking namespace is created lazily and registered on the NFI context instance.
*/
@Platforms(Platform.LINUX.class)
private static PointerBase loadLibraryInNamespace(long nativeContext, String name, int mode) {
assert (mode & isolatedNamespaceFlag) == 0;
Target_com_oracle_truffle_nfi_backend_libffi_LibFFIContextLinux context = SubstrateUtil.cast(getContext(nativeContext), Target_com_oracle_truffle_nfi_backend_libffi_LibFFIContextLinux.class);
Expand Down