cosmopolitan
cosmopolitan copied to clipboard
windows 64bit "Unsupported 16-bit application" thingie
First of all, thank you (everybody) for this revolutionary cosmopolitan tech. I asked a friend of mine to run a binary in the console (he has windows 10):

buildscript
#!/bin/sh
VERSION=0.9
APP=milkysynth
OBJECTS="wavread.c wavwrite.c cli.c"
test -z $COSMO_PATH && { echo "[e] COSMO_PATH env-var not set (should point to https://github.com/jart/cosmopolitan)"; exit 1; }
test -d cosmo || {
mkdir cosmo && cd cosmo
wget https://justine.lol/cosmopolitan/cosmopolitan.zip
unzip -o cosmopolitan.zip
}
test -f $APP.com && rm $APP.com
# this is basically the example from README.md
gcc -DVERSION=\"$VERSION\" -DCOSMO -g3 -Og -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone -pg \
-fno-omit-frame-pointer -pg -mnop-mcount -I$COSMO_PATH/libc -I$COSMO_PATH/libc/isystem -I$COSMO_PATH -I./fake \
-o $APP.com.dbg ${OBJECTS} -fuse-ld=bfd -Wl,-T,cosmo/ape.lds \
-include cosmo/cosmopolitan.h cosmo/crt.o cosmo/ape.o cosmo/cosmopolitan.a
objcopy -S -O binary $APP.com.dbg $APP.com && ls -lah $APP.com
ps. I ran this on linux 64bit Lubuntu, where the binary runs fine.