cnlohr / mini-rv32ima

A tiny C header-only risc-v emulator.
MIT License
1.65k stars 135 forks source link

Doom build fails since 32-bit libraries not installed (I think?) #14

Closed RagnarDa closed 1 year ago

RagnarDa commented 1 year ago

Hey! Nice project!

I've gotten everything to work except for the Doom experiment.

Running make in the experiments/emdoom folder results in the following output: $ make CC=../../../../buildroot/output/host/usr/bin/riscv32-buildroot-linux-uclibc-gcc CFLAGS="-mabi=ilp32 -fPIE -pie -flto" CFLAGS_FINAL="-mabi=ilp32 -flto -fPIE -pie -static -march=rv32ima -O4 -s -g -DNORMALUNIX -DLINUX -DMAXPLAYERS=1 -DDISABLE_NETWORK -static-libgcc -DSET_MEMORY_DEBUG=0 -DRANGECHECK -fdata-sections -ffunction-sections" LDFLAGS='-Wl,-elf2flt="-r -s 36000" -static -Wl,-Map=../../output.map -Wl,--gc-sections -flto' LIBS="" CS="../../video_console.c ../../extra_assembly.S" make -C embeddeddoom/src make[1]: Entering directory '/home/christoffer/mini-rv32ima/experiments/emdoom/embeddeddoom/src' gcc -m32 -DNORMALUNIX -DLINUX -L/usr/X11R6/lib -o support/shrinkwad support/shrinkwad.c -lXext -lX11 -lnsl -lm -lpthread /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libXext.so when searching for -lXext /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libXext.a when searching for -lXext /usr/bin/ld: cannot find -lXext: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libXext.so when searching for -lXext /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libX11.so when searching for -lX11 /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libX11.a when searching for -lX11 /usr/bin/ld: cannot find -lX11: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libX11.so when searching for -lX11 /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libnsl.so when searching for -lnsl /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libnsl.a when searching for -lnsl /usr/bin/ld: cannot find -lnsl: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libnsl.so when searching for -lnsl collect2: error: ld returned 1 exit status I think it's because I don't have the 32-bit versions of the necessary libraries installed but I am stuck trying to install them. Running latest Ubuntu.

cnlohr commented 1 year ago

You can't use Doom as it's written on 64-bit systems. It only supports 32-bit operations. You will need multilib copies of the libraries.

Maybe some day.

RagnarDa commented 1 year ago

Figured it out: sudo apt-get install gcc-multilib libx11-dev:i386 libxext-dev:i386 libnsl-dev:i386

Managed to get it starting but some problem with display I think... :)

Skärmavbild 2022-12-26 kl  21 59 51
cnlohr commented 1 year ago

Excellent. I also updated the embeddeddoom readme.