kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

commit a1dca02e7fb38956632f2c76acaff5f2b0fa89eb
parent 6b30ebfeab40ba6eed5023a5e8e09d8fcd4fd7b0
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Wed, 17 Jun 2026 11:20:35 -0700

Tier 4: consolidate per-arch/target build gating (lib_srcs/rt/abi macros)

Replace scattered hand-written per-arch gating with foreach/eval-driven
constructs so adding an arch or target touches fewer build sites. Pure
build refactor: the resolved source list, rt variant set/values, and ABI
table are unchanged.

- mk/lib_srcs.mk: the four per-arch ELF/Mach-O/COFF reloc filter-out blocks
  become one arch-reloc-off descriptor macro driven off KIT_ARCH_*_ENABLED
  plus an arch->reloc-file->formats mapping. The gate is a $(if ...) function
  (not an ifneq directive) so it composes with the inner $(eval) regardless
  of macro-expansion order; the riscv row collapses RV32||RV64 to a single
  1/0 so both-enabled keeps the relocs.
- mk/rt.mk: the 25 variants' repeated TARGET/ABI/INT128/CORO quartet comes
  from one rt-core setter; sparse optional props (LDBL128/SAVE_RESTORE/AEABI/
  ARCH_FLAGS/HOSTED/EXTRA_SRCS, several space-containing) stay literal next to
  their variant with their rationale comments.
- src/abi/registry.c: the five KIT_ABI_<arch>_ENABLED macros collapse to one
  KIT_ABI_ENABLED(arch) used at each table site, with a single matching #undef.

Proven no behavior change: resolved make vars (LIB_SRCS/LIB_OBJS and every
RT_<v>_* property + derived SRCS/OBJS/CFLAGS/ASFLAGS) are byte-identical
across 19 representative configs; the abi_impls[] table preprocesses
identically across 5 configs. make lib/bin/rt succeed; smoke-x64/rv64,
test-elf, test-cg-api all green.

Diffstat:
Mmk/lib_srcs.mk | 36++++++++++++++++++++----------------
Mmk/rt.mk | 155++++++++++++++++++++++++-------------------------------------------------------
Msrc/abi/registry.c | 45++++++++++++++++++++-------------------------
3 files changed, 87 insertions(+), 149 deletions(-)

