History

arm64-win32 support : configure & Makefiles

from: https://github.com/bold84/tinycc Author: Benjamin Oldenburg <benjamin.oldenburg@ordis.co.th> 2026-04-04 16:29:28 Committer: Benjamin Oldenburg <benjamin.oldenburg@ordis.co.th> 2026-04-04 16:29:28 Branch: win_arm64_clean Commit: 8b5ab1bb0141e66887bfbc4051688a3e478701a2 Also here: https://repo.or.cz/tinycc.git/shortlog/refs/mob/mob_bold84/win_arm64_clean This and the followup commits on mob is selected parts of that original branch. So it is not everything. It is not, for example: - unrelated whitespace changes in many files - a "pin msvcrt.dll" feature in tccpe.c (why that) - a native getenv() replacement in tcc.c (why that) - larger changes to the win32/lib runtime and tccrun.c (not needed) - a very gcc specific detail for struct alignent in tccgen.c - a custom set/longjmp implementation/replacement (not needed) - lots of rather basic test files in the win32 folder - a 'tests/asm' folder with some files (one file renamed to 140_test...c) - a .docs folder with one file

Benjamin Oldenburg committed 7 months ago

Commit ff5d3b41 parent d9a6d9a6 files · +29 −4Browse files

Unified · Split

6 files
  1. Makefile +5 −3
  2. configure +5 −1
  3. lib/Makefile +1 −0
  4. tests/Makefile +1 −0
  5. tests/pp/Makefile +1 −0
  6. tests/tests2/Makefile +16 −0
