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
33 ifneq ($(CONFIG_debug),yes)33 ifneq ($(CONFIG_debug),yes)
34 LDFLAGS += -s34 LDFLAGS += -s
35 endif35 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))
37else37else
38 CFG = -unx38 CFG = -unx
39 LIBS+=-lm39 LIBS+=-lm
@@ -113,6 +113,7 @@ DEF-arm64-osx = $(DEF-arm64) -DTCC_TARGET_MACHO · 73 unmodified lines
113DEF-arm64-FreeBSD = $(DEF-arm64) -DTARGETOS_FreeBSD113DEF-arm64-FreeBSD = $(DEF-arm64) -DTARGETOS_FreeBSD
114DEF-arm64-NetBSD = $(DEF-arm64) -DTARGETOS_NetBSD114DEF-arm64-NetBSD = $(DEF-arm64) -DTARGETOS_NetBSD
115DEF-arm64-OpenBSD = $(DEF-arm64) -DTARGETOS_OpenBSD115DEF-arm64-OpenBSD = $(DEF-arm64) -DTARGETOS_OpenBSD
116DEF-arm64-win32 = $(DEF-arm64) -DTCC_TARGET_PE
116DEF-riscv64 = -DTCC_TARGET_RISCV64117DEF-riscv64 = -DTCC_TARGET_RISCV64
117DEF-c67 = -DTCC_TARGET_C67 -w # disable warnigs118DEF-c67 = -DTCC_TARGET_C67 -w # disable warnigs
118DEF-x86_64-FreeBSD = $(DEF-x86_64) -DTARGETOS_FreeBSD119DEF-x86_64-FreeBSD = $(DEF-x86_64) -DTARGETOS_FreeBSD
@@ -130,7 +131,7 @@ TCCDOCS = tcc.1 tcc-doc.html tcc-doc.info · 11 unmodified lines
130all: $(PROGS) $(TCCLIBS) $(TCCDOCS)131all: $(PROGS) $(TCCLIBS) $(TCCDOCS)
131 132
132# cross compiler targets to build133# cross compiler targets to build
133TCC_X = i386 x86_64 i386-win32 x86_64-win32 x86_64-osx arm arm64 arm-wince c67134TCC_X = i386 x86_64 i386-win32 x86_64-win32 x86_64-osx arm arm64 arm64-win32 arm-wince c67
134TCC_X += riscv64 arm64-osx135TCC_X += riscv64 arm64-osx
135# TCC_X += arm-fpa arm-fpa-ld arm-vfp arm-eabi136# TCC_X += arm-fpa arm-fpa-ld arm-vfp arm-eabi
136 137
@@ -212,8 +213,9 @@ arm-fpa-ld_FILES = $(arm_FILES) · 75 unmodified lines
212arm-vfp_FILES = $(arm_FILES)213arm-vfp_FILES = $(arm_FILES)
213arm-eabi_FILES = $(arm_FILES)214arm-eabi_FILES = $(arm_FILES)
214arm-eabihf_FILES = $(arm_FILES)215arm-eabihf_FILES = $(arm_FILES)
215arm64_FILES = $(CORE_FILES) arm64-gen.c arm64-link.c arm64-asm.c216arm64_FILES = $(CORE_FILES) arm64-gen.c arm64-link.c arm64-asm.c arm64-tok.h
216arm64-osx_FILES = $(arm64_FILES) tccmacho.c217arm64-osx_FILES = $(arm64_FILES) tccmacho.c
218arm64-win32_FILES = $(arm64_FILES) tccpe.c
217c67_FILES = $(CORE_FILES) c67-gen.c c67-link.c tcccoff.c219c67_FILES = $(CORE_FILES) c67-gen.c c67-link.c tcccoff.c
218riscv64_FILES = $(CORE_FILES) riscv64-gen.c riscv64-link.c riscv64-asm.c220riscv64_FILES = $(CORE_FILES) riscv64-gen.c riscv64-link.c riscv64-asm.c
219 221
configure+5−1
@@ -266,7 +266,11 @@ default os_release "$(uname -r)" · 265 unmodified lines
266case $buildos in266case $buildos in
267 Windows_NT|MINGW*|MSYS*|CYGWIN*)267 Windows_NT|MINGW*|MSYS*|CYGWIN*)
268 buildos="WIN32"268 buildos="WIN32"
269 test "$MSYSTEM" = "MINGW32" && cpu_sys=i386269 case "$MSYSTEM" in
270 MINGW32) cpu_sys=i386 ;;
271 MINGW64) cpu_sys=x86_64 ;;
272 CLANGARM64|MINGW_ARM64) cpu_sys=arm64 ;;
273 esac
270 ;;274 ;;
271 Linux)275 Linux)
272 if test "$(uname -o)" = "Android"; then276 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
65OBJ-x86_64-win32 = $(X86_64_O) chkstk.o $(WIN_O)65OBJ-x86_64-win32 = $(X86_64_O) chkstk.o $(WIN_O)
66OBJ-arm64 = $(ARM64_O) $(LIN_O)66OBJ-arm64 = $(ARM64_O) $(LIN_O)
67OBJ-arm64-osx = $(ARM64_O) $(OSX_O)67OBJ-arm64-osx = $(ARM64_O) $(OSX_O)
68OBJ-arm64-win32 = $(ARM64_O) chkstk.o $(WIN_O)
68OBJ-arm = $(ARM_O) $(LIN_O)69OBJ-arm = $(ARM_O) $(LIN_O)
69OBJ-arm-fpa = $(OBJ-arm)70OBJ-arm-fpa = $(OBJ-arm)
70OBJ-arm-fpa-ld = $(OBJ-arm)71OBJ-arm-fpa-ld = $(OBJ-arm)
tests/Makefile+1−0
@@ -309,6 +309,7 @@ CROSS-TGTS = \ · 308 unmodified lines
309 arm-NetBSD \309 arm-NetBSD \
310 arm-wince \310 arm-wince \
311 arm64 \311 arm64 \
312 arm64-win32 \
312 arm64-osx \313 arm64-osx \
313 arm64-FreeBSD \314 arm64-FreeBSD \
314 arm64-NetBSD \315 arm64-NetBSD \
tests/pp/Makefile+1−0
@@ -46,6 +46,7 @@ clean: · 45 unmodified lines
46 rm -f *.output46 rm -f *.output
47 47
4802.test : DIFF_OPTS += -w4802.test : DIFF_OPTS += -w
4916.test : DIFF_OPTS += -B
49# 15.test : DIFF_OPTS += -I"^XXX:"50# 15.test : DIFF_OPTS += -I"^XXX:"
50 51
51# diff options:52# diff options:
tests/tests2/Makefile+16−0
@@ -48,6 +48,21 @@ ifeq (-$(CONFIG_WIN32)-,-yes-) · 47 unmodified lines
48 SKIP += 117_builtins.test # win32 port doesn't define __builtins48 SKIP += 117_builtins.test # win32 port doesn't define __builtins
49 SKIP += 124_atomic_counter.test # No pthread support49 SKIP += 124_atomic_counter.test # No pthread support
50endif50endif
51ifneq (,$(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
56endif
57ifeq (,$(filter arm64 aarch64,$(ARCH)))
58 SKIP += 138_arm64_encoding.test
59 SKIP += 139_arm64_errors.test
60endif
61ifneq (,$(findstring win32,$(CROSS_TARGET)))
62 SKIP += 106_versym.test
63 SKIP += 114_bound_signal.test
64 SKIP += 124_atomic_counter.test
65endif
51ifneq (,$(filter OpenBSD FreeBSD NetBSD,$(TARGETOS)))66ifneq (,$(filter OpenBSD FreeBSD NetBSD,$(TARGETOS)))
52 SKIP += 106_versym.test # no pthread_condattr_setpshared67 SKIP += 106_versym.test # no pthread_condattr_setpshared
53 SKIP += 114_bound_signal.test # libc problem signal/fork68 SKIP += 114_bound_signal.test # libc problem signal/fork
@@ -73,6 +88,7 @@ endif · 19 unmodified lines
73 88
74# These tests run several snippets from the same file one by one89# These tests run several snippets from the same file one by one
7560_errors_and_warnings.test : FLAGS += -dt9060_errors_and_warnings.test : FLAGS += -dt
91139_arm64_errors.test : FLAGS += -dt
7696_nodata_wanted.test : FLAGS += -dt9296_nodata_wanted.test : FLAGS += -dt
77 93
78# Always generate certain .expects (don't put these in the GIT),94# 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