cosmopolitan/tool/build
Justine Tunney 5bd22aef12
Experiment with supporting Windows Arm64 natively
So far I haven't found any way to run native Arm64 code on Windows Arm64
without using MSVC. When I build a PE binary from scratch that should be
a valid Windows Arm64 program, the OS refuses to run it. Possibly due to
requiring additional content like XML manifests or relocation or control
flow integrity data that isn't normally required on x64. I've also tried
using VirtualAlloc2() to JIT an Arm64 native function, but VirtualAlloc2
always fails with invalid parameter. I tried using MSVC to create an ARM
DLL that my x64 emulated program can link at runtime, to pass a function
pointer with ARM code, but LoadLibrary() rejects ARM DLLs as invalid exe

The only option left, is likely to write a new program like ape/ape-m1.c
which can be compiled by MSVC to load and run an AARCH64 ELF executable.
The emulated x64 binary would detect emulation using IsWow64Process2 and
then drop the loader executable in a temporary folder, and re-launch the
original executable, using the Arm64 segments of the cosmocc fat binary.
2024-08-16 06:43:59 -07:00
..
dso Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
lib Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
apelink.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
ar.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
assimilate.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
bigmul.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
BUILD.mk Fix ctype.h and wctype.h 2024-07-21 15:54:17 -07:00
chmod.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
cocmd.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
compile.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
cp.c Introduce libc/mem/tinymalloc.inc 2024-05-07 03:19:49 -07:00
dd.c Fix some static analysis issues 2024-07-27 09:16:54 -07:00
dlopen_test.c Support 40 cosmo_dlopen() function parameters 2024-01-04 13:41:26 -08:00
dropcache.c Stop using .com extension in monorepo 2024-03-03 03:12:19 -08:00
echo.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
elf2pe.c Experiment with supporting Windows Arm64 natively 2024-08-16 06:43:59 -07:00
elf2pe.h Experiment with supporting Windows Arm64 natively 2024-08-16 06:43:59 -07:00
false.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fastdiff.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
findape.c Make improvements 2024-02-12 10:23:00 -08:00
findelf.c Make improvements 2024-02-12 10:23:00 -08:00
findpe.c Make improvements 2024-02-12 10:23:00 -08:00
fixupobj.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
freebsd2sysv.c Fix some static analysis issues 2024-07-27 09:16:54 -07:00
gzip.c Fix some static analysis issues 2024-07-27 09:16:54 -07:00
helpop.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
killall.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
lz4toasm.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
march-native.c Improve -march=native micro-architecture detection 2024-05-29 10:12:49 -07:00
mkdeps.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
mkdir.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
mktemper.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
mv.c Introduce libc/mem/tinymalloc.inc 2024-05-07 03:19:49 -07:00
nproc.c Cull the examples folder 2023-10-11 21:45:32 -07:00
objbincopy.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
package.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
pecheck.c Fix ctype.h and wctype.h 2024-07-21 15:54:17 -07:00
pledge.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
printf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pwd.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
reboot.c Run clang-format (#1197) 2024-06-01 16:30:43 -04:00
resymbol.c Introduce libc/mem/tinymalloc.inc 2024-05-07 03:19:49 -07:00
rm.c Introduce libc/mem/tinymalloc.inc 2024-05-07 03:19:49 -07:00
runit.c Fix some static analysis issues 2024-07-27 09:16:54 -07:00
runit.h Fix bugs and add security features to redbean 2022-04-18 00:01:26 -07:00
runitd.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
sha256sum.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
shutdown.c Cull the examples folder 2023-10-11 21:45:32 -07:00
summy.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
symtab.c Introduce libc/mem/tinymalloc.inc 2024-05-07 03:19:49 -07:00
touch.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
unbuffer.c Stop using .com extension in monorepo 2024-03-03 03:12:19 -08:00
unveil.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
verynice.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
zipcopy.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
zipobj.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00