nepx / halfix

x86 PC emulator that runs both natively and in the browser, via WebAssembly
https://nepx.github.io/halfix-demo/
GNU General Public License v3.0
681 stars 87 forks source link

Failing to compile #23

Closed xen0bit closed 3 years ago

xen0bit commented 3 years ago
remy@DESKTOP-O6A3FTL:/mnt/c/Users/Matt/halfix$ node makefile.js emscripten release
[
  '-lSDL',
  '-lSDLmain',
  '-lm',
  '-lz',
  '-s',
  'NO_FILESYSTEM=1',
  '-s',
  'TOTAL_MEMORY=256MB',
  '',
  '-s',
  'WASM=0'
]
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/pc.c -c -o build/objs/94-pc-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/util.c -c -o build/objs/94-util-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/state.c -c -o build/objs/94-state-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/io.c -c -o build/objs/94-io-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/display.c -c -o build/objs/94-display-1b228.o -Iincludeemcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/drive.c -c -o build/objs/94-drive-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/emscripten/emscripten.c -c -o build/objs/14h-emscripten-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/ini.c -c -o build/objs/94-ini-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/host/net-none.c -c -o build/objs/mt-net-none-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/access.c -c -o build/objs/jj-access-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/trace.c -c -o build/objs/jj-trace-1b228.o -Iincludeemcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/seg.c -c -o build/objs/jj-seg-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/cpu.c -c -o build/objs/jj-cpu-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/mmu.c -c -o build/objs/jj-mmu-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/ops/ctrlflow.c -c -o build/objs/u8-ctrlflow-1b228.o -Iinclude
src/emscripten/emscripten.c:29:5: error: expected expression
    EM_ASM_({
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/smc.c -c -o build/objs/jj-smc-1b228.o -Iinclude
    ^
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/decoder.c -c -o build/objs/jj-decoder-1b228.o -Iinclude
/usr/share/emscripten/system/include/emscripten/emscripten.h:97:71:emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/eflags.c -c -o build/objs/jj-eflags-1b228.o -Iinclude
 noteemcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/prot.c -c -o build/objs/jj-prot-1b228.o -Iinclude
: expanded emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/opcodes.c -c -o build/objs/jj-opcodes-1b228.o -Iinclude
from macro 'EM_ASM_'
#define EM_ASM_(code, ...) emscripten_asm_const_int(#code, __VA_ARGS__)
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/ops/arith.c -c -o build/objs/u8-arith-1b228.o -Iinclude
                                                                      ^
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/ops/io.c -c -o build/objs/u8-io-1b228.o -Iinclude
1 error generatedemcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/ops/string.c -c -o build/objs/u8-string-1b228.o -Iinclude
.
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/ops/stack.c -c -o build/objs/u8-stack-1b228.o -Iinclude
ERROR    root: compiler frontend failed to generate LLVM bitcode, halting
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/ops/misc.c -c -o build/objs/u8-misc-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/ops/bit.c -c -o build/objs/u8-bit-1b228.o -Iincludeemcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/softfloat.c -c -o build/objs/jj-softfloat-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/fpu.c -c -o build/objs/jj-fpu-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/ops/simd.c -c -o build/objs/u8-simd-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/dma.c -c -o build/objs/xx-dma-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/cmos.c -c -o build/objs/xx-cmos-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/pit.c -c -o build/objs/xx-pit-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/pic.c -c -o build/objs/xx-pic-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/kbd.c -c -o build/objs/xx-kbd-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/vga.c -c -o build/objs/xx-vga-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/ide.c -c -o build/objs/xx-ide-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/pci.c -c -o build/objs/xx-pci-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/apic.c -c -o build/objs/xx-apic-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/ioapic.c -c -o build/objs/xx-ioapic-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/fdc.c -c -o build/objs/xx-fdc-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/hardware/acpi.c -c -o build/objs/xx-acpi-1b228.o -Iinclude
Failed to compile: src/emscripten/emscripten.c
40/41 compiled successfully!
src/emscripten/emscripten.c

Any help would be greatly appreciated. Anything as simple as "it's on my end" or "it's on your end"

Thanks

nepx commented 3 years ago

That's really strange -- I did a git clone and ran the same command as you (node makefile.js emscripten release) and it compiled successfully.

What version of Emscripten are you using? I have Emscripten 2.0.9 installed, and it works fine. Seeing as how the error is from EMASM, it might be an Emscripten bug.

On 1/30/21, Remy notifications@github.com wrote:

remy@DESKTOP-O6A3FTL:/mnt/c/Users/Matt/halfix$ node makefile.js emscripten
release
[
  '-lSDL',
  '-lSDLmain',
  '-lm',
  '-lz',
  '-s',
  'NO_FILESYSTEM=1',
  '-s',
  'TOTAL_MEMORY=256MB',
  '',
  '-s',
  'WASM=0'
]
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/pc.c -c -o
build/objs/94-pc-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/util.c -c
-o build/objs/94-util-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/state.c -c
-o build/objs/94-state-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/io.c -c -o
build/objs/94-io-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/display.c
-c -o build/objs/94-display-1b228.o -Iincludeemcc -Wall -Wextra -Werror
-std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/drive.c -c -o
build/objs/94-drive-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/emscripten/emscripten.c -c -o build/objs/14h-emscripten-1b228.o
-Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/ini.c -c -o
build/objs/94-ini-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/host/net-none.c -c -o build/objs/mt-net-none-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/access.c -c -o build/objs/jj-access-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/trace.c
-c -o build/objs/jj-trace-1b228.o -Iincludeemcc -Wall -Wextra -Werror
-std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/seg.c -c -o
build/objs/jj-seg-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/cpu.c
-c -o build/objs/jj-cpu-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/mmu.c
-c -o build/objs/jj-mmu-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/ops/ctrlflow.c -c -o build/objs/u8-ctrlflow-1b228.o -Iinclude
src/emscripten/emscripten.c:29:5: error: expected expression
    EM_ASM_({
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/smc.c
-c -o build/objs/jj-smc-1b228.o -Iinclude
    ^
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/decoder.c -c -o build/objs/jj-decoder-1b228.o -Iinclude
/usr/share/emscripten/system/include/emscripten/emscripten.h:97:71:emcc
-Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/eflags.c -c
-o build/objs/jj-eflags-1b228.o -Iinclude
 noteemcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/prot.c -c -o build/objs/jj-prot-1b228.o -Iinclude
: expanded emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/opcodes.c -c -o build/objs/jj-opcodes-1b228.o -Iinclude
from macro 'EM_ASM_'
#define EM_ASM_(code, ...) emscripten_asm_const_int(#code, __VA_ARGS__)
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/ops/arith.c -c -o build/objs/u8-arith-1b228.o -Iinclude
                                                                      ^
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/ops/io.c -c -o build/objs/u8-io-1b228.o -Iinclude
1 error generatedemcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD
-O3 src/cpu/ops/string.c -c -o build/objs/u8-string-1b228.o -Iinclude
..
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/ops/stack.c -c -o build/objs/u8-stack-1b228.o -Iinclude
ERROR    root: compiler frontend failed to generate LLVM bitcode, halting
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/ops/misc.c -c -o build/objs/u8-misc-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/ops/bit.c -c -o build/objs/u8-bit-1b228.o -Iincludeemcc -Wall
-Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/softfloat.c -c -o
build/objs/jj-softfloat-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3 src/cpu/fpu.c
-c -o build/objs/jj-fpu-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/cpu/ops/simd.c -c -o build/objs/u8-simd-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/dma.c -c -o build/objs/xx-dma-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/cmos.c -c -o build/objs/xx-cmos-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/pit.c -c -o build/objs/xx-pit-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/pic.c -c -o build/objs/xx-pic-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/kbd.c -c -o build/objs/xx-kbd-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/vga.c -c -o build/objs/xx-vga-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/ide.c -c -o build/objs/xx-ide-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/pci.c -c -o build/objs/xx-pci-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/apic.c -c -o build/objs/xx-apic-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/ioapic.c -c -o build/objs/xx-ioapic-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/fdc.c -c -o build/objs/xx-fdc-1b228.o -Iinclude
emcc -Wall -Wextra -Werror -std=gnu99 -DEMSCRIPTEN_BUILD -O3
src/hardware/acpi.c -c -o build/objs/xx-acpi-1b228.o -Iinclude
Failed to compile: src/emscripten/emscripten.c
40/41 compiled successfully!
src/emscripten/emscripten.c

Any help would be greatly appreciated. Anything as simple as "it's on my end" or "it's on your end"

Thanks

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/nepx/halfix/issues/23

xen0bit commented 3 years ago

An update on this, I was able to successfully compile and it was entirely on my side. apt install emscripten is not what is needed.

Following the install directions on https://emscripten.org/docs/getting_started/downloads.html which correctly adds everything to PATH was key.

Got a different compile error, but that was because I needed to run: node makefile.js clean

Then node makefile.js emscripten release worked just fine.

nepx commented 3 years ago

That's excellent to hear, glad you were able to get it to work.

On 2/3/21, Remy notifications@github.com wrote:

Closed #23.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/nepx/halfix/issues/23#event-4285456662