diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c60b8e6ba5f..dd21c1b0eb84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ New features: +* Add support for `darwin-aarch64` (macOS M1) (#2181, @lewurm, @chrisseaton, @eregon). Bug fixes: @@ -554,7 +555,7 @@ New features: * `foreign_object.to_s` now uses `InteropLibrary#toDisplayString()` (and still `asString()` if `isString()`). * `foreign_object.inspect` has been improved to be more useful (include the language and meta object). * `foreign_object.class` now calls `getMetaObject()` (except for Java classes, same as before). -* Add basic support for Linux ARM64. +* Add basic support for Linux AArch64. * `foreign_object.name = value` will now call `Interoplibrary#writeMember("name", value)` instead of `invokeMember("name=", value)`. * Always show the Ruby core library files in backtraces (#1414). * The Java stacktrace is now shown when sending SIGQUIT to the process, also on TruffleRuby Native, see [Debugging](doc/user/debugging.md) for details (#2041). diff --git a/README.md b/README.md index 7cec8783dcba..117fef2a98f1 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ TruffleRuby is actively tested on the following systems: Architectures: * AMD64 (aka `x86_64`): Supported -* AArch64 (aka `arm64`): Supported on Linux (from 21.2) +* AArch64 (aka `arm64`): Supported on Linux (from 21.2) and on macOS (from 22.2) You may find that TruffleRuby will not work if you severely restrict the environment, for example, by unmounting system filesystems such as `/dev/shm`. diff --git a/ci.jsonnet b/ci.jsonnet index 029495d15258..d2573a056b47 100644 --- a/ci.jsonnet +++ b/ci.jsonnet @@ -199,27 +199,28 @@ local part_definitions = { HOST_VM_CONFIG: "graal-enterprise", }, }, - local svm = { + gdb_svm: { downloads+: { GDB: { name: "gdb", version: "7.11.1", platformspecific: true }, }, environment+: { GDB_BIN: "$GDB/bin/gdb", - HOST_VM: "svm", }, }, native: { mx_env:: "native", environment+: { + HOST_VM: "svm", HOST_VM_CONFIG: "graal-core", }, - } + svm, + }, native_ee: { mx_env:: "native-ee", environment+: { + HOST_VM: "svm", HOST_VM_CONFIG: "graal-enterprise", }, - } + svm, + }, }, jdk: { @@ -248,7 +249,13 @@ local part_definitions = { }, }, - local darwin_deps = common.sulong.deps.darwin_amd64 + { + local darwin_amd64_deps = common.sulong.deps.darwin_amd64 + { + packages+: { + ruby: "==3.0.2", + }, + }, + + local darwin_aarch64_deps = common.sulong.deps.darwin_aarch64 + { packages+: { ruby: "==3.0.2", }, @@ -263,15 +270,15 @@ local part_definitions = { bench_machine: ["x52"] + self.normal_machine + ["no_frequency_scaling"], }, }, - linux_arm64: linux_deps + { - platform_name:: "LinuxARM64", + linux_aarch64: linux_deps + { + platform_name:: "LinuxAArch64", platform: "linux", arch:: "aarch64", "$.cap":: { normal_machine: ["linux", "aarch64"], }, }, - darwin: darwin_deps + { + darwin_amd64: darwin_amd64_deps + { platform_name:: "DarwinAMD64", platform: "darwin", arch:: "amd64", @@ -282,6 +289,17 @@ local part_definitions = { LANG: "en_US.UTF-8", }, }, + darwin_aarch64: darwin_aarch64_deps + { + platform_name:: "DarwinAArch64", + platform: "darwin", + arch:: "aarch64", + "$.cap":: { + normal_machine: ["darwin", "aarch64"], + }, + environment+: { + LANG: "en_US.UTF-8", + }, + }, }, cap: { @@ -502,34 +520,42 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, " local native_config = $.run.generate_native_config + $.run.check_native_config, local native_tests = $.run.testdownstream_aot + $.run.test_integration + $.run.test_compiler, - // Order: platform, jdk, mx_env. Keep aligned for an easy visual comparison. - "ruby-test-specs-linux-11": $.platform.linux + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" }, - "ruby-test-specs-linux-17": $.platform.linux + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" }, - "ruby-test-specs-darwin-11": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" }, - "ruby-test-specs-darwin-17": $.platform.darwin + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" }, - "ruby-test-fast-linux-arm64": $.platform.linux_arm64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + native_config + { timelimit: "45:00" }, - "ruby-test-fast-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + { timelimit: "45:00" }, # To catch missing slow tags - "ruby-test-mri-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:10:00" }, - "ruby-test-mri-darwin": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:30:00" }, - "ruby-test-integration-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_integration, - "ruby-test-cexts-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.use.sqlite331 + $.run.test_cexts, - "ruby-test-cexts-darwin": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_cexts + { timelimit: "01:20:00" }, - "ruby-test-gems-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems, - "ruby-test-gems-darwin": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems, - "ruby-test-ecosystem-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.node + $.use.sqlite331 + $.use.gem_test_pack + $.run.test_ecosystem, - "ruby-test-standalone-linux": $.platform.linux + $.jdk.v11+ gate_no_build + $.run.test_make_standalone_distribution, + # Order: platform, jdk, mx_env. Keep aligned for an easy visual comparison. + "ruby-test-specs-linux-11": $.platform.linux + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" }, + "ruby-test-specs-linux-17": $.platform.linux + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" }, + "ruby-test-specs-darwin-amd64-11": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" }, + "ruby-test-specs-darwin-amd64-17": $.platform.darwin_amd64 + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" }, + "ruby-test-specs-darwin-aarch64-11": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" }, + "ruby-test-specs-darwin-aarch64-17": $.platform.darwin_aarch64 + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" }, + "ruby-test-fast-linux-aarch64": $.platform.linux_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + native_config + { timelimit: "45:00" }, + "ruby-test-fast-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + { timelimit: "45:00" }, # To catch missing slow tags + "ruby-test-mri-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:10:00" }, + "ruby-test-mri-linux-aarch64": $.platform.linux_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:10:00" }, + "ruby-test-mri-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:30:00" }, + "ruby-test-mri-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:30:00" }, + "ruby-test-integration-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_integration, + "ruby-test-cexts-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.use.sqlite331 + $.run.test_cexts, + "ruby-test-cexts-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_cexts + { timelimit: "01:20:00" }, + "ruby-test-cexts-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_cexts + { timelimit: "01:20:00" }, + "ruby-test-gems-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems, + "ruby-test-gems-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems, + "ruby-test-gems-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems, + "ruby-test-ecosystem-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.node + $.use.sqlite331 + $.use.gem_test_pack + $.run.test_ecosystem, + "ruby-test-standalone-linux": $.platform.linux + $.jdk.v11+ gate_no_build + $.run.test_make_standalone_distribution, "ruby-test-compiler-graal-core-11": $.platform.linux + $.jdk.v11 + $.env.jvm_ce + gate + $.use.truffleruby + $.run.test_compiler, "ruby-test-compiler-graal-core-17": $.platform.linux + $.jdk.v17 + $.env.jvm_ce + gate + $.use.truffleruby + $.run.test_compiler, "ruby-test-compiler-graal-enterprise-11": $.platform.linux + $.jdk.v11 + $.env.jvm_ee + gate + $.use.truffleruby + $.run.test_compiler, "ruby-test-compiler-graal-enterprise-17": $.platform.linux + $.jdk.v17 + $.env.jvm_ee + gate + $.use.truffleruby + $.run.test_compiler, - "ruby-test-svm-graal-core-linux-11": $.platform.linux + $.jdk.v11 + $.env.native + gate + native_tests, - "ruby-test-svm-graal-core-linux-17": $.platform.linux + $.jdk.v17 + $.env.native + gate + native_tests, - "ruby-test-svm-graal-core-darwin-11": $.platform.darwin + $.jdk.v11 + $.env.native + gate + native_tests, - "ruby-test-svm-graal-core-darwin-17": $.platform.darwin + $.jdk.v17 + $.env.native + gate + native_tests, - "ruby-test-svm-graal-enterprise-linux": $.platform.linux + $.jdk.v11 + $.env.native_ee + gate + native_tests, - "ruby-test-svm-graal-enterprise-darwin": $.platform.darwin + $.jdk.v11 + $.env.native_ee + gate + native_tests, + "ruby-test-svm-graal-core-linux-11": $.platform.linux + $.jdk.v11 + $.env.native + $.env.gdb_svm + gate + native_tests, + "ruby-test-svm-graal-core-linux-17": $.platform.linux + $.jdk.v17 + $.env.native + $.env.gdb_svm + gate + native_tests, + "ruby-test-svm-graal-core-darwin-amd64-11": $.platform.darwin_amd64 + $.jdk.v11 + $.env.native + $.env.gdb_svm + gate + native_tests, + "ruby-test-svm-graal-core-darwin-amd64-17": $.platform.darwin_amd64 + $.jdk.v17 + $.env.native + $.env.gdb_svm + gate + native_tests, + "ruby-test-svm-graal-core-darwin-aarch64-11": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.native + gate + native_tests, + "ruby-test-svm-graal-core-darwin-aarch64-17": $.platform.darwin_aarch64 + $.jdk.v17 + $.env.native + gate + native_tests, + "ruby-test-svm-graal-enterprise-linux": $.platform.linux + $.jdk.v11 + $.env.native_ee + $.env.gdb_svm + gate + native_tests, + "ruby-test-svm-graal-enterprise-darwin-aarch64 ": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.native_ee + gate + native_tests, }, local other_rubies = { @@ -545,8 +571,8 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, " local svm_configurations = { local shared = $.cap.bench + $.cap.daily + $.use.truffleruby + $.use.build, - "svm-graal-core": shared + $.env.native, - "svm-graal-enterprise": shared + $.env.native_ee, + "svm-graal-core": shared + $.env.native + $.env.gdb_svm, + "svm-graal-enterprise": shared + $.env.native_ee + $.env.gdb_svm, }, bench_builds: @@ -700,9 +726,10 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, " manual_builds: { local shared = $.use.common + $.cap.manual + { timelimit: "15:00" }, - "ruby-generate-native-config-linux-amd64": $.platform.linux + $.jdk.v11 + shared + $.run.generate_native_config, - "ruby-generate-native-config-linux-aarch64": $.platform.linux_arm64 + $.jdk.v11 + shared + $.run.generate_native_config, - "ruby-generate-native-config-darwin-amd64": $.platform.darwin + $.jdk.v11 + shared + $.run.generate_native_config, + "ruby-generate-native-config-linux-amd64": $.platform.linux + $.jdk.v11 + shared + $.run.generate_native_config, + "ruby-generate-native-config-linux-aarch64": $.platform.linux_aarch64 + $.jdk.v11 + shared + $.run.generate_native_config, + "ruby-generate-native-config-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + shared + $.run.generate_native_config, + "ruby-generate-native-config-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + shared + $.run.generate_native_config, }, builds: diff --git a/lib/cext/ABI_check.txt b/lib/cext/ABI_check.txt index 0cfbf08886fc..00750edc07d6 100644 --- a/lib/cext/ABI_check.txt +++ b/lib/cext/ABI_check.txt @@ -1 +1 @@ -2 +3 diff --git a/lib/cext/include/ruby/config.h b/lib/cext/include/ruby/config.h index 9f4c3bd5b53c..146a1a234cd8 100644 --- a/lib/cext/include/ruby/config.h +++ b/lib/cext/include/ruby/config.h @@ -3,6 +3,8 @@ #if defined(__x86_64__) #include +#elif defined(__aarch64__) +#include #else #error Unsupported platform #endif diff --git a/lib/cext/include/truffleruby/config_darwin_aarch64.h b/lib/cext/include/truffleruby/config_darwin_aarch64.h new file mode 100644 index 000000000000..dabacf7cc922 --- /dev/null +++ b/lib/cext/include/truffleruby/config_darwin_aarch64.h @@ -0,0 +1,403 @@ +#ifndef INCLUDE_RUBY_CONFIG_H +#define INCLUDE_RUBY_CONFIG_H 1 +/* confdefs.h */ +#define STDC_HEADERS 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_UNISTD_H 1 +#define __EXTENSIONS__ 1 +#define _ALL_SOURCE 1 +#define _GNU_SOURCE 1 +#define _POSIX_PTHREAD_SEMANTICS 1 +#define _TANDEM_SOURCE 1 +#define RUBY_SYMBOL_EXPORT_BEGIN _Pragma("GCC visibility push(default)") +#define RUBY_SYMBOL_EXPORT_END _Pragma("GCC visibility pop") +#define HAVE_STMT_AND_DECL_IN_EXPR 1 +#define BROKEN_CRYPT 1 +#define HAVE_CRT_EXTERNS_H 1 +#define HAVE_LIBDL 1 +#define HAVE_DIRENT_H 1 +#define HAVE__BOOL 1 +#define HAVE_STDBOOL_H 1 +#define HAVE_SYS_WAIT_H 1 +#define HAVE_COPYFILE_H 1 +#define HAVE_GRP_H 1 +#define HAVE_FCNTL_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_LANGINFO_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_LOCALE_H 1 +#define HAVE_MALLOC_MALLOC_H 1 +#define HAVE_PWD_H 1 +#define HAVE_SANITIZER_ASAN_INTERFACE_H 1 +#define HAVE_SANITIZER_MSAN_INTERFACE_H 1 +#define HAVE_STDALIGN_H 1 +#define HAVE_SYS_ATTR_H 1 +#define HAVE_SYS_FCNTL_H 1 +#define HAVE_SYS_FILE_H 1 +#define HAVE_SYS_IOCTL_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_RESOURCE_H 1 +#define HAVE_SYS_SELECT_H 1 +#define HAVE_SYS_SOCKET_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TIMES_H 1 +#define HAVE_SYS_UIO_H 1 +#define HAVE_TIME_H 1 +#define HAVE_UCONTEXT_H 1 +#define HAVE_UTIME_H 1 +#define HAVE_GMP_H 1 +#define HAVE_LIBGMP 1 +#define HAVE_TYPEOF 1 +#define restrict __restrict +#define HAVE_LONG_LONG 1 +#define HAVE_OFF_T 1 +#define SIZEOF_INT 4 +#define SIZEOF_SHORT 2 +#define SIZEOF_LONG 8 +#define SIZEOF_LONG_LONG 8 +#define SIZEOF___INT64 0 +#define SIZEOF___INT128 16 +#define SIZEOF_OFF_T 8 +#define SIZEOF_VOIDP 8 +#define SIZEOF_FLOAT 4 +#define SIZEOF_DOUBLE 8 +#define SIZEOF_TIME_T 8 +#define SIZEOF_CLOCK_T 8 +#define PACKED_STRUCT(x) x __attribute__((packed)) +#define USE_UNALIGNED_MEMBER_ACCESS 1 +#define PRI_LL_PREFIX "ll" +#define HAVE_PID_T 1 +#define rb_pid_t pid_t +#define SIGNEDNESS_OF_PID_T -1 +#define PIDT2NUM(v) INT2NUM(v) +#define NUM2PIDT(v) NUM2INT(v) +#define PRI_PIDT_PREFIX PRI_INT_PREFIX +#define HAVE_UID_T 1 +#define rb_uid_t uid_t +#define SIGNEDNESS_OF_UID_T +1 +#define UIDT2NUM(v) UINT2NUM(v) +#define NUM2UIDT(v) NUM2UINT(v) +#define PRI_UIDT_PREFIX PRI_INT_PREFIX +#define HAVE_GID_T 1 +#define rb_gid_t gid_t +#define SIGNEDNESS_OF_GID_T +1 +#define GIDT2NUM(v) UINT2NUM(v) +#define NUM2GIDT(v) NUM2UINT(v) +#define PRI_GIDT_PREFIX PRI_INT_PREFIX +#define HAVE_TIME_T 1 +#define rb_time_t time_t +#define SIGNEDNESS_OF_TIME_T -1 +#define TIMET2NUM(v) LONG2NUM(v) +#define NUM2TIMET(v) NUM2LONG(v) +#define PRI_TIMET_PREFIX PRI_LONG_PREFIX +#define HAVE_DEV_T 1 +#define rb_dev_t dev_t +#define SIGNEDNESS_OF_DEV_T +1 +#define DEVT2NUM(v) ULONG2NUM(v) +#define NUM2DEVT(v) NUM2ULONG(v) +#define PRI_DEVT_PREFIX PRI_LONG_PREFIX +#define HAVE_MODE_T 1 +#define rb_mode_t mode_t +#define SIGNEDNESS_OF_MODE_T +1 +#define MODET2NUM(v) UINT2NUM(v) +#define NUM2MODET(v) NUM2UINT(v) +#define PRI_MODET_PREFIX PRI_INT_PREFIX +#define HAVE_RLIM_T 1 +#define rb_rlim_t rlim_t +#define SIGNEDNESS_OF_RLIM_T +1 +#define RLIM2NUM(v) ULONG2NUM(v) +#define NUM2RLIM(v) NUM2ULONG(v) +#define PRI_RLIM_PREFIX PRI_LONG_PREFIX +#define HAVE_OFF_T 1 +#define rb_off_t off_t +#define SIGNEDNESS_OF_OFF_T -1 +#define OFFT2NUM(v) LONG2NUM(v) +#define NUM2OFFT(v) NUM2LONG(v) +#define PRI_OFFT_PREFIX PRI_LONG_PREFIX +#define HAVE_CLOCKID_T 1 +#define rb_clockid_t clockid_t +#define SIGNEDNESS_OF_CLOCKID_T -1 +#define CLOCKID2NUM(v) INT2NUM(v) +#define NUM2CLOCKID(v) NUM2INT(v) +#define PRI_CLOCKID_PREFIX PRI_INT_PREFIX +#define HAVE_VA_ARGS_MACRO 1 +#define HAVE__ALIGNOF 1 +#define CONSTFUNC(x) __attribute__ ((__const__)) x +#define PUREFUNC(x) __attribute__ ((__pure__)) x +#define NORETURN(x) __attribute__ ((__noreturn__)) x +#define DEPRECATED(x) __attribute__ ((__deprecated__)) x +#define DEPRECATED_BY(n,x) __attribute__ ((__deprecated__("by "#n))) x +#define NOINLINE(x) __attribute__ ((__noinline__)) x +#define ALWAYS_INLINE(x) __attribute__ ((__always_inline__)) x +#define NO_SANITIZE(san, x) __attribute__ ((__no_sanitize__(san))) x +#define NO_SANITIZE_ADDRESS(x) __attribute__ ((__no_sanitize_address__)) x +#define NO_ADDRESS_SAFETY_ANALYSIS(x) __attribute__ ((__no_address_safety_analysis__)) x +#define WARN_UNUSED_RESULT(x) __attribute__ ((__warn_unused_result__)) x +#define MAYBE_UNUSED(x) __attribute__ ((__unused__)) x +#define WEAK(x) __attribute__ ((__weak__)) x +#define HAVE_FUNC_WEAK 1 +#define RUBY_CXX_DEPRECATED(msg) __attribute__((__deprecated__(msg))) +#define HAVE_NULLPTR 1 +#define FUNC_CDECL(x) __attribute__ ((__cdecl__)) x +#define HAVE_GCC_ATOMIC_BUILTINS 1 +#define HAVE_GCC_SYNC_BUILTINS 1 +#define RUBY_FUNC_EXPORTED __attribute__ ((__visibility__("default"))) extern +#define RUBY_FUNC_NONNULL(n,x) __attribute__ ((__nonnull__(n))) x +#define ENUM_OVER_INT 1 +#define HAVE_DECL_SYS_NERR 1 +#define HAVE_DECL_GETENV 1 +#define SIZEOF_SIZE_T 8 +#define SIZEOF_PTRDIFF_T 8 +#define PRI_SIZE_PREFIX "z" +#define PRI_PTRDIFF_PREFIX "t" +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 +#define HAVE_STRUCT_STAT_ST_RDEV 1 +#define SIZEOF_STRUCT_STAT_ST_SIZE SIZEOF_OFF_T +#define SIZEOF_STRUCT_STAT_ST_BLOCKS SIZEOF_OFF_T +#define SIZEOF_STRUCT_STAT_ST_INO SIZEOF_LONG +#define HAVE_STRUCT_STAT_ST_ATIMESPEC 1 +#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 +#define HAVE_STRUCT_STAT_ST_CTIMESPEC 1 +#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC 1 +#define HAVE_STRUCT_TIMEVAL 1 +#define SIZEOF_STRUCT_TIMEVAL_TV_SEC SIZEOF_TIME_T +#define HAVE_STRUCT_TIMESPEC 1 +#define HAVE_STRUCT_TIMEZONE 1 +#define HAVE_RB_FD_INIT 1 +#define HAVE_INT8_T 1 +#define SIZEOF_INT8_T 1 +#define HAVE_UINT8_T 1 +#define SIZEOF_UINT8_T 1 +#define HAVE_INT16_T 1 +#define SIZEOF_INT16_T 2 +#define HAVE_UINT16_T 1 +#define SIZEOF_UINT16_T 2 +#define HAVE_INT32_T 1 +#define SIZEOF_INT32_T 4 +#define HAVE_UINT32_T 1 +#define SIZEOF_UINT32_T 4 +#define HAVE_INT64_T 1 +#define SIZEOF_INT64_T 8 +#define HAVE_UINT64_T 1 +#define SIZEOF_UINT64_T 8 +#define HAVE_INT128_T 1 +#define int128_t __int128 +#define SIZEOF_INT128_T SIZEOF___INT128 +#define HAVE_UINT128_T 1 +#define uint128_t unsigned __int128 +#define SIZEOF_UINT128_T SIZEOF___INT128 +#define HAVE_INTPTR_T 1 +#define SIZEOF_INTPTR_T 8 +#define HAVE_UINTPTR_T 1 +#define SIZEOF_UINTPTR_T 8 +#define HAVE_SSIZE_T 1 +#define SIZEOF_SSIZE_T 8 +#define GETGROUPS_T gid_t +#define HAVE_ALLOCA_H 1 +#define HAVE_ALLOCA 1 +#define HAVE_ACOSH 1 +#define HAVE_CBRT 1 +#define HAVE_CRYPT 1 +#define HAVE_DUP2 1 +#define HAVE_ERF 1 +#define HAVE_FFS 1 +#define HAVE_FLOCK 1 +#define HAVE_HYPOT 1 +#define HAVE_LGAMMA_R 1 +#define HAVE_MEMMOVE 1 +#define HAVE_NAN 1 +#define HAVE_NEXTAFTER 1 +#define HAVE_STRCHR 1 +#define HAVE_STRERROR 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRSTR 1 +#define HAVE_TGAMMA 1 +#define HAVE_FINITE 1 +#define HAVE_ISINF 1 +#define HAVE_ISNAN 1 +#define SPT_TYPE SPT_REUSEARGV +#define HAVE_SIGNBIT 1 +#define HAVE_FORK 1 +#define vfork fork +#define HAVE_WORKING_FORK 1 +#define HAVE__LONGJMP 1 +#define HAVE_ARC4RANDOM_BUF 1 +#define HAVE_ATAN2L 1 +#define HAVE_ATAN2F 1 +#define HAVE_CHROOT 1 +#define HAVE_CLOCK_GETTIME 1 +#define HAVE_COSH 1 +#define HAVE_DIRFD 1 +#define HAVE_DLOPEN 1 +#define HAVE_DLADDR 1 +#define HAVE_DUP 1 +#define HAVE_ENDGRENT 1 +#define HAVE_FCOPYFILE 1 +#define HAVE_FCHMOD 1 +#define HAVE_FCHOWN 1 +#define HAVE_FCNTL 1 +#define HAVE_FDOPENDIR 1 +#define HAVE_FGETATTRLIST 1 +#define HAVE_FMOD 1 +#define HAVE_FSTATAT 1 +#define HAVE_FSYNC 1 +#define HAVE_FTRUNCATE 1 +#define HAVE_GETATTRLIST 1 +#define HAVE_GETCWD 1 +#define HAVE_GETGRNAM 1 +#define HAVE_GETGRNAM_R 1 +#define HAVE_GETGROUPS 1 +#define HAVE_GETLOGIN 1 +#define HAVE_GETLOGIN_R 1 +#define HAVE_GETPGID 1 +#define HAVE_GETPGRP 1 +#define HAVE_GETPRIORITY 1 +#define HAVE_GETPWNAM 1 +#define HAVE_GETPWNAM_R 1 +#define HAVE_GETPWUID 1 +#define HAVE_GETPWUID_R 1 +#define HAVE_GETRLIMIT 1 +#define HAVE_GETSID 1 +#define HAVE_GETTIMEOFDAY 1 +#define HAVE_GMTIME_R 1 +#define HAVE_GRANTPT 1 +#define HAVE_INITGROUPS 1 +#define HAVE_IOCTL 1 +#define HAVE_ISSETUGID 1 +#define HAVE_KILLPG 1 +#define HAVE_LCHMOD 1 +#define HAVE_LCHOWN 1 +#define HAVE_LINK 1 +#define HAVE_LLABS 1 +#define HAVE_LOCKF 1 +#define HAVE_LOG2 1 +#define HAVE_LSTAT 1 +#define HAVE_LUTIMES 1 +#define HAVE_MALLOC_SIZE 1 +#define HAVE_MBLEN 1 +#define HAVE_MEMSET_S 1 +#define HAVE_WRITEV 1 +#define HAVE_MEMMEM 1 +#define HAVE_MKFIFO 1 +#define HAVE_MKNOD 1 +#define HAVE_MKTIME 1 +#define HAVE_OPENAT 1 +#define HAVE_POLL 1 +#define HAVE_POSIX_MEMALIGN 1 +#define HAVE_PREAD 1 +#define HAVE_PWRITE 1 +#define HAVE_QSORT_R 1 +#define HAVE_READLINK 1 +#define HAVE_REALPATH 1 +#define HAVE_ROUND 1 +#define HAVE_SEEKDIR 1 +#define HAVE_SENDFILE 1 +#define HAVE_SETEGID 1 +#define HAVE_SETENV 1 +#define HAVE_SETEUID 1 +#define HAVE_SETGID 1 +#define HAVE_SETGROUPS 1 +#define HAVE_SETPGID 1 +#define HAVE_SETPGRP 1 +#define HAVE_SETREGID 1 +#define HAVE_SETREUID 1 +#define HAVE_SETRGID 1 +#define HAVE_SETRLIMIT 1 +#define HAVE_SETRUID 1 +#define HAVE_SETSID 1 +#define HAVE_SETUID 1 +#define HAVE_SHUTDOWN 1 +#define HAVE_SIGACTION 1 +#define HAVE_SIGALTSTACK 1 +#define HAVE_SIGPROCMASK 1 +#define HAVE_SINH 1 +#define HAVE_SYMLINK 1 +#define HAVE_SYSCONF 1 +#define HAVE_TANH 1 +#define HAVE_TELLDIR 1 +#define HAVE_TIMEGM 1 +#define HAVE_TIMES 1 +#define HAVE_TRUNCATE 1 +#define HAVE_UNSETENV 1 +#define HAVE_UTIMENSAT 1 +#define HAVE_UTIMES 1 +#define HAVE_WAIT4 1 +#define HAVE_WAITPID 1 +#define HAVE___COSPI 1 +#define HAVE___SINPI 1 +#if !defined __STDC_WANT_LIB_EXT1__ +#define __STDC_WANT_LIB_EXT1__ 1 +#endif /* !defined __STDC_WANT_LIB_EXT1__ */ +#define HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN 1 +#define HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED 1 +#define HAVE_BUILTIN___BUILTIN_BSWAP16 1 +#define HAVE_BUILTIN___BUILTIN_BSWAP32 1 +#define HAVE_BUILTIN___BUILTIN_BSWAP64 1 +#define HAVE_BUILTIN___BUILTIN_POPCOUNT 1 +#define HAVE_BUILTIN___BUILTIN_POPCOUNTLL 1 +#define HAVE_BUILTIN___BUILTIN_CLZ 1 +#define HAVE_BUILTIN___BUILTIN_CLZL 1 +#define HAVE_BUILTIN___BUILTIN_CLZLL 1 +#define HAVE_BUILTIN___BUILTIN_CTZ 1 +#define HAVE_BUILTIN___BUILTIN_CTZLL 1 +#define HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW 1 +#define HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW 1 +#define HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW 1 +#define HAVE_BUILTIN___BUILTIN_CONSTANT_P 1 +#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR 1 +#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P 1 +#define HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P 1 +#define HAVE_BUILTIN___BUILTIN_TRAP 1 +#define HAVE_BSD_QSORT_R 1 +#define ATAN2_INF_C99 1 +#define HAVE_CLOCK_GETRES 1 +#define HAVE_STRUCT_TM_TM_ZONE 1 +#define HAVE_TM_ZONE 1 +#define HAVE_STRUCT_TM_TM_GMTOFF 1 +#define HAVE_DAYLIGHT 1 +#define NEGATIVE_TIME_T 1 +#define POSIX_SIGNAL 1 +#define HAVE_SIG_T 1 +#define RSHIFT(x,y) ((x)>>(int)(y)) +#define HAVE__SC_CLK_TCK 1 +#define STACK_GROW_DIRECTION -1 +#define COROUTINE_H "coroutine/arm64/Context.h" +#define _REENTRANT 1 +#define _THREAD_SAFE 1 +#define HAVE_LIBPTHREAD 1 +#define HAVE_SCHED_YIELD 1 +#define HAVE_PTHREAD_ATTR_SETINHERITSCHED 1 +#define HAVE_PTHREAD_ATTR_GETSTACK 1 +#define HAVE_PTHREAD_ATTR_GETGUARDSIZE 1 +#define HAVE_PTHREAD_GET_STACKADDR_NP 1 +#define HAVE_PTHREAD_GET_STACKSIZE_NP 1 +#define HAVE_PTHREAD_SIGMASK 1 +#define HAVE_PTHREAD_SETNAME_NP 1 +#define SET_CURRENT_THREAD_NAME(name) pthread_setname_np(name) +#define DEFINE_MCONTEXT_PTR(mc, uc) mcontext_t mc = (uc)->uc_mcontext +#define HAVE_MACH_O_LOADER_H 1 +#define HAVE_LIBPROC_H 1 +#define HAVE_EXECINFO_H 1 +#define HAVE_LIBUNWIND_H 1 +#define HAVE_BACKTRACE 1 +#define BROKEN_BACKTRACE 1 +#define DLEXT_MAXLEN 7 +#define DLEXT ".bundle" +#define HAVE__SETJMP 1 +#define HAVE_SIGSETJMP 1 +#define RUBY_SETJMP(env) sigsetjmp((env),0) +#define RUBY_LONGJMP(env,val) siglongjmp((env),val) +#define RUBY_JMP_BUF sigjmp_buf +#define USE_MJIT 1 +#define HAVE_PTHREAD_H 1 +#define RUBY_PLATFORM "aarch64-darwin21" +#endif /* INCLUDE_RUBY_CONFIG_H */ diff --git a/lib/truffle/ffi/platform/aarch64-darwin/types.conf b/lib/truffle/ffi/platform/aarch64-darwin/types.conf new file mode 100644 index 000000000000..68841bb1d42f --- /dev/null +++ b/lib/truffle/ffi/platform/aarch64-darwin/types.conf @@ -0,0 +1,130 @@ +rbx.platform.typedef.__darwin_blkcnt_t = long_long +rbx.platform.typedef.__darwin_blksize_t = int +rbx.platform.typedef.__darwin_clock_t = ulong +rbx.platform.typedef.__darwin_ct_rune_t = int +rbx.platform.typedef.__darwin_dev_t = int +rbx.platform.typedef.__darwin_fsblkcnt_t = uint +rbx.platform.typedef.__darwin_fsfilcnt_t = uint +rbx.platform.typedef.__darwin_gid_t = uint +rbx.platform.typedef.__darwin_id_t = uint +rbx.platform.typedef.__darwin_ino64_t = ulong_long +rbx.platform.typedef.__darwin_ino_t = ulong_long +rbx.platform.typedef.__darwin_intptr_t = long +rbx.platform.typedef.__darwin_mach_port_name_t = uint +rbx.platform.typedef.__darwin_mach_port_t = uint +rbx.platform.typedef.__darwin_mode_t = ushort +rbx.platform.typedef.__darwin_natural_t = uint +rbx.platform.typedef.__darwin_off_t = long_long +rbx.platform.typedef.__darwin_pid_t = int +rbx.platform.typedef.__darwin_pthread_key_t = ulong +rbx.platform.typedef.__darwin_ptrdiff_t = long +rbx.platform.typedef.__darwin_rune_t = int +rbx.platform.typedef.__darwin_sigset_t = uint +rbx.platform.typedef.__darwin_size_t = ulong +rbx.platform.typedef.__darwin_socklen_t = uint +rbx.platform.typedef.__darwin_ssize_t = long +rbx.platform.typedef.__darwin_suseconds_t = int +rbx.platform.typedef.__darwin_time_t = long +rbx.platform.typedef.__darwin_uid_t = uint +rbx.platform.typedef.__darwin_useconds_t = uint +rbx.platform.typedef.__darwin_uuid_string_t[37] = char +rbx.platform.typedef.__darwin_uuid_t[16] = uchar +rbx.platform.typedef.__darwin_wchar_t = int +rbx.platform.typedef.__darwin_wint_t = int +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.errno_t = int +rbx.platform.typedef.fd_mask = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = uint +rbx.platform.typedef.fsfilcnt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino64_t = ulong_long +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = short +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ushort +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = ulong +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long_long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.rsize_t = ulong +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.sae_associd_t = uint +rbx.platform.typedef.sae_connid_t = uint +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.syscall_arg_t = ulong_long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = ushort +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.user_addr_t = ulong_long +rbx.platform.typedef.user_long_t = long_long +rbx.platform.typedef.user_off_t = long_long +rbx.platform.typedef.user_size_t = ulong_long +rbx.platform.typedef.user_ssize_t = long_long +rbx.platform.typedef.user_time_t = long_long +rbx.platform.typedef.user_ulong_t = ulong_long +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.wchar_t = int diff --git a/spec/ruby/core/process/spawn_spec.rb b/spec/ruby/core/process/spawn_spec.rb index 6be3f41a878b..9aa8da81251c 100644 --- a/spec/ruby/core/process/spawn_spec.rb +++ b/spec/ruby/core/process/spawn_spec.rb @@ -349,7 +349,7 @@ pgid = Process.getpgid(Process.pid) # The process group is not available on all platforms. # See "man proc" - /proc/[pid]/stat - (5) pgrp - # In Travis arm64 environment, the value is 0. + # In Travis aarch64 environment, the value is 0. # # $ cat /proc/[pid]/stat # 19179 (ruby) S 19160 0 0 ... diff --git a/spec/tags/library/socket/socket/listen_tags.txt b/spec/tags/library/socket/socket/listen_tags.txt index 98eb16090743..bada53c15bf6 100644 --- a/spec/tags/library/socket/socket/listen_tags.txt +++ b/spec/tags/library/socket/socket/listen_tags.txt @@ -1 +1 @@ -arm64:Socket#listen using IPv4 using a DGRAM socket raises Errno::EOPNOTSUPP +aarch64:Socket#listen using IPv4 using a DGRAM socket raises Errno::EOPNOTSUPP diff --git a/spec/tags/truffle/irb/arrows_tags.txt b/spec/tags/truffle/irb/arrows_tags.txt index ca5875fabbd3..8bf285a6509a 100644 --- a/spec/tags/truffle/irb/arrows_tags.txt +++ b/spec/tags/truffle/irb/arrows_tags.txt @@ -1,2 +1,2 @@ slow:IRB supports using arrow keys first -arm64:IRB supports using arrow keys first +aarch64:IRB supports using arrow keys first diff --git a/spec/tags/truffle/irb/interrupt_tags.txt b/spec/tags/truffle/irb/interrupt_tags.txt index c24ea3ca0435..03832905debe 100644 --- a/spec/tags/truffle/irb/interrupt_tags.txt +++ b/spec/tags/truffle/irb/interrupt_tags.txt @@ -1,2 +1,2 @@ slow:IRB can be interrupted with Ctrl+C -arm64:IRB can be interrupted with Ctrl+C +aarch64:IRB can be interrupted with Ctrl+C diff --git a/spec/tags/truffle/launcher_tags.txt b/spec/tags/truffle/launcher_tags.txt index 976883d1d3a8..c0010198da51 100644 --- a/spec/tags/truffle/launcher_tags.txt +++ b/spec/tags/truffle/launcher_tags.txt @@ -56,7 +56,7 @@ slow:The launcher supports running rdoc symlinked slow:The launcher supports running ri symlinked slow:The launcher supports running ruby symlinked slow:The launcher supports running truffleruby symlinked -arm64:The launcher for gem can install and uninstall the hello-world gem +aarch64:The launcher for gem can install and uninstall the hello-world gem slow:The launcher should recognize ruby --vm options in RUBYOPT slow:The launcher should recognize ruby --vm options in TRUFFLERUBYOPT slow:The launcher runtime configuration flags should recognize ruby --vm options in RUBYOPT when switching to JVM diff --git a/spec/truffleruby.mspec b/spec/truffleruby.mspec index 8714b9d44651..ce93bee8745d 100644 --- a/spec/truffleruby.mspec +++ b/spec/truffleruby.mspec @@ -25,7 +25,7 @@ class MSpecScript RbConfig::CONFIG['host_os'].include?('solaris') end - def self.arm64? + def self.aarch64? %w[arm64 aarch64].include? RbConfig::CONFIG['host_cpu'] end @@ -134,8 +134,8 @@ class MSpecScript excludes << 'solaris' end - if arm64? - excludes << 'arm64' + if aarch64? + excludes << 'aarch64' end # All specs, excluding specs needing C-extensions support, and TracePoint specs. diff --git a/src/main/java/org/truffleruby/platform/DarwinAArch64NativeConfiguration.java b/src/main/java/org/truffleruby/platform/DarwinAArch64NativeConfiguration.java new file mode 100644 index 000000000000..e6ddcb162751 --- /dev/null +++ b/src/main/java/org/truffleruby/platform/DarwinAArch64NativeConfiguration.java @@ -0,0 +1,745 @@ +/* + * Copyright (c) 2015, 2021 Oracle and/or its affiliates. All rights reserved. This + * code is released under a tri EPL/GPL/LGPL license. You can use it, + * redistribute it and/or modify it under the terms of the: + * + * Eclipse Public License version 2.0, or + * GNU General Public License version 2, or + * GNU Lesser General Public License version 2.1. + * + * This file contains configuration values translated from Rubinius. + * + * Copyright (c) 2007-2014, Evan Phoenix and contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Rubinius nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.truffleruby.platform; + +import org.truffleruby.RubyContext; + +public class DarwinAArch64NativeConfiguration extends DefaultNativeConfiguration { + + public static void load(NativeConfiguration configuration, RubyContext context) { + // Generated from tool/generate-native-config.rb on arm64-darwin20 + configuration.config("platform.sigaction.sizeof", 16); + configuration.config("platform.sigaction.sa_handler.offset", 0); + configuration.config("platform.sigaction.sa_handler.size", 8); + configuration.config("platform.sigaction.sa_handler.type", string(context, "pointer")); + configuration.config("platform.dirent.sizeof", 1048); + configuration.config("platform.dirent.d_name.offset", 21); + configuration.config("platform.dirent.d_name.size", 1024); + configuration.config("platform.dirent.d_name.type", string(context, "char_array")); + configuration.config("platform.dirent.d_type.offset", 20); + configuration.config("platform.dirent.d_type.size", 1); + configuration.config("platform.dirent.d_type.type", string(context, "uchar")); + configuration.config("platform.addrinfo.sizeof", 48); + configuration.config("platform.addrinfo.ai_flags.offset", 0); + configuration.config("platform.addrinfo.ai_flags.size", 4); + configuration.config("platform.addrinfo.ai_flags.type", string(context, "int")); + configuration.config("platform.addrinfo.ai_family.offset", 4); + configuration.config("platform.addrinfo.ai_family.size", 4); + configuration.config("platform.addrinfo.ai_family.type", string(context, "int")); + configuration.config("platform.addrinfo.ai_socktype.offset", 8); + configuration.config("platform.addrinfo.ai_socktype.size", 4); + configuration.config("platform.addrinfo.ai_socktype.type", string(context, "int")); + configuration.config("platform.addrinfo.ai_protocol.offset", 12); + configuration.config("platform.addrinfo.ai_protocol.size", 4); + configuration.config("platform.addrinfo.ai_protocol.type", string(context, "int")); + configuration.config("platform.addrinfo.ai_addrlen.offset", 16); + configuration.config("platform.addrinfo.ai_addrlen.size", 4); + configuration.config("platform.addrinfo.ai_addrlen.type", string(context, "uint")); + configuration.config("platform.addrinfo.ai_addr.offset", 32); + configuration.config("platform.addrinfo.ai_addr.size", 8); + configuration.config("platform.addrinfo.ai_addr.type", string(context, "pointer")); + configuration.config("platform.addrinfo.ai_canonname.offset", 24); + configuration.config("platform.addrinfo.ai_canonname.size", 8); + configuration.config("platform.addrinfo.ai_canonname.type", string(context, "string")); + configuration.config("platform.addrinfo.ai_next.offset", 40); + configuration.config("platform.addrinfo.ai_next.size", 8); + configuration.config("platform.addrinfo.ai_next.type", string(context, "pointer")); + configuration.config("platform.ifaddrs.sizeof", 56); + configuration.config("platform.ifaddrs.ifa_next.offset", 0); + configuration.config("platform.ifaddrs.ifa_next.size", 8); + configuration.config("platform.ifaddrs.ifa_next.type", string(context, "pointer")); + configuration.config("platform.ifaddrs.ifa_name.offset", 8); + configuration.config("platform.ifaddrs.ifa_name.size", 8); + configuration.config("platform.ifaddrs.ifa_name.type", string(context, "string")); + configuration.config("platform.ifaddrs.ifa_flags.offset", 16); + configuration.config("platform.ifaddrs.ifa_flags.size", 4); + configuration.config("platform.ifaddrs.ifa_flags.type", string(context, "uint")); + configuration.config("platform.ifaddrs.ifa_addr.offset", 24); + configuration.config("platform.ifaddrs.ifa_addr.size", 8); + configuration.config("platform.ifaddrs.ifa_addr.type", string(context, "pointer")); + configuration.config("platform.ifaddrs.ifa_netmask.offset", 32); + configuration.config("platform.ifaddrs.ifa_netmask.size", 8); + configuration.config("platform.ifaddrs.ifa_netmask.type", string(context, "pointer")); + configuration.config("platform.ifaddrs.ifa_broadaddr.offset", 40); + configuration.config("platform.ifaddrs.ifa_broadaddr.size", 8); + configuration.config("platform.ifaddrs.ifa_broadaddr.type", string(context, "pointer")); + configuration.config("platform.ifaddrs.ifa_dstaddr.offset", 40); + configuration.config("platform.ifaddrs.ifa_dstaddr.size", 8); + configuration.config("platform.ifaddrs.ifa_dstaddr.type", string(context, "pointer")); + configuration.config("platform.sockaddr.sizeof", 16); + configuration.config("platform.sockaddr.sa_family.offset", 1); + configuration.config("platform.sockaddr.sa_family.size", 1); + configuration.config("platform.sockaddr.sa_family.type", string(context, "uchar")); + configuration.config("platform.sockaddr.sa_data.offset", 2); + configuration.config("platform.sockaddr.sa_data.size", 14); + configuration.config("platform.sockaddr.sa_data.type", string(context, "char_array")); + configuration.config("platform.sockaddr_in.sizeof", 16); + configuration.config("platform.sockaddr_in.sin_family.offset", 1); + configuration.config("platform.sockaddr_in.sin_family.size", 1); + configuration.config("platform.sockaddr_in.sin_family.type", string(context, "uchar")); + configuration.config("platform.sockaddr_in.sin_port.offset", 2); + configuration.config("platform.sockaddr_in.sin_port.size", 2); + configuration.config("platform.sockaddr_in.sin_port.type", string(context, "ushort")); + configuration.config("platform.sockaddr_in.sin_addr.offset", 4); + configuration.config("platform.sockaddr_in.sin_addr.size", 4); + configuration.config("platform.sockaddr_in.sin_addr.type", string(context, "char_array")); + configuration.config("platform.sockaddr_in.sin_zero.offset", 8); + configuration.config("platform.sockaddr_in.sin_zero.size", 8); + configuration.config("platform.sockaddr_in.sin_zero.type", string(context, "char_array")); + configuration.config("platform.sockaddr_in6.sizeof", 28); + configuration.config("platform.sockaddr_in6.sin6_family.offset", 1); + configuration.config("platform.sockaddr_in6.sin6_family.size", 1); + configuration.config("platform.sockaddr_in6.sin6_family.type", string(context, "uchar")); + configuration.config("platform.sockaddr_in6.sin6_port.offset", 2); + configuration.config("platform.sockaddr_in6.sin6_port.size", 2); + configuration.config("platform.sockaddr_in6.sin6_port.type", string(context, "ushort")); + configuration.config("platform.sockaddr_in6.sin6_flowinfo.offset", 4); + configuration.config("platform.sockaddr_in6.sin6_flowinfo.size", 4); + configuration.config("platform.sockaddr_in6.sin6_flowinfo.type", string(context, "uint")); + configuration.config("platform.sockaddr_in6.sin6_addr.offset", 8); + configuration.config("platform.sockaddr_in6.sin6_addr.size", 16); + configuration.config("platform.sockaddr_in6.sin6_addr.type", string(context, "char_array")); + configuration.config("platform.sockaddr_in6.sin6_scope_id.offset", 24); + configuration.config("platform.sockaddr_in6.sin6_scope_id.size", 4); + configuration.config("platform.sockaddr_in6.sin6_scope_id.type", string(context, "uint")); + configuration.config("platform.sockaddr_un.sizeof", 106); + configuration.config("platform.sockaddr_un.sun_family.offset", 1); + configuration.config("platform.sockaddr_un.sun_family.size", 1); + configuration.config("platform.sockaddr_un.sun_family.type", string(context, "uchar")); + configuration.config("platform.sockaddr_un.sun_path.offset", 2); + configuration.config("platform.sockaddr_un.sun_path.size", 104); + configuration.config("platform.sockaddr_un.sun_path.type", string(context, "char_array")); + configuration.config("platform.hostent.sizeof", 32); + configuration.config("platform.hostent.h_name.offset", 0); + configuration.config("platform.hostent.h_name.size", 8); + configuration.config("platform.hostent.h_name.type", string(context, "string")); + configuration.config("platform.hostent.h_aliases.offset", 8); + configuration.config("platform.hostent.h_aliases.size", 8); + configuration.config("platform.hostent.h_aliases.type", string(context, "pointer")); + configuration.config("platform.hostent.h_addrtype.offset", 16); + configuration.config("platform.hostent.h_addrtype.size", 4); + configuration.config("platform.hostent.h_addrtype.type", string(context, "int")); + configuration.config("platform.hostent.h_length.offset", 20); + configuration.config("platform.hostent.h_length.size", 4); + configuration.config("platform.hostent.h_length.type", string(context, "int")); + configuration.config("platform.hostent.h_addr_list.offset", 24); + configuration.config("platform.hostent.h_addr_list.size", 8); + configuration.config("platform.hostent.h_addr_list.type", string(context, "pointer")); + configuration.config("platform.linger.sizeof", 8); + configuration.config("platform.linger.l_onoff.offset", 0); + configuration.config("platform.linger.l_onoff.size", 4); + configuration.config("platform.linger.l_onoff.type", string(context, "int")); + configuration.config("platform.linger.l_linger.offset", 4); + configuration.config("platform.linger.l_linger.size", 4); + configuration.config("platform.linger.l_linger.type", string(context, "int")); + configuration.config("platform.iovec.sizeof", 16); + configuration.config("platform.iovec.iov_base.offset", 0); + configuration.config("platform.iovec.iov_base.size", 8); + configuration.config("platform.iovec.iov_base.type", string(context, "pointer")); + configuration.config("platform.iovec.iov_len.offset", 8); + configuration.config("platform.iovec.iov_len.size", 8); + configuration.config("platform.iovec.iov_len.type", string(context, "ulong")); + configuration.config("platform.msghdr.sizeof", 48); + configuration.config("platform.msghdr.msg_name.offset", 0); + configuration.config("platform.msghdr.msg_name.size", 8); + configuration.config("platform.msghdr.msg_name.type", string(context, "pointer")); + configuration.config("platform.msghdr.msg_namelen.offset", 8); + configuration.config("platform.msghdr.msg_namelen.size", 4); + configuration.config("platform.msghdr.msg_namelen.type", string(context, "uint")); + configuration.config("platform.msghdr.msg_iov.offset", 16); + configuration.config("platform.msghdr.msg_iov.size", 8); + configuration.config("platform.msghdr.msg_iov.type", string(context, "pointer")); + configuration.config("platform.msghdr.msg_iovlen.offset", 24); + configuration.config("platform.msghdr.msg_iovlen.size", 4); + configuration.config("platform.msghdr.msg_iovlen.type", string(context, "int")); + configuration.config("platform.msghdr.msg_control.offset", 32); + configuration.config("platform.msghdr.msg_control.size", 8); + configuration.config("platform.msghdr.msg_control.type", string(context, "pointer")); + configuration.config("platform.msghdr.msg_controllen.offset", 40); + configuration.config("platform.msghdr.msg_controllen.size", 4); + configuration.config("platform.msghdr.msg_controllen.type", string(context, "uint")); + configuration.config("platform.msghdr.msg_flags.offset", 44); + configuration.config("platform.msghdr.msg_flags.size", 4); + configuration.config("platform.msghdr.msg_flags.type", string(context, "int")); + configuration.config("platform.servent.sizeof", 32); + configuration.config("platform.servent.s_name.offset", 0); + configuration.config("platform.servent.s_name.size", 8); + configuration.config("platform.servent.s_name.type", string(context, "string")); + configuration.config("platform.servent.s_aliases.offset", 8); + configuration.config("platform.servent.s_aliases.size", 8); + configuration.config("platform.servent.s_aliases.type", string(context, "pointer")); + configuration.config("platform.servent.s_port.offset", 16); + configuration.config("platform.servent.s_port.size", 4); + configuration.config("platform.servent.s_port.type", string(context, "int")); + configuration.config("platform.servent.s_proto.offset", 24); + configuration.config("platform.servent.s_proto.size", 8); + configuration.config("platform.servent.s_proto.type", string(context, "string")); + configuration.config("platform.errno.E2BIG", 7); + configuration.config("platform.errno.EACCES", 13); + configuration.config("platform.errno.EADDRINUSE", 48); + configuration.config("platform.errno.EADDRNOTAVAIL", 49); + configuration.config("platform.errno.EAFNOSUPPORT", 47); + configuration.config("platform.errno.EAGAIN", 35); + configuration.config("platform.errno.EALREADY", 37); + configuration.config("platform.errno.EAUTH", 80); + configuration.config("platform.errno.EBADARCH", 86); + configuration.config("platform.errno.EBADEXEC", 85); + configuration.config("platform.errno.EBADF", 9); + configuration.config("platform.errno.EBADMACHO", 88); + configuration.config("platform.errno.EBADMSG", 94); + configuration.config("platform.errno.EBADRPC", 72); + configuration.config("platform.errno.EBUSY", 16); + configuration.config("platform.errno.ECANCELED", 89); + configuration.config("platform.errno.ECHILD", 10); + configuration.config("platform.errno.ECONNABORTED", 53); + configuration.config("platform.errno.ECONNREFUSED", 61); + configuration.config("platform.errno.ECONNRESET", 54); + configuration.config("platform.errno.EDEADLK", 11); + configuration.config("platform.errno.EDESTADDRREQ", 39); + configuration.config("platform.errno.EDEVERR", 83); + configuration.config("platform.errno.EDOM", 33); + configuration.config("platform.errno.EDQUOT", 69); + configuration.config("platform.errno.EEXIST", 17); + configuration.config("platform.errno.EFAULT", 14); + configuration.config("platform.errno.EFBIG", 27); + configuration.config("platform.errno.EFTYPE", 79); + configuration.config("platform.errno.EHOSTDOWN", 64); + configuration.config("platform.errno.EHOSTUNREACH", 65); + configuration.config("platform.errno.EIDRM", 90); + configuration.config("platform.errno.EILSEQ", 92); + configuration.config("platform.errno.EINPROGRESS", 36); + configuration.config("platform.errno.EINTR", 4); + configuration.config("platform.errno.EINVAL", 22); + configuration.config("platform.errno.EIO", 5); + configuration.config("platform.errno.EISCONN", 56); + configuration.config("platform.errno.EISDIR", 21); + configuration.config("platform.errno.ELAST", 106); + configuration.config("platform.errno.ELOOP", 62); + configuration.config("platform.errno.EMFILE", 24); + configuration.config("platform.errno.EMLINK", 31); + configuration.config("platform.errno.EMSGSIZE", 40); + configuration.config("platform.errno.EMULTIHOP", 95); + configuration.config("platform.errno.ENAMETOOLONG", 63); + configuration.config("platform.errno.ENEEDAUTH", 81); + configuration.config("platform.errno.ENETDOWN", 50); + configuration.config("platform.errno.ENETRESET", 52); + configuration.config("platform.errno.ENETUNREACH", 51); + configuration.config("platform.errno.ENFILE", 23); + configuration.config("platform.errno.ENOATTR", 93); + configuration.config("platform.errno.ENOBUFS", 55); + configuration.config("platform.errno.ENODATA", 96); + configuration.config("platform.errno.ENODEV", 19); + configuration.config("platform.errno.ENOENT", 2); + configuration.config("platform.errno.ENOEXEC", 8); + configuration.config("platform.errno.ENOLCK", 77); + configuration.config("platform.errno.ENOLINK", 97); + configuration.config("platform.errno.ENOMEM", 12); + configuration.config("platform.errno.ENOMSG", 91); + configuration.config("platform.errno.ENOPOLICY", 103); + configuration.config("platform.errno.ENOPROTOOPT", 42); + configuration.config("platform.errno.ENOSPC", 28); + configuration.config("platform.errno.ENOSR", 98); + configuration.config("platform.errno.ENOSTR", 99); + configuration.config("platform.errno.ENOSYS", 78); + configuration.config("platform.errno.ENOTBLK", 15); + configuration.config("platform.errno.ENOTCONN", 57); + configuration.config("platform.errno.ENOTDIR", 20); + configuration.config("platform.errno.ENOTEMPTY", 66); + configuration.config("platform.errno.ENOTRECOVERABLE", 104); + configuration.config("platform.errno.ENOTSOCK", 38); + configuration.config("platform.errno.ENOTSUP", 45); + configuration.config("platform.errno.ENOTTY", 25); + configuration.config("platform.errno.ENXIO", 6); + configuration.config("platform.errno.EOPNOTSUPP", 102); + configuration.config("platform.errno.EOVERFLOW", 84); + configuration.config("platform.errno.EOWNERDEAD", 105); + configuration.config("platform.errno.EPERM", 1); + configuration.config("platform.errno.EPFNOSUPPORT", 46); + configuration.config("platform.errno.EPIPE", 32); + configuration.config("platform.errno.EPROCLIM", 67); + configuration.config("platform.errno.EPROCUNAVAIL", 76); + configuration.config("platform.errno.EPROGMISMATCH", 75); + configuration.config("platform.errno.EPROGUNAVAIL", 74); + configuration.config("platform.errno.EPROTO", 100); + configuration.config("platform.errno.EPROTONOSUPPORT", 43); + configuration.config("platform.errno.EPROTOTYPE", 41); + configuration.config("platform.errno.EPWROFF", 82); + configuration.config("platform.errno.EQFULL", 106); + configuration.config("platform.errno.ERANGE", 34); + configuration.config("platform.errno.EREMOTE", 71); + configuration.config("platform.errno.EROFS", 30); + configuration.config("platform.errno.ERPCMISMATCH", 73); + configuration.config("platform.errno.ESHLIBVERS", 87); + configuration.config("platform.errno.ESHUTDOWN", 58); + configuration.config("platform.errno.ESOCKTNOSUPPORT", 44); + configuration.config("platform.errno.ESPIPE", 29); + configuration.config("platform.errno.ESRCH", 3); + configuration.config("platform.errno.ESTALE", 70); + configuration.config("platform.errno.ETIME", 101); + configuration.config("platform.errno.ETIMEDOUT", 60); + configuration.config("platform.errno.ETOOMANYREFS", 59); + configuration.config("platform.errno.ETXTBSY", 26); + configuration.config("platform.errno.EUSERS", 68); + configuration.config("platform.errno.EWOULDBLOCK", 35); + configuration.config("platform.errno.EXDEV", 18); + configuration.config("platform.limits.NSIG", 32); + configuration.config("platform.langinfo.CODESET", 0); + configuration.config("platform.file.FNM_CASEFOLD", 16); + configuration.config("platform.file.FNM_NOESCAPE", 1); + configuration.config("platform.file.FNM_PATHNAME", 2); + configuration.config("platform.file.LOCK_SH", 1); + configuration.config("platform.file.LOCK_EX", 2); + configuration.config("platform.file.LOCK_NB", 4); + configuration.config("platform.file.LOCK_UN", 8); + configuration.config("platform.file.O_RDONLY", 0); + configuration.config("platform.file.O_WRONLY", 1); + configuration.config("platform.file.O_RDWR", 2); + configuration.config("platform.file.O_ACCMODE", 3); + configuration.config("platform.file.O_CLOEXEC", 16777216); + configuration.config("platform.file.O_CREAT", 512); + configuration.config("platform.file.O_EXCL", 2048); + configuration.config("platform.file.O_NOCTTY", 131072); + configuration.config("platform.file.O_TRUNC", 1024); + configuration.config("platform.file.O_APPEND", 8); + configuration.config("platform.file.O_NONBLOCK", 4); + configuration.config("platform.file.O_NDELAY", 4); + configuration.config("platform.file.O_SYNC", 128); + configuration.config("platform.file.S_IRUSR", 256); + configuration.config("platform.file.S_IWUSR", 128); + configuration.config("platform.file.S_IXUSR", 64); + configuration.config("platform.file.S_IRGRP", 32); + configuration.config("platform.file.S_IWGRP", 16); + configuration.config("platform.file.S_IXGRP", 8); + configuration.config("platform.file.S_IROTH", 4); + configuration.config("platform.file.S_IWOTH", 2); + configuration.config("platform.file.S_IXOTH", 1); + configuration.config("platform.file.S_IFMT", 61440); + configuration.config("platform.file.S_IFIFO", 4096); + configuration.config("platform.file.S_IFCHR", 8192); + configuration.config("platform.file.S_IFDIR", 16384); + configuration.config("platform.file.S_IFBLK", 24576); + configuration.config("platform.file.S_IFREG", 32768); + configuration.config("platform.file.S_IFLNK", 40960); + configuration.config("platform.file.S_IFSOCK", 49152); + configuration.config("platform.file.S_IFWHT", 57344); + configuration.config("platform.file.S_ISUID", 2048); + configuration.config("platform.file.S_ISGID", 1024); + configuration.config("platform.file.S_ISVTX", 512); + configuration.config("platform.file.DT_BLK", 6); + configuration.config("platform.file.DT_CHR", 2); + configuration.config("platform.file.DT_DIR", 4); + configuration.config("platform.file.DT_FIFO", 1); + configuration.config("platform.file.DT_LNK", 10); + configuration.config("platform.file.DT_REG", 8); + configuration.config("platform.file.DT_SOCK", 12); + configuration.config("platform.file.DT_UNKNOWN", 0); + configuration.config("platform.file.AT_SYMLINK_NOFOLLOW", 32); + configuration.config("platform.io.SEEK_SET", 0); + configuration.config("platform.io.SEEK_CUR", 1); + configuration.config("platform.io.SEEK_END", 2); + configuration.config("platform.fcntl.F_GETFL", 3); + configuration.config("platform.fcntl.F_SETFL", 4); + configuration.config("platform.fcntl.F_DUPFD", 0); + configuration.config("platform.fcntl.F_DUPFD_CLOEXEC", 67); + configuration.config("platform.fcntl.F_GETFD", 1); + configuration.config("platform.fcntl.F_SETFD", 2); + configuration.config("platform.fcntl.FD_CLOEXEC", 1); + configuration.config("platform.fcntl.F_GETOWN", 5); + configuration.config("platform.fcntl.F_SETOWN", 6); + configuration.config("platform.fcntl.F_GETLK", 7); + configuration.config("platform.fcntl.F_SETLK", 8); + configuration.config("platform.fcntl.F_SETLKW", 9); + configuration.config("platform.fcntl.F_RDLCK", 1); + configuration.config("platform.fcntl.F_UNLCK", 2); + configuration.config("platform.fcntl.F_WRLCK", 3); + configuration.config("platform.fcntl.F_CHKCLEAN", 41); + configuration.config("platform.fcntl.F_PREALLOCATE", 42); + configuration.config("platform.fcntl.F_SETSIZE", 43); + configuration.config("platform.fcntl.F_RDADVISE", 44); + configuration.config("platform.fcntl.F_RDAHEAD", 45); + configuration.config("platform.fcntl.F_NOCACHE", 48); + configuration.config("platform.fcntl.F_LOG2PHYS", 49); + configuration.config("platform.fcntl.F_GETPATH", 50); + configuration.config("platform.fcntl.F_FULLFSYNC", 51); + configuration.config("platform.fcntl.F_PATHPKG_CHECK", 52); + configuration.config("platform.fcntl.F_FREEZE_FS", 53); + configuration.config("platform.fcntl.F_THAW_FS", 54); + configuration.config("platform.fcntl.F_GLOBAL_NOCACHE", 55); + configuration.config("platform.fcntl.F_ALLOCATECONTIG", 2); + configuration.config("platform.fcntl.F_ALLOCATEALL", 4); + configuration.config("platform.socket.AF_APPLETALK", 16); + configuration.config("platform.socket.PF_APPLETALK", 16); + configuration.config("platform.socket.AF_INET", 2); + configuration.config("platform.socket.PF_INET", 2); + configuration.config("platform.socket.AF_INET6", 30); + configuration.config("platform.socket.PF_INET6", 30); + configuration.config("platform.socket.AF_IPX", 23); + configuration.config("platform.socket.PF_IPX", 23); + configuration.config("platform.socket.AF_ISDN", 28); + configuration.config("platform.socket.PF_ISDN", 28); + configuration.config("platform.socket.AF_LOCAL", 1); + configuration.config("platform.socket.PF_LOCAL", 1); + configuration.config("platform.socket.AF_MAX", 41); + configuration.config("platform.socket.PF_MAX", 41); + configuration.config("platform.socket.AF_ROUTE", 17); + configuration.config("platform.socket.PF_ROUTE", 17); + configuration.config("platform.socket.AF_SNA", 11); + configuration.config("platform.socket.PF_SNA", 11); + configuration.config("platform.socket.AF_UNIX", 1); + configuration.config("platform.socket.PF_UNIX", 1); + configuration.config("platform.socket.AF_UNSPEC", 0); + configuration.config("platform.socket.PF_UNSPEC", 0); + configuration.config("platform.socket.PF_KEY", 29); + configuration.config("platform.socket.AI_ADDRCONFIG", 1024); + configuration.config("platform.socket.AI_ALL", 256); + configuration.config("platform.socket.AI_CANONNAME", 2); + configuration.config("platform.socket.AI_NUMERICHOST", 4); + configuration.config("platform.socket.AI_NUMERICSERV", 4096); + configuration.config("platform.socket.AI_PASSIVE", 1); + configuration.config("platform.socket.AI_V4MAPPED", 2048); + configuration.config("platform.socket.EAI_ADDRFAMILY", 1); + configuration.config("platform.socket.EAI_AGAIN", 2); + configuration.config("platform.socket.EAI_BADFLAGS", 3); + configuration.config("platform.socket.EAI_FAIL", 4); + configuration.config("platform.socket.EAI_FAMILY", 5); + configuration.config("platform.socket.EAI_MEMORY", 6); + configuration.config("platform.socket.EAI_NODATA", 7); + configuration.config("platform.socket.EAI_NONAME", 8); + configuration.config("platform.socket.EAI_OVERFLOW", 14); + configuration.config("platform.socket.EAI_SERVICE", 9); + configuration.config("platform.socket.EAI_SOCKTYPE", 10); + configuration.config("platform.socket.EAI_SYSTEM", 11); + configuration.config("platform.socket.IFF_ALLMULTI", 512); + configuration.config("platform.socket.IFF_BROADCAST", 2); + configuration.config("platform.socket.IFF_DEBUG", 4); + configuration.config("platform.socket.IFF_LOOPBACK", 8); + configuration.config("platform.socket.IFF_MULTICAST", 32768); + configuration.config("platform.socket.IFF_NOARP", 128); + configuration.config("platform.socket.IFF_NOTRAILERS", 32); + configuration.config("platform.socket.IFF_POINTOPOINT", 16); + configuration.config("platform.socket.IFF_PROMISC", 256); + configuration.config("platform.socket.IFF_RUNNING", 64); + configuration.config("platform.socket.IFF_UP", 1); + configuration.config("platform.socket.IF_NAMESIZE", 16); + configuration.config("platform.socket.INADDR_ALLHOSTS_GROUP", 3758096385L); + configuration.config("platform.socket.INADDR_ANY", 0); + configuration.config("platform.socket.INADDR_BROADCAST", 4294967295L); + configuration.config("platform.socket.INADDR_LOOPBACK", 2130706433); + configuration.config("platform.socket.INADDR_MAX_LOCAL_GROUP", 3758096639L); + configuration.config("platform.socket.INADDR_NONE", 4294967295L); + configuration.config("platform.socket.INADDR_UNSPEC_GROUP", 3758096384L); + configuration.config("platform.socket.INET6_ADDRSTRLEN", 46); + configuration.config("platform.socket.INET_ADDRSTRLEN", 16); + configuration.config("platform.socket.IPPORT_RESERVED", 1024); + configuration.config("platform.socket.IPPORT_USERRESERVED", 5000); + configuration.config("platform.socket.IPPROTO_AH", 51); + configuration.config("platform.socket.IPPROTO_DSTOPTS", 60); + configuration.config("platform.socket.IPPROTO_EGP", 8); + configuration.config("platform.socket.IPPROTO_ESP", 50); + configuration.config("platform.socket.IPPROTO_FRAGMENT", 44); + configuration.config("platform.socket.IPPROTO_HOPOPTS", 0); + configuration.config("platform.socket.IPPROTO_ICMP", 1); + configuration.config("platform.socket.IPPROTO_ICMPV6", 58); + configuration.config("platform.socket.IPPROTO_IDP", 22); + configuration.config("platform.socket.IPPROTO_IGMP", 2); + configuration.config("platform.socket.IPPROTO_IP", 0); + configuration.config("platform.socket.IPPROTO_IPV6", 41); + configuration.config("platform.socket.IPPROTO_NONE", 59); + configuration.config("platform.socket.IPPROTO_PUP", 12); + configuration.config("platform.socket.IPPROTO_RAW", 255); + configuration.config("platform.socket.IPPROTO_ROUTING", 43); + configuration.config("platform.socket.IPPROTO_TCP", 6); + configuration.config("platform.socket.IPPROTO_TP", 29); + configuration.config("platform.socket.IPPROTO_UDP", 17); + configuration.config("platform.socket.IPV6_CHECKSUM", 26); + configuration.config("platform.socket.IPV6_JOIN_GROUP", 12); + configuration.config("platform.socket.IPV6_LEAVE_GROUP", 13); + configuration.config("platform.socket.IPV6_MULTICAST_HOPS", 10); + configuration.config("platform.socket.IPV6_MULTICAST_IF", 9); + configuration.config("platform.socket.IPV6_MULTICAST_LOOP", 11); + configuration.config("platform.socket.IPV6_RECVTCLASS", 35); + configuration.config("platform.socket.IPV6_RTHDR_TYPE_0", 0); + configuration.config("platform.socket.IPV6_TCLASS", 36); + configuration.config("platform.socket.IPV6_UNICAST_HOPS", 4); + configuration.config("platform.socket.IPV6_V6ONLY", 27); + configuration.config("platform.socket.IP_ADD_MEMBERSHIP", 12); + configuration.config("platform.socket.IP_ADD_SOURCE_MEMBERSHIP", 70); + configuration.config("platform.socket.IP_BLOCK_SOURCE", 72); + configuration.config("platform.socket.IP_DEFAULT_MULTICAST_LOOP", 1); + configuration.config("platform.socket.IP_DEFAULT_MULTICAST_TTL", 1); + configuration.config("platform.socket.IP_DROP_MEMBERSHIP", 13); + configuration.config("platform.socket.IP_DROP_SOURCE_MEMBERSHIP", 71); + configuration.config("platform.socket.IP_HDRINCL", 2); + configuration.config("platform.socket.IP_IPSEC_POLICY", 21); + configuration.config("platform.socket.IP_MAX_MEMBERSHIPS", 4095); + configuration.config("platform.socket.IP_MSFILTER", 74); + configuration.config("platform.socket.IP_MULTICAST_IF", 9); + configuration.config("platform.socket.IP_MULTICAST_LOOP", 11); + configuration.config("platform.socket.IP_MULTICAST_TTL", 10); + configuration.config("platform.socket.IP_OPTIONS", 1); + configuration.config("platform.socket.IP_PKTINFO", 26); + configuration.config("platform.socket.IP_RECVOPTS", 5); + configuration.config("platform.socket.IP_RECVRETOPTS", 6); + configuration.config("platform.socket.IP_RECVTOS", 27); + configuration.config("platform.socket.IP_RECVTTL", 24); + configuration.config("platform.socket.IP_RETOPTS", 8); + configuration.config("platform.socket.IP_TOS", 3); + configuration.config("platform.socket.IP_TTL", 4); + configuration.config("platform.socket.IP_UNBLOCK_SOURCE", 73); + configuration.config("platform.socket.MCAST_BLOCK_SOURCE", 84); + configuration.config("platform.socket.MCAST_EXCLUDE", 2); + configuration.config("platform.socket.MCAST_INCLUDE", 1); + configuration.config("platform.socket.MCAST_JOIN_GROUP", 80); + configuration.config("platform.socket.MCAST_JOIN_SOURCE_GROUP", 82); + configuration.config("platform.socket.MCAST_LEAVE_GROUP", 81); + configuration.config("platform.socket.MCAST_LEAVE_SOURCE_GROUP", 83); + configuration.config("platform.socket.MCAST_UNBLOCK_SOURCE", 85); + configuration.config("platform.socket.MSG_CTRUNC", 32); + configuration.config("platform.socket.MSG_DONTROUTE", 4); + configuration.config("platform.socket.MSG_DONTWAIT", 128); + configuration.config("platform.socket.MSG_EOR", 8); + configuration.config("platform.socket.MSG_NOSIGNAL", 524288); + configuration.config("platform.socket.MSG_OOB", 1); + configuration.config("platform.socket.MSG_PEEK", 2); + configuration.config("platform.socket.MSG_TRUNC", 16); + configuration.config("platform.socket.MSG_WAITALL", 64); + configuration.config("platform.socket.NI_DGRAM", 16); + configuration.config("platform.socket.NI_MAXHOST", 1025); + configuration.config("platform.socket.NI_MAXSERV", 32); + configuration.config("platform.socket.NI_NAMEREQD", 4); + configuration.config("platform.socket.NI_NOFQDN", 1); + configuration.config("platform.socket.NI_NUMERICHOST", 2); + configuration.config("platform.socket.NI_NUMERICSERV", 8); + configuration.config("platform.socket.SCM_RIGHTS", 1); + configuration.config("platform.socket.SCM_TIMESTAMP", 2); + configuration.config("platform.socket.SEEK_CUR", 1); + configuration.config("platform.socket.SEEK_END", 2); + configuration.config("platform.socket.SEEK_SET", 0); + configuration.config("platform.socket.SHUT_RD", 0); + configuration.config("platform.socket.SHUT_RDWR", 2); + configuration.config("platform.socket.SHUT_WR", 1); + configuration.config("platform.socket.SOCK_DGRAM", 2); + configuration.config("platform.socket.SOCK_RAW", 3); + configuration.config("platform.socket.SOCK_RDM", 4); + configuration.config("platform.socket.SOCK_SEQPACKET", 5); + configuration.config("platform.socket.SOCK_STREAM", 1); + configuration.config("platform.socket.SOL_SOCKET", 65535); + configuration.config("platform.socket.SO_ACCEPTCONN", 2); + configuration.config("platform.socket.SO_BROADCAST", 32); + configuration.config("platform.socket.SO_DEBUG", 1); + configuration.config("platform.socket.SO_DONTROUTE", 16); + configuration.config("platform.socket.SO_ERROR", 4103); + configuration.config("platform.socket.SO_KEEPALIVE", 8); + configuration.config("platform.socket.SO_LINGER", 128); + configuration.config("platform.socket.SO_OOBINLINE", 256); + configuration.config("platform.socket.SO_RCVBUF", 4098); + configuration.config("platform.socket.SO_RCVLOWAT", 4100); + configuration.config("platform.socket.SO_RCVTIMEO", 4102); + configuration.config("platform.socket.SO_REUSEADDR", 4); + configuration.config("platform.socket.SO_REUSEPORT", 512); + configuration.config("platform.socket.SO_SNDBUF", 4097); + configuration.config("platform.socket.SO_SNDLOWAT", 4099); + configuration.config("platform.socket.SO_SNDTIMEO", 4101); + configuration.config("platform.socket.SO_TIMESTAMP", 1024); + configuration.config("platform.socket.SO_TYPE", 4104); + configuration.config("platform.socket.TCP_FASTOPEN", 261); + configuration.config("platform.socket.TCP_KEEPCNT", 258); + configuration.config("platform.socket.TCP_KEEPINTVL", 257); + configuration.config("platform.socket.TCP_MAXSEG", 2); + configuration.config("platform.socket.TCP_NODELAY", 1); + configuration.config("platform.socket.SOMAXCONN", 128); + configuration.config("platform.process.EXIT_SUCCESS", 0); + configuration.config("platform.process.EXIT_FAILURE", 1); + configuration.config("platform.process.WNOHANG", 1); + configuration.config("platform.process.WUNTRACED", 2); + configuration.config("platform.process.PRIO_PROCESS", 0); + configuration.config("platform.process.PRIO_PGRP", 1); + configuration.config("platform.process.PRIO_USER", 2); + configuration.config("platform.process.RLIMIT_CPU", 0); + configuration.config("platform.process.RLIMIT_FSIZE", 1); + configuration.config("platform.process.RLIMIT_DATA", 2); + configuration.config("platform.process.RLIMIT_STACK", 3); + configuration.config("platform.process.RLIMIT_CORE", 4); + configuration.config("platform.process.RLIMIT_RSS", 5); + configuration.config("platform.process.RLIMIT_NPROC", 7); + configuration.config("platform.process.RLIMIT_NOFILE", 8); + configuration.config("platform.process.RLIMIT_MEMLOCK", 6); + configuration.config("platform.process.RLIMIT_AS", 5); + configuration.config("platform.process.RLIM_INFINITY", 9223372036854775807L); + configuration.config("platform.process.RLIM_SAVED_MAX", 9223372036854775807L); + configuration.config("platform.process.RLIM_SAVED_CUR", 9223372036854775807L); + configuration.config("platform.signal.SIGHUP", 1); + configuration.config("platform.signal.SIGINT", 2); + configuration.config("platform.signal.SIGQUIT", 3); + configuration.config("platform.signal.SIGILL", 4); + configuration.config("platform.signal.SIGTRAP", 5); + configuration.config("platform.signal.SIGIOT", 6); + configuration.config("platform.signal.SIGABRT", 6); + configuration.config("platform.signal.SIGEMT", 7); + configuration.config("platform.signal.SIGFPE", 8); + configuration.config("platform.signal.SIGKILL", 9); + configuration.config("platform.signal.SIGBUS", 10); + configuration.config("platform.signal.SIGSEGV", 11); + configuration.config("platform.signal.SIGSYS", 12); + configuration.config("platform.signal.SIGPIPE", 13); + configuration.config("platform.signal.SIGALRM", 14); + configuration.config("platform.signal.SIGTERM", 15); + configuration.config("platform.signal.SIGURG", 16); + configuration.config("platform.signal.SIGSTOP", 17); + configuration.config("platform.signal.SIGTSTP", 18); + configuration.config("platform.signal.SIGCONT", 19); + configuration.config("platform.signal.SIGCHLD", 20); + configuration.config("platform.signal.SIGTTIN", 21); + configuration.config("platform.signal.SIGTTOU", 22); + configuration.config("platform.signal.SIGIO", 23); + configuration.config("platform.signal.SIGXCPU", 24); + configuration.config("platform.signal.SIGXFSZ", 25); + configuration.config("platform.signal.SIGVTALRM", 26); + configuration.config("platform.signal.SIGPROF", 27); + configuration.config("platform.signal.SIGWINCH", 28); + configuration.config("platform.signal.SIGUSR1", 30); + configuration.config("platform.signal.SIGUSR2", 31); + configuration.config("platform.signal.SIGINFO", 29); + configuration.config("platform.dlopen.RTLD_LAZY", 1); + configuration.config("platform.dlopen.RTLD_NOW", 2); + configuration.config("platform.dlopen.RTLD_LOCAL", 4); + configuration.config("platform.dlopen.RTLD_GLOBAL", 8); + configuration.config("platform.dlopen.RTLD_NEXT", -1); + configuration.config("platform.dlopen.RTLD_DEFAULT", -2); + configuration.config("platform.clocks.CLOCK_MONOTONIC", 6); + configuration.config("platform.clocks.CLOCK_MONOTONIC_RAW", 4); + configuration.config("platform.clocks.CLOCK_MONOTONIC_RAW_APPROX", 5); + configuration.config("platform.clocks.CLOCK_PROCESS_CPUTIME_ID", 12); + configuration.config("platform.clocks.CLOCK_REALTIME", 0); + configuration.config("platform.clocks.CLOCK_THREAD_CPUTIME_ID", 16); + configuration.config("platform.clocks.CLOCK_UPTIME_RAW", 8); + configuration.config("platform.clocks.CLOCK_UPTIME_RAW_APPROX", 9); + configuration.config("platform.typedef.int8_t", string(context, "char")); + configuration.config("platform.typedef.int16_t", string(context, "short")); + configuration.config("platform.typedef.int32_t", string(context, "int")); + configuration.config("platform.typedef.int64_t", string(context, "long_long")); + configuration.config("platform.typedef.uint8_t", string(context, "uchar")); + configuration.config("platform.typedef.uint16_t", string(context, "ushort")); + configuration.config("platform.typedef.uint32_t", string(context, "uint")); + configuration.config("platform.typedef.uint64_t", string(context, "ulong_long")); + configuration.config("platform.typedef.int_least8_t", string(context, "char")); + configuration.config("platform.typedef.int_least16_t", string(context, "short")); + configuration.config("platform.typedef.int_least32_t", string(context, "int")); + configuration.config("platform.typedef.int_least64_t", string(context, "long_long")); + configuration.config("platform.typedef.uint_least8_t", string(context, "uchar")); + configuration.config("platform.typedef.uint_least16_t", string(context, "ushort")); + configuration.config("platform.typedef.uint_least32_t", string(context, "uint")); + configuration.config("platform.typedef.uint_least64_t", string(context, "ulong_long")); + configuration.config("platform.typedef.int_fast8_t", string(context, "char")); + configuration.config("platform.typedef.int_fast16_t", string(context, "short")); + configuration.config("platform.typedef.int_fast32_t", string(context, "int")); + configuration.config("platform.typedef.int_fast64_t", string(context, "long_long")); + configuration.config("platform.typedef.uint_fast8_t", string(context, "uchar")); + configuration.config("platform.typedef.uint_fast16_t", string(context, "ushort")); + configuration.config("platform.typedef.uint_fast32_t", string(context, "uint")); + configuration.config("platform.typedef.uint_fast64_t", string(context, "ulong_long")); + configuration.config("platform.typedef.u_int8_t", string(context, "uchar")); + configuration.config("platform.typedef.u_int16_t", string(context, "ushort")); + configuration.config("platform.typedef.u_int32_t", string(context, "uint")); + configuration.config("platform.typedef.u_int64_t", string(context, "ulong_long")); + configuration.config("platform.typedef.register_t", string(context, "long_long")); + configuration.config("platform.typedef.uintptr_t", string(context, "ulong")); + configuration.config("platform.typedef.user_addr_t", string(context, "ulong_long")); + configuration.config("platform.typedef.user_size_t", string(context, "ulong_long")); + configuration.config("platform.typedef.user_ssize_t", string(context, "long_long")); + configuration.config("platform.typedef.user_long_t", string(context, "long_long")); + configuration.config("platform.typedef.user_ulong_t", string(context, "ulong_long")); + configuration.config("platform.typedef.user_time_t", string(context, "long_long")); + configuration.config("platform.typedef.user_off_t", string(context, "long_long")); + configuration.config("platform.typedef.syscall_arg_t", string(context, "ulong_long")); + configuration.config("platform.typedef.intptr_t", string(context, "long")); + configuration.config("platform.typedef.intmax_t", string(context, "long")); + configuration.config("platform.typedef.uintmax_t", string(context, "ulong")); + configuration.config("platform.typedef.ptrdiff_t", string(context, "long")); + configuration.config("platform.typedef.size_t", string(context, "ulong")); + configuration.config("platform.typedef.rsize_t", string(context, "ulong")); + configuration.config("platform.typedef.wchar_t", string(context, "int")); + configuration.config("platform.typedef.u_char", string(context, "uchar")); + configuration.config("platform.typedef.u_short", string(context, "ushort")); + configuration.config("platform.typedef.u_int", string(context, "uint")); + configuration.config("platform.typedef.u_long", string(context, "ulong")); + configuration.config("platform.typedef.ushort", string(context, "ushort")); + configuration.config("platform.typedef.uint", string(context, "uint")); + configuration.config("platform.typedef.u_quad_t", string(context, "ulong_long")); + configuration.config("platform.typedef.quad_t", string(context, "long_long")); + configuration.config("platform.typedef.qaddr_t", string(context, "pointer")); + configuration.config("platform.typedef.caddr_t", string(context, "string")); + configuration.config("platform.typedef.daddr_t", string(context, "int")); + configuration.config("platform.typedef.dev_t", string(context, "int")); + configuration.config("platform.typedef.fixpt_t", string(context, "uint")); + configuration.config("platform.typedef.blkcnt_t", string(context, "long_long")); + configuration.config("platform.typedef.blksize_t", string(context, "int")); + configuration.config("platform.typedef.gid_t", string(context, "uint")); + configuration.config("platform.typedef.in_addr_t", string(context, "uint")); + configuration.config("platform.typedef.in_port_t", string(context, "ushort")); + configuration.config("platform.typedef.ino_t", string(context, "ulong_long")); + configuration.config("platform.typedef.ino64_t", string(context, "ulong_long")); + configuration.config("platform.typedef.key_t", string(context, "int")); + configuration.config("platform.typedef.mode_t", string(context, "ushort")); + configuration.config("platform.typedef.nlink_t", string(context, "ushort")); + configuration.config("platform.typedef.id_t", string(context, "uint")); + configuration.config("platform.typedef.pid_t", string(context, "int")); + configuration.config("platform.typedef.off_t", string(context, "long_long")); + configuration.config("platform.typedef.segsz_t", string(context, "int")); + configuration.config("platform.typedef.swblk_t", string(context, "int")); + configuration.config("platform.typedef.uid_t", string(context, "uint")); + configuration.config("platform.typedef.clock_t", string(context, "ulong")); + configuration.config("platform.typedef.ssize_t", string(context, "long")); + configuration.config("platform.typedef.time_t", string(context, "long")); + configuration.config("platform.typedef.useconds_t", string(context, "uint")); + configuration.config("platform.typedef.suseconds_t", string(context, "int")); + configuration.config("platform.typedef.errno_t", string(context, "int")); + configuration.config("platform.typedef.fd_mask", string(context, "int")); + configuration.config("platform.typedef.pthread_key_t", string(context, "ulong")); + configuration.config("platform.typedef.fsblkcnt_t", string(context, "uint")); + configuration.config("platform.typedef.fsfilcnt_t", string(context, "uint")); + configuration.config("platform.typedef.sa_family_t", string(context, "uchar")); + configuration.config("platform.typedef.socklen_t", string(context, "uint")); + configuration.config("platform.typedef.sae_associd_t", string(context, "uint")); + configuration.config("platform.typedef.sae_connid_t", string(context, "uint")); + configuration.config("platform.typedef.rlim_t", string(context, "ulong_long")); + configuration.config("platform.typedef.rusage_info_t", string(context, "pointer")); + configuration.config("platform.typedef.pthread_t", string(context, "pointer")); + } + +} diff --git a/src/main/java/org/truffleruby/platform/LinuxARM64NativeConfiguration.java b/src/main/java/org/truffleruby/platform/LinuxAArch64NativeConfiguration.java similarity index 99% rename from src/main/java/org/truffleruby/platform/LinuxARM64NativeConfiguration.java rename to src/main/java/org/truffleruby/platform/LinuxAArch64NativeConfiguration.java index 0ca6503eafe8..90bdb2d90952 100644 --- a/src/main/java/org/truffleruby/platform/LinuxARM64NativeConfiguration.java +++ b/src/main/java/org/truffleruby/platform/LinuxAArch64NativeConfiguration.java @@ -39,7 +39,7 @@ import org.truffleruby.RubyContext; -public class LinuxARM64NativeConfiguration extends DefaultNativeConfiguration { +public class LinuxAArch64NativeConfiguration extends DefaultNativeConfiguration { public static void load(NativeConfiguration configuration, RubyContext context) { // Generated from tool/generate-native-config.rb on aarch64-linux diff --git a/src/main/java/org/truffleruby/platform/NativeConfiguration.java b/src/main/java/org/truffleruby/platform/NativeConfiguration.java index 32edfdc16edd..76e48e3da3fd 100644 --- a/src/main/java/org/truffleruby/platform/NativeConfiguration.java +++ b/src/main/java/org/truffleruby/platform/NativeConfiguration.java @@ -64,9 +64,8 @@ public static NativeConfiguration loadNativeConfiguration(RubyContext context) { case AMD64: LinuxAMD64NativeConfiguration.load(nativeConfiguration, context); return nativeConfiguration; - case ARM64: case AARCH64: - LinuxARM64NativeConfiguration.load(nativeConfiguration, context); + LinuxAArch64NativeConfiguration.load(nativeConfiguration, context); return nativeConfiguration; } break; @@ -75,6 +74,9 @@ public static NativeConfiguration loadNativeConfiguration(RubyContext context) { case AMD64: DarwinAMD64NativeConfiguration.load(nativeConfiguration, context); return nativeConfiguration; + case AARCH64: + DarwinAArch64NativeConfiguration.load(nativeConfiguration, context); + return nativeConfiguration; } break; } diff --git a/src/shared/java/org/truffleruby/shared/BasicPlatform.java b/src/shared/java/org/truffleruby/shared/BasicPlatform.java index 36fdf416a7e0..c2c170f56d9f 100644 --- a/src/shared/java/org/truffleruby/shared/BasicPlatform.java +++ b/src/shared/java/org/truffleruby/shared/BasicPlatform.java @@ -54,7 +54,6 @@ public enum OS_TYPE { public enum ARCH { AMD64("x86_64"), - ARM64("arm64"), AARCH64("aarch64"), UNKNOWN("unknown"); @@ -107,9 +106,8 @@ private static ARCH determineArchitecture() { case "amd64": case "x86_64": return ARCH.AMD64; - case "arm64": - return ARCH.ARM64; case "aarch64": + case "arm64": return ARCH.AARCH64; default: return ARCH.UNKNOWN; diff --git a/test/mri/excludes/TestFile.rb b/test/mri/excludes/TestFile.rb index 453b552a5e85..0ecec5925db9 100644 --- a/test/mri/excludes/TestFile.rb +++ b/test/mri/excludes/TestFile.rb @@ -8,3 +8,4 @@ exclude :test_file_share_delete, "needs investigation" exclude :test_stat, "needs investigation" exclude :test_realpath_special_symlink, "needs investigation" +exclude :test_open_tempfile_path, "fails on aarch64-linux" if RUBY_PLATFORM == 'aarch64-linux' diff --git a/test/mri/excludes/TestIO.rb b/test/mri/excludes/TestIO.rb index a05851240e93..fbbe6ab9494a 100644 --- a/test/mri/excludes/TestIO.rb +++ b/test/mri/excludes/TestIO.rb @@ -56,3 +56,4 @@ exclude :test_fcntl_lock_linux, "needs investigation - fails on Linux" exclude :test_select_memory_leak, "needs investigation" exclude :test_race_gets_and_close, "transient" +exclude :test_copy_stream_megacontent_nonblock, "transient, and very slow on aarch64-darwin" diff --git a/test/mri/excludes/TestOpenURI.rb b/test/mri/excludes/TestOpenURI.rb index 89843c6b8184..227b208d2783 100644 --- a/test/mri/excludes/TestOpenURI.rb +++ b/test/mri/excludes/TestOpenURI.rb @@ -1 +1,2 @@ exclude :test_encoding, "needs investigation" +exclude :test_open_timeout, "transient" if RUBY_PLATFORM == 'aarch64-darwin' diff --git a/tool/generate-native-config.rb b/tool/generate-native-config.rb index 58314855171d..d991d18ff3be 100644 --- a/tool/generate-native-config.rb +++ b/tool/generate-native-config.rb @@ -43,13 +43,15 @@ case RUBY_PLATFORM when /aarch64-linux/ - PLATFORM_FILE = 'org/truffleruby/platform/LinuxARM64NativeConfiguration.java' + PLATFORM_FILE = 'org/truffleruby/platform/LinuxAArch64NativeConfiguration.java' EXTRA_CFLAGS << ' -D_GNU_SOURCE' when /x86_64-linux/ PLATFORM_FILE = 'org/truffleruby/platform/LinuxAMD64NativeConfiguration.java' EXTRA_CFLAGS << ' -D_GNU_SOURCE' when /x86_64-darwin/ PLATFORM_FILE = 'org/truffleruby/platform/DarwinAMD64NativeConfiguration.java' +when /arm64.*-darwin/ + PLATFORM_FILE = 'org/truffleruby/platform/DarwinAArch64NativeConfiguration.java' else raise "Unsupported platform #{RUBY_PLATFORM}" end