tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Windows ARM targets


From: Fred van Kempen
Subject: [Tinycc-devel] Windows ARM targets
Date: Sat, 27 May 2023 00:40:46 +0000 (UTC)

All:

I have been messing around with the current (mob) code to make it usable
with ARM and ARM64 targets- ARM first.  Under Windows (PE32), that is.

So, I did most of the corrections in tccpe.c to make the PE32 headers be
correct (or, rather, the same as what Visual Studio 14.29 generates) for
the ARM target - this is NOT the same as the existing "WinCE ARM"
target.  So, the latter is now defined as TCC_TARGET_ARM_WINCE,
and the former is simply TCC_TARGET_ARM.

I am testing this on a Windows RT 8.1 notebook (MS Surface) which does
not "do  x86 code.  So, creation of TCC is done in two steps, done in the
win32/ directory:

1.  Compile a cross-compiler for ARM target in cross/ with the selected
     system compiler.  For now this is the standard build with the DLL, but
     this will soon be just the EXE as we dont need the DLL for just that task.

2.  With the cross compiler built, use that to build TCC again, but now in the
     current directory. This yields an ARM-PE compiler in ARM-PE format :)

3.  Normally, one would now switch to the target (or be on a platform where
     the target code can be run..) and build TCC again, but using the copy
     we just cross-compiled. This step will then also build the runtime.

Now, that is where we currently stop.  I cant, for the life of me, figure out why
both Win8.1 as well as Win10 simply say "You cant run this app on this machine."

The PE stuff seems to be correct - machine ID (0x1C4), the characteristics, the
required Windows and Subsystem versions, all match the VS ones.

I am using a tool to "step through" the PE files, and those seem to be fine, except
for the fact that one tool also reports that of the generated PE file, the .rdata section
overlaps (extends over) the .bss section, which of course isnt good.. and that might
be why Windows refuses the file.

Did anyone ever work on the PE code that could help out?

Thanks,

Fred


reply via email to

[Prev in Thread] Current Thread [Next in Thread]