From a667b53fcb2cb3cda14f67a47286a4b4198f704d Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Tue, 14 Jul 2026 09:22:07 +0300 Subject: [PATCH] win32: allow self-host with tcc 0.9.27 - part 1 of 2 Commit 03d58b0 ("arm64-win32 support : runtime", 2026-04-04) added IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE to winnt.h, and it was later used in tccpe.c, but older tcc like 0.9.27 don't have it. So define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE is missing. --- tccpe.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tccpe.c b/tccpe.c index 2148517d..6f622dd3 100644 --- a/tccpe.c +++ b/tccpe.c @@ -292,6 +292,11 @@ typedef struct _IMAGE_BASE_RELOCATION { #endif /* ndef IMAGE_NT_SIGNATURE */ /* ----------------------------------------------------------- */ +#ifndef IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE + /* allow self-host build with tcc 0.97 - doesn't have this in winnt.h */ + #define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040 +#endif + #pragma pack(push, 1) struct pe_header {