diff --git a/mk/lib_srcs.mk b/mk/lib_srcs.mk @@ -86,22 +86,26 @@ LIB_SRCS_OBJ_ELF := $(shell find src/obj/elf -name '*.c' 2>/dev/null) LIB_SRCS_OBJ_MACHO := $(shell find src/obj/macho -name '*.c' 2>/dev/null) LIB_SRCS_OBJ_COFF := $(shell find src/obj/coff -name '*.c' 2>/dev/null) LIB_SRCS_OBJ_WASM := $(shell find src/obj/wasm -name '*.c' 2>/dev/null) -ifneq ($(KIT_ARCH_AA64_ENABLED),1) -LIB_SRCS_OBJ_ELF := $(filter-out %/reloc_aarch64.c,$(LIB_SRCS_OBJ_ELF)) -LIB_SRCS_OBJ_MACHO := $(filter-out %/reloc_aarch64.c,$(LIB_SRCS_OBJ_MACHO)) -LIB_SRCS_OBJ_COFF := $(filter-out %/reloc_aarch64.c,$(LIB_SRCS_OBJ_COFF)) -endif -ifneq ($(KIT_ARCH_X64_ENABLED),1) -LIB_SRCS_OBJ_ELF := $(filter-out %/reloc_x86_64.c,$(LIB_SRCS_OBJ_ELF)) -LIB_SRCS_OBJ_MACHO := $(filter-out %/reloc_x86_64.c,$(LIB_SRCS_OBJ_MACHO)) -LIB_SRCS_OBJ_COFF := $(filter-out %/reloc_x86_64.c,$(LIB_SRCS_OBJ_COFF)) -endif -ifeq ($(filter 1,$(KIT_ARCH_RV32_ENABLED) $(KIT_ARCH_RV64_ENABLED)),) -LIB_SRCS_OBJ_ELF := $(filter-out %/reloc_riscv32.c %/reloc_riscv64.c,$(LIB_SRCS_OBJ_ELF)) -endif -ifneq ($(KIT_ARCH_ARM32_ENABLED),1) -LIB_SRCS_OBJ_ELF := $(filter-out %/reloc_arm.c,$(LIB_SRCS_OBJ_ELF)) -endif + +# Per-arch object-format relocation TUs. Each backend's reloc_*.c is dropped +# from the formats it appears in when that machine arch is disabled, mirroring +# the `#if KIT_ARCH_*_ENABLED` gate inside the sources. Adding an arch means +# adding one descriptor row, not four hand-written `filter-out` blocks. The +# gate is a `$(if ...)` function (not an `ifneq` directive) so it composes with +# the inner `$(eval)` regardless of macro-expansion order. +# $(1) = 1 when the arch is enabled, anything else (incl. empty) means off +# $(2) = reloc basename pattern(s) to drop, e.g. %/reloc_aarch64.c +# $(3) = object formats the reloc lives in (a subset of ELF MACHO COFF) +# Drop unless $(1) is exactly `1` — matching the original `ifneq ($(flag),1)`, +# which also dropped on an empty/unset flag. +define arch-reloc-off +$(if $(filter 1,$(1)),,$(foreach fmt,$(3),$(eval LIB_SRCS_OBJ_$(fmt) := $$(filter-out $(2),$$(LIB_SRCS_OBJ_$(fmt)))))) +endef + +$(eval $(call arch-reloc-off,$(KIT_ARCH_AA64_ENABLED),%/reloc_aarch64.c,ELF MACHO COFF)) +$(eval $(call arch-reloc-off,$(KIT_ARCH_X64_ENABLED),%/reloc_x86_64.c,ELF MACHO COFF)) +$(eval $(call arch-reloc-off,$(if $(filter 1,$(KIT_ARCH_RV32_ENABLED) $(KIT_ARCH_RV64_ENABLED)),1,0),%/reloc_riscv32.c %/reloc_riscv64.c,ELF)) +$(eval $(call arch-reloc-off,$(KIT_ARCH_ARM32_ENABLED),%/reloc_arm.c,ELF)) ifneq ($(KIT_LINK_ENABLED),1) LIB_SRCS_OBJ_ELF := $(filter-out %/link.c %/link_dyn.c,$(LIB_SRCS_OBJ_ELF)) LIB_SRCS_OBJ_MACHO := $(filter-out %/link.c,$(LIB_SRCS_OBJ_MACHO)) diff --git a/mk/rt.mk b/mk/rt.mk @@ -76,167 +76,109 @@ endif RT_DEFAULT_VARIANTS ?= $(RT_NATIVE_VARIANT) # ---------- variant feature flags -------------------------------------------- -# TARGET - clang target triple -# ABI - lp64 | ilp32 | llp64 -# INT128 - 0 | 1 +# Every variant sets the same four core properties (target triple, ABI model, +# __int128 availability, coroutine micro-arch), so they come from one setter to +# kill the per-variant boilerplate. The sparse optional properties below stay +# as explicit `RT_<v>_<prop>` lines next to the variant they qualify — they +# carry per-target rationale comments and several hold space-containing flag +# strings, so keeping them literal avoids any descriptor-encoding hazard. +# TARGET - clang target triple (rt-core arg 2) +# ABI - lp64 | ilp32 | llp64 (rt-core arg 3) +# INT128 - 0 | 1 (rt-core arg 4) # CORO - x86_64 | x86_64_win | i386 | aarch64 | -# arm32 | arm32_thumb1 | riscv32 | riscv64 | empty +# arm32 | arm32_thumb1 | riscv32 | +# riscv64 | empty (rt-core arg 5) # LDBL128 - 1 enables binary128 long double support # SAVE_RESTORE - 1 enables RISC-V save-restore routines # AEABI - thumb2 | thumb1 | empty # ARCH_FLAGS - extra target-specific flags +# HOSTED - 1 ships the compiler-rt subset instead of the full libc set +# RT_EXTRA_SRCS - per-variant extra runtime sources +# $(1)=variant $(2)=TARGET $(3)=ABI $(4)=INT128 $(5)=CORO +define rt-core +RT_$(1)_TARGET = $(2) +RT_$(1)_ABI = $(3) +RT_$(1)_INT128 = $(4) +RT_$(1)_CORO = $(5) +endef + +$(eval $(call rt-core,x86_64-linux,x86_64-linux-gnu,lp64,1,x86_64)) +$(eval $(call rt-core,x86_64-freebsd,x86_64-unknown-freebsd,lp64,1,x86_64)) +$(eval $(call rt-core,x86_64-apple-darwin,x86_64-apple-darwin,lp64,1,x86_64)) +$(eval $(call rt-core,x86_64-apple-ios-simulator,x86_64-apple-ios-simulator,lp64,1,x86_64)) +$(eval $(call rt-core,x86_64-elf,x86_64-unknown-elf,lp64,1,x86_64)) -RT_x86_64-linux_TARGET = x86_64-linux-gnu -RT_x86_64-linux_ABI = lp64 -RT_x86_64-linux_INT128 = 1 -RT_x86_64-linux_CORO = x86_64 - -RT_x86_64-freebsd_TARGET = x86_64-unknown-freebsd -RT_x86_64-freebsd_ABI = lp64 -RT_x86_64-freebsd_INT128 = 1 -RT_x86_64-freebsd_CORO = x86_64 - -RT_x86_64-apple-darwin_TARGET = x86_64-apple-darwin -RT_x86_64-apple-darwin_ABI = lp64 -RT_x86_64-apple-darwin_INT128 = 1 -RT_x86_64-apple-darwin_CORO = x86_64 - -RT_x86_64-apple-ios-simulator_TARGET = x86_64-apple-ios-simulator -RT_x86_64-apple-ios-simulator_ABI = lp64 -RT_x86_64-apple-ios-simulator_INT128 = 1 -RT_x86_64-apple-ios-simulator_CORO = x86_64 - -RT_x86_64-elf_TARGET = x86_64-unknown-elf -RT_x86_64-elf_ABI = lp64 -RT_x86_64-elf_INT128 = 1 -RT_x86_64-elf_CORO = x86_64 - -RT_aarch64-linux_TARGET = aarch64-linux-gnu -RT_aarch64-linux_ABI = lp64 -RT_aarch64-linux_INT128 = 1 -RT_aarch64-linux_CORO = aarch64 +$(eval $(call rt-core,aarch64-linux,aarch64-linux-gnu,lp64,1,aarch64)) RT_aarch64-linux_LDBL128 = 1 RT_EXTRA_SRCS_aarch64-linux = rt/lib/coro/aarch64_elf.s -RT_aarch64-linux-android_TARGET = aarch64-linux-android21 -RT_aarch64-linux-android_ABI = lp64 -RT_aarch64-linux-android_INT128 = 1 -RT_aarch64-linux-android_CORO = aarch64 +$(eval $(call rt-core,aarch64-linux-android,aarch64-linux-android21,lp64,1,aarch64)) RT_aarch64-linux-android_LDBL128 = 1 RT_EXTRA_SRCS_aarch64-linux-android = rt/lib/coro/aarch64_elf.s -RT_aarch64-freebsd_TARGET = aarch64-unknown-freebsd -RT_aarch64-freebsd_ABI = lp64 -RT_aarch64-freebsd_INT128 = 1 -RT_aarch64-freebsd_CORO = aarch64 +$(eval $(call rt-core,aarch64-freebsd,aarch64-unknown-freebsd,lp64,1,aarch64)) RT_aarch64-freebsd_LDBL128 = 1 RT_EXTRA_SRCS_aarch64-freebsd = rt/lib/coro/aarch64_elf.s -RT_aarch64-apple-darwin_TARGET = aarch64-apple-darwin -RT_aarch64-apple-darwin_ABI = lp64 -RT_aarch64-apple-darwin_INT128 = 1 -RT_aarch64-apple-darwin_CORO = aarch64 +$(eval $(call rt-core,aarch64-apple-darwin,aarch64-apple-darwin,lp64,1,aarch64)) RT_EXTRA_SRCS_aarch64-apple-darwin = rt/lib/coro/aarch64_macho.s -RT_aarch64-apple-ios_TARGET = aarch64-apple-ios -RT_aarch64-apple-ios_ABI = lp64 -RT_aarch64-apple-ios_INT128 = 1 -RT_aarch64-apple-ios_CORO = aarch64 +$(eval $(call rt-core,aarch64-apple-ios,aarch64-apple-ios,lp64,1,aarch64)) RT_EXTRA_SRCS_aarch64-apple-ios = rt/lib/coro/aarch64_macho.s -RT_aarch64-apple-ios-simulator_TARGET = aarch64-apple-ios-simulator -RT_aarch64-apple-ios-simulator_ABI = lp64 -RT_aarch64-apple-ios-simulator_INT128 = 1 -RT_aarch64-apple-ios-simulator_CORO = aarch64 +$(eval $(call rt-core,aarch64-apple-ios-simulator,aarch64-apple-ios-simulator,lp64,1,aarch64)) RT_EXTRA_SRCS_aarch64-apple-ios-simulator = rt/lib/coro/aarch64_macho.s -RT_aarch64-elf_TARGET = aarch64-unknown-elf -RT_aarch64-elf_ABI = lp64 -RT_aarch64-elf_INT128 = 1 -RT_aarch64-elf_CORO = aarch64 +$(eval $(call rt-core,aarch64-elf,aarch64-unknown-elf,lp64,1,aarch64)) RT_aarch64-elf_LDBL128 = 1 RT_EXTRA_SRCS_aarch64-elf = rt/lib/coro/aarch64_elf.s -RT_aarch64-windows_TARGET = aarch64-w64-windows-gnu -RT_aarch64-windows_ABI = llp64 -RT_aarch64-windows_INT128 = 1 -RT_aarch64-windows_CORO = aarch64 +$(eval $(call rt-core,aarch64-windows,aarch64-w64-windows-gnu,llp64,1,aarch64)) RT_aarch64-windows_HOSTED = 1 -RT_riscv64-linux_TARGET = riscv64-linux-gnu -RT_riscv64-linux_ABI = lp64 -RT_riscv64-linux_INT128 = 1 -RT_riscv64-linux_CORO = riscv64 +$(eval $(call rt-core,riscv64-linux,riscv64-linux-gnu,lp64,1,riscv64)) # RISC-V `long double` is IEEE-754 binary128 per the psABI; ship the quad # soft-float / __int128 runtime (fp_tf, fp_ti). RT_riscv64-linux_LDBL128 = 1 RT_riscv64-linux_ARCH_FLAGS = -mabi=lp64d -march=rv64imafd -RT_riscv64-freebsd_TARGET = riscv64-unknown-freebsd -RT_riscv64-freebsd_ABI = lp64 -RT_riscv64-freebsd_INT128 = 1 -RT_riscv64-freebsd_CORO = riscv64 +$(eval $(call rt-core,riscv64-freebsd,riscv64-unknown-freebsd,lp64,1,riscv64)) RT_riscv64-freebsd_LDBL128 = 1 RT_riscv64-freebsd_ARCH_FLAGS = -mabi=lp64d -march=rv64imafd -RT_riscv64-elf_TARGET = riscv64-unknown-elf -RT_riscv64-elf_ABI = lp64 -RT_riscv64-elf_INT128 = 1 -RT_riscv64-elf_CORO = riscv64 +$(eval $(call rt-core,riscv64-elf,riscv64-unknown-elf,lp64,1,riscv64)) RT_riscv64-elf_LDBL128 = 1 RT_riscv64-elf_ARCH_FLAGS = -mabi=lp64 -march=rv64imafd -RT_riscv64-elf-save-restore_TARGET = riscv64-unknown-elf -RT_riscv64-elf-save-restore_ABI = lp64 -RT_riscv64-elf-save-restore_INT128 = 1 -RT_riscv64-elf-save-restore_CORO = riscv64 +$(eval $(call rt-core,riscv64-elf-save-restore,riscv64-unknown-elf,lp64,1,riscv64)) RT_riscv64-elf-save-restore_SAVE_RESTORE = 1 RT_riscv64-elf-save-restore_LDBL128 = 1 RT_riscv64-elf-save-restore_ARCH_FLAGS = -mabi=lp64 -march=rv64imafd -RT_x86_64-pc-windows_TARGET = x86_64-pc-windows-msvc -RT_x86_64-pc-windows_ABI = llp64 -RT_x86_64-pc-windows_INT128 = 1 -RT_x86_64-pc-windows_CORO = x86_64_win +$(eval $(call rt-core,x86_64-pc-windows,x86_64-pc-windows-msvc,llp64,1,x86_64_win)) RT_x86_64-pc-windows_HOSTED = 1 RT_EXTRA_SRCS_x86_64-pc-windows = rt/lib/stack/chkstk_x86_64_win.c -RT_i386-linux_TARGET = i386-linux-gnu -RT_i386-linux_ABI = ilp32 -RT_i386-linux_INT128 = 0 -RT_i386-linux_CORO = i386 +$(eval $(call rt-core,i386-linux,i386-linux-gnu,ilp32,0,i386)) -RT_wasm32_TARGET = wasm32-unknown-unknown -RT_wasm32_ABI = ilp32 -RT_wasm32_INT128 = 0 +# wasm32 has no coroutine micro-arch (empty CORO). +$(eval $(call rt-core,wasm32,wasm32-unknown-unknown,ilp32,0,)) # Soft-float embedded RV32 (ABI=ilp32, no F/D): integer layout is ilp32 and # all FP is soft, so it reuses RT_ABI_SRCS_ilp32 / RT_ABI_INC ilp32_le. -RT_riscv32-elf_TARGET = riscv32-unknown-elf -RT_riscv32-elf_ABI = ilp32 -RT_riscv32-elf_INT128 = 0 -RT_riscv32-elf_CORO = riscv32 +$(eval $(call rt-core,riscv32-elf,riscv32-unknown-elf,ilp32,0,riscv32)) RT_riscv32-elf_ARCH_FLAGS = -mabi=ilp32 -march=rv32imac -RT_riscv32-elf-save-restore_TARGET = riscv32-unknown-elf -RT_riscv32-elf-save-restore_ABI = ilp32 -RT_riscv32-elf-save-restore_INT128 = 0 -RT_riscv32-elf-save-restore_CORO = riscv32 +$(eval $(call rt-core,riscv32-elf-save-restore,riscv32-unknown-elf,ilp32,0,riscv32)) RT_riscv32-elf-save-restore_SAVE_RESTORE = 1 RT_riscv32-elf-save-restore_ARCH_FLAGS = -mabi=ilp32 -march=rv32imac # Hard-float (single-precision) RV32: ilp32f passes float in FP regs, but the # integer layout is still ilp32 (double stays soft), so ABI=ilp32 here too and # it reuses the same RT_ABI_SRCS_ilp32 / RT_ABI_INC ilp32_le as the soft variant. -RT_riscv32-elf-hardfloat_TARGET = riscv32-unknown-elf -RT_riscv32-elf-hardfloat_ABI = ilp32 -RT_riscv32-elf-hardfloat_INT128 = 0 -RT_riscv32-elf-hardfloat_CORO = riscv32 +$(eval $(call rt-core,riscv32-elf-hardfloat,riscv32-unknown-elf,ilp32,0,riscv32)) RT_riscv32-elf-hardfloat_ARCH_FLAGS = -mabi=ilp32f -march=rv32imafc -RT_arm-eabi-thumb2_TARGET = arm-none-eabi -RT_arm-eabi-thumb2_ABI = ilp32 -RT_arm-eabi-thumb2_INT128 = 0 # Coroutine support is a hand-written register-switch in ARM asm (coro/arm32.c + # coro/coro.c's file-scope asm). kit-as now covers those idioms (cmp/mov #imm, # SP-relative add/str/ldr incl. high-register T3, UDF, the soft-float @@ -246,7 +188,7 @@ RT_arm-eabi-thumb2_INT128 = 0 # faults on this target (a coro/coro.c-level issue surfaced now that the layer # is built at all; the asm itself disassembles byte-correct) — tracked in # doc/plan/ARM32.md. -RT_arm-eabi-thumb2_CORO = arm32 +$(eval $(call rt-core,arm-eabi-thumb2,arm-none-eabi,ilp32,0,arm32)) # AEABI alias layer (aeabi.c + aeabi_thumb2.S) is hand-written ARM asm that now # self-builds with kit's own assembler: the ';' SEPARATOR, '#imm'-in-macro under # __ASSEMBLER__, the __ELF__/.type %function path, and SP-relative stack @@ -256,10 +198,7 @@ RT_arm-eabi-thumb2_CORO = arm32 # encodings + symbols. RT_arm-eabi-thumb2_AEABI = thumb2 -RT_arm-eabi-thumb1_TARGET = arm-none-eabi -RT_arm-eabi-thumb1_ABI = ilp32 -RT_arm-eabi-thumb1_INT128 = 0 -RT_arm-eabi-thumb1_CORO = arm32_thumb1 +$(eval $(call rt-core,arm-eabi-thumb1,arm-none-eabi,ilp32,0,arm32_thumb1)) RT_arm-eabi-thumb1_AEABI = thumb1 # ---------- feature -> source/flag groups ------------------------------------ diff --git a/src/abi/registry.c b/src/abi/registry.c @@ -10,49 +10,48 @@ typedef struct ABIImpl { const ABIVtable* vt; } ABIImpl; -#define KIT_ABI_AA64_ENABLED \ - (KIT_ARCH_AA64_ENABLED || KIT_ARCH_C_TARGET_ENABLED) -#define KIT_ABI_X64_ENABLED (KIT_ARCH_X64_ENABLED || KIT_ARCH_C_TARGET_ENABLED) -#define KIT_ABI_RV64_ENABLED \ - (KIT_ARCH_RV64_ENABLED || KIT_ARCH_C_TARGET_ENABLED) -#define KIT_ABI_RV32_ENABLED \ - (KIT_ARCH_RV32_ENABLED || KIT_ARCH_C_TARGET_ENABLED) -#define KIT_ABI_ARM32_ENABLED \ - (KIT_ARCH_ARM32_ENABLED || KIT_ARCH_C_TARGET_ENABLED) +/* A per-arch ABI is compiled in whenever that machine arch is enabled, or + * whenever the portable C-source backend is — c_target replays the same ABI + * layouts. One parameterized macro keeps every table site in sync; adding an + * arch just adds a KIT_ABI_ENABLED(KIT_ARCH_<X>_ENABLED) row below. */ +#define KIT_ABI_ENABLED(arch) ((arch) || KIT_ARCH_C_TARGET_ENABLED) static const ABIImpl abi_impls[] = { -#if KIT_ABI_AA64_ENABLED && KIT_OBJ_ELF_ENABLED +#if KIT_ABI_ENABLED(KIT_ARCH_AA64_ENABLED) && KIT_OBJ_ELF_ENABLED {KIT_ARCH_ARM_64, KIT_OBJ_ELF, &aapcs64_vtable}, #endif -#if KIT_ABI_AA64_ENABLED && KIT_OBJ_MACHO_ENABLED +#if KIT_ABI_ENABLED(KIT_ARCH_AA64_ENABLED) && KIT_OBJ_MACHO_ENABLED {KIT_ARCH_ARM_64, KIT_OBJ_MACHO, &apple_arm64_vtable}, #endif -#if KIT_ABI_AA64_ENABLED && KIT_OBJ_COFF_ENABLED +#if KIT_ABI_ENABLED(KIT_ARCH_AA64_ENABLED) && KIT_OBJ_COFF_ENABLED {KIT_ARCH_ARM_64, KIT_OBJ_COFF, &aapcs64_windows_vtable}, #endif -#if KIT_ABI_X64_ENABLED && KIT_OBJ_ELF_ENABLED +#if KIT_ABI_ENABLED(KIT_ARCH_X64_ENABLED) && KIT_OBJ_ELF_ENABLED {KIT_ARCH_X86_64, KIT_OBJ_ELF, &sysv_x64_vtable}, #endif -#if KIT_ABI_X64_ENABLED && KIT_OBJ_MACHO_ENABLED +#if KIT_ABI_ENABLED(KIT_ARCH_X64_ENABLED) && KIT_OBJ_MACHO_ENABLED {KIT_ARCH_X86_64, KIT_OBJ_MACHO, &apple_x64_vtable}, #endif -#if KIT_ABI_X64_ENABLED && KIT_OBJ_COFF_ENABLED +#if KIT_ABI_ENABLED(KIT_ARCH_X64_ENABLED) && KIT_OBJ_COFF_ENABLED {KIT_ARCH_X86_64, KIT_OBJ_COFF, &win64_x64_vtable}, #endif -#if KIT_ABI_RV64_ENABLED && KIT_OBJ_ELF_ENABLED +#if KIT_ABI_ENABLED(KIT_ARCH_RV64_ENABLED) && KIT_OBJ_ELF_ENABLED {KIT_ARCH_RV64, KIT_OBJ_ELF, &rv64_vtable}, #endif -#if KIT_ABI_RV32_ENABLED && KIT_OBJ_ELF_ENABLED +#if KIT_ABI_ENABLED(KIT_ARCH_RV32_ENABLED) && KIT_OBJ_ELF_ENABLED {KIT_ARCH_RV32, KIT_OBJ_ELF, &rv32_vtable}, #endif -#if KIT_ABI_ARM32_ENABLED && KIT_OBJ_ELF_ENABLED +#if KIT_ABI_ENABLED(KIT_ARCH_ARM32_ENABLED) && KIT_OBJ_ELF_ENABLED {KIT_ARCH_ARM_32, KIT_OBJ_ELF, &aapcs32_vtable}, #endif #if KIT_ARCH_WASM_ENABLED && KIT_OBJ_WASM_ENABLED {KIT_ARCH_WASM, KIT_OBJ_WASM, &wasm32_vtable}, #endif -#if !KIT_ABI_AA64_ENABLED && !KIT_ABI_X64_ENABLED && !KIT_ABI_RV64_ENABLED && \ - !KIT_ABI_RV32_ENABLED && !KIT_ABI_ARM32_ENABLED && !KIT_ARCH_WASM_ENABLED +#if !KIT_ABI_ENABLED(KIT_ARCH_AA64_ENABLED) && \ + !KIT_ABI_ENABLED(KIT_ARCH_X64_ENABLED) && \ + !KIT_ABI_ENABLED(KIT_ARCH_RV64_ENABLED) && \ + !KIT_ABI_ENABLED(KIT_ARCH_RV32_ENABLED) && \ + !KIT_ABI_ENABLED(KIT_ARCH_ARM32_ENABLED) && !KIT_ARCH_WASM_ENABLED {KIT_ARCH_WASM, KIT_OBJ_WASM, NULL}, #endif }; @@ -66,8 +65,4 @@ const ABIVtable* abi_vtable_lookup(KitArchKind arch, KitObjFmt obj) { return NULL; } -#undef KIT_ABI_AA64_ENABLED -#undef KIT_ABI_X64_ENABLED -#undef KIT_ABI_RV64_ENABLED -#undef KIT_ABI_RV32_ENABLED -#undef KIT_ABI_ARM32_ENABLED +#undef KIT_ABI_ENABLED