Makefile+5−3
@@ -33,7 +33,7 @@ ifdef CONFIG_WIN32 · 32 unmodified lines
3333 ifneq ($(CONFIG_debug),yes)
3434 LDFLAGS += -s
3535 endif
36− NATIVE_TARGET = $(ARCH)-win$(if $(findstring arm,$(ARCH)),ce,32)
36+ NATIVE_TARGET = $(if $(findstring arm64,$(ARCH)),arm64-win32,$(ARCH)-win$(if $(findstring arm,$(ARCH)),ce,32))
3737 else
3838 CFG = -unx
3939 LIBS+=-lm
@@ -113,6 +113,7 @@ DEF-arm64-osx = $(DEF-arm64) -DTCC_TARGET_MACHO · 73 unmodified lines
113113 DEF-arm64-FreeBSD = $(DEF-arm64) -DTARGETOS_FreeBSD
114114 DEF-arm64-NetBSD = $(DEF-arm64) -DTARGETOS_NetBSD
115115 DEF-arm64-OpenBSD = $(DEF-arm64) -DTARGETOS_OpenBSD
116+DEF-arm64-win32 = $(DEF-arm64) -DTCC_TARGET_PE
116117 DEF-riscv64 = -DTCC_TARGET_RISCV64
117118 DEF-c67 = -DTCC_TARGET_C67 -w # disable warnigs
118119 DEF-x86_64-FreeBSD = $(DEF-x86_64) -DTARGETOS_FreeBSD
@@ -130,7 +131,7 @@ TCCDOCS = tcc.1 tcc-doc.html tcc-doc.info · 11 unmodified lines
130131 all: $(PROGS) $(TCCLIBS) $(TCCDOCS)
131132
132133 # cross compiler targets to build
133−TCC_X = i386 x86_64 i386-win32 x86_64-win32 x86_64-osx arm arm64 arm-wince c67
134+TCC_X = i386 x86_64 i386-win32 x86_64-win32 x86_64-osx arm arm64 arm64-win32 arm-wince c67
134135 TCC_X += riscv64 arm64-osx
135136 # TCC_X += arm-fpa arm-fpa-ld arm-vfp arm-eabi
136137
@@ -212,8 +213,9 @@ arm-fpa-ld_FILES = $(arm_FILES) · 75 unmodified lines
212213 arm-vfp_FILES = $(arm_FILES)
213214 arm-eabi_FILES = $(arm_FILES)
214215 arm-eabihf_FILES = $(arm_FILES)
215−arm64_FILES = $(CORE_FILES) arm64-gen.c arm64-link.c arm64-asm.c
216+arm64_FILES = $(CORE_FILES) arm64-gen.c arm64-link.c arm64-asm.c arm64-tok.h
216217 arm64-osx_FILES = $(arm64_FILES) tccmacho.c
218+arm64-win32_FILES = $(arm64_FILES) tccpe.c
217219 c67_FILES = $(CORE_FILES) c67-gen.c c67-link.c tcccoff.c
218220 riscv64_FILES = $(CORE_FILES) riscv64-gen.c riscv64-link.c riscv64-asm.c
219221
configure+5−1
@@ -266,7 +266,11 @@ default os_release "$(uname -r)" · 265 unmodified lines
266266 case $buildos in
267267 Windows_NT|MINGW*|MSYS*|CYGWIN*)
268268 buildos="WIN32"
269− test "$MSYSTEM" = "MINGW32" && cpu_sys=i386
269+ case "$MSYSTEM" in
270+ MINGW32) cpu_sys=i386 ;;
271+ MINGW64) cpu_sys=x86_64 ;;
272+ CLANGARM64|MINGW_ARM64) cpu_sys=arm64 ;;
273+ esac
270274 ;;
271275 Linux)
272276 if test "$(uname -o)" = "Android"; then
lib/Makefile+1−0
@@ -65,6 +65,7 @@ OBJ-i386-win32 = $(I386_O) chkstk.o $(WIN_O) · 64 unmodified lines
6565 OBJ-x86_64-win32 = $(X86_64_O) chkstk.o $(WIN_O)
6666 OBJ-arm64 = $(ARM64_O) $(LIN_O)
6767 OBJ-arm64-osx = $(ARM64_O) $(OSX_O)
68+OBJ-arm64-win32 = $(ARM64_O) chkstk.o $(WIN_O)
6869 OBJ-arm = $(ARM_O) $(LIN_O)
6970 OBJ-arm-fpa = $(OBJ-arm)
7071 OBJ-arm-fpa-ld = $(OBJ-arm)
tests/Makefile+1−0
@@ -309,6 +309,7 @@ CROSS-TGTS = \ · 308 unmodified lines
309309 arm-NetBSD \
310310 arm-wince \
311311 arm64 \
312+ arm64-win32 \
312313 arm64-osx \
313314 arm64-FreeBSD \
314315 arm64-NetBSD \
tests/pp/Makefile+1−0
@@ -46,6 +46,7 @@ clean: · 45 unmodified lines
4646 rm -f *.output
4747
4848 02.test : DIFF_OPTS += -w
49+16.test : DIFF_OPTS += -B
4950 # 15.test : DIFF_OPTS += -I"^XXX:"
5051
5152 # diff options:
tests/tests2/Makefile+16−0
@@ -48,6 +48,21 @@ ifeq (-$(CONFIG_WIN32)-,-yes-) · 47 unmodified lines
4848 SKIP += 117_builtins.test # win32 port doesn't define __builtins
4949 SKIP += 124_atomic_counter.test # No pthread support
5050 endif
51+ifneq (,$(filter arm% riscv%,$(ARCH)))
52+ SKIP += 85_asm-outside-function.test
53+ SKIP += 98_al_ax_extend.test
54+ SKIP += 99_fastcall.test
55+ SKIP += 127_asm_goto.test
56+endif
57+ifeq (,$(filter arm64 aarch64,$(ARCH)))
58+ SKIP += 138_arm64_encoding.test
59+ SKIP += 139_arm64_errors.test
60+endif
61+ifneq (,$(findstring win32,$(CROSS_TARGET)))
62+ SKIP += 106_versym.test
63+ SKIP += 114_bound_signal.test
64+ SKIP += 124_atomic_counter.test
65+endif
5166 ifneq (,$(filter OpenBSD FreeBSD NetBSD,$(TARGETOS)))
5267 SKIP += 106_versym.test # no pthread_condattr_setpshared
5368 SKIP += 114_bound_signal.test # libc problem signal/fork
@@ -73,6 +88,7 @@ endif · 19 unmodified lines
7388
7489 # These tests run several snippets from the same file one by one
7590 60_errors_and_warnings.test : FLAGS += -dt
91+139_arm64_errors.test : FLAGS += -dt
7692 96_nodata_wanted.test : FLAGS += -dt
7793
7894 # Always generate certain .expects (don't put these in the GIT),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t