Skip to content

Commit e6bed11

Browse files
committed
Enable cypes test on linux aarch64
1 parent aea5325 commit e6bed11

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

src/core/IronPython.Modules/_ctypes_test.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ private static string GetPydName() {
4444
string arch;
4545
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
4646
arch = IsArchitecutreArm64() ? "_arm64" : "_x86_64";
47+
} else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) {
48+
arch = IsArchitecutreArm64() ? "_aarch64" : Environment.Is64BitProcess ? "_x86_64" : "_i686";
4749
} else {
4850
arch = Environment.Is64BitProcess ? "64" : "32";
4951
}

tests/ctypes_test/Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
2-
ARCH ?= $(shell uname -m)
2+
MACHINE ?= $(shell uname -m)
33
BITS ?= 64
4-
TARGET = $(ARCH)-none-$(OS)
54
CC = gcc
6-
CFLAGS = -m$(BITS) -fPIC -Wall -Wextra -O2 -g
7-
LDFLAGS = -m$(BITS) -shared
8-
RM = rm -f
5+
CFLAGS = -fPIC -Wall -Wextra -O2 -g
6+
LDFLAGS = -shared
7+
RM = rm -f
8+
PLATFORM = $(OS)_$(MACHINE)
99

1010
ifeq ($(OS), darwin)
11+
TARGET = $(MACHINE)-none-$(OS)
1112
CFLAGS += --target=$(TARGET)
1213
LDFLAGS += --target=$(TARGET)
13-
PLATFORM = $(OS)_$(ARCH)
1414
else
15-
PLATFORM = $(OS)$(BITS)
15+
ifeq ($(MACHINE), aarch64)
16+
ARCH = armv8-a
17+
CFLAGS += -march=$(ARCH)
18+
LDFLAGS += -march=$(ARCH)
19+
else
20+
CFLAGS += -m$(BITS)
21+
LDFLAGS += -m$(BITS)
22+
endif
1623
endif
1724

1825
TARGET_LIB = _ctypes_test_$(PLATFORM).pyd
93.2 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)