ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.9k stars 287 forks source link

Error compiling with static build on m1 #1377

Closed m1m1k4tz closed 1 week ago

m1m1k4tz commented 7 months ago

When I try to use the standard options with STATICBUILD=1 I get an error

[  0%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run.c.o
[  0%] Generating /home/alex/box64/src/wrapped/generated/functions_list.txt
[  0%] Building C object CMakeFiles/dynarec_native.dir/src/dynarec/dynablock.c.o
[  1%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run0f.c.o
[  1%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run64.c.o
[  1%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run.c.o
[  1%] Building C object CMakeFiles/dynarec_native.dir/src/dynarec/dynarec_native.c.o
[  1%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run0f.c.o
[  1%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run66.c.o
[  2%] Building C object CMakeFiles/dynarec_native.dir/src/dynarec/dynarec_native_functions.c.o
[  4%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run64.c.o
[  4%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run660f.c.o
[  4%] Building C object CMakeFiles/dynarec_native.dir/src/emu/x64test.c.o
[  5%] Building C object CMakeFiles/dynarec_native.dir/src/dynarec/arm64/dynarec_arm64_functions.c.o
[  5%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run66.c.o
[  5%] Building C object CMakeFiles/dynarec_native.dir/src/dynarec/arm64/arm64_immenc.c.o
[  5%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run66f20f.c.o
[  5%] Building C object CMakeFiles/dynarec_native.dir/src/dynarec/arm64/arm64_printer.c.o
[  6%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run66f30f.c.o
[  7%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run660f.c.o
[  7%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run6664.c.o
[  8%] Building C object CMakeFiles/dynarec_native.dir/src/dynarec/arm64/dynarec_arm64_jmpnext.c.o
[  8%] Building ASM object CMakeFiles/dynarec_native.dir/src/dynarec/arm64/arm64_prolog.S.o
[  8%] Built target WRAPPERS
[  9%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run66f20f.c.o
[  9%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run66d9.c.o
[ 10%] Building ASM object CMakeFiles/dynarec_native.dir/src/dynarec/arm64/arm64_epilog.S.o
[ 10%] Building ASM object CMakeFiles/dynarec_native.dir/src/dynarec/arm64/arm64_next.S.o
[ 10%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run66dd.c.o
[ 10%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run66f30f.c.o
[ 11%] Building ASM object CMakeFiles/dynarec_native.dir/src/dynarec/arm64/arm64_lock.S.o
[ 11%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run66f0.c.o
[ 12%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_helper.c.o
[ 12%] Built target dynarec_native
[ 13%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_emit_tests.c.o
[ 14%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run67.c.o
[ 14%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run6664.c.o
[ 15%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_emit_math.c.o
[ 15%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_emit_logic.c.o
[ 15%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_emit_shift.c.o
[ 15%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run67_32.c.o
[ 15%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run66d9.c.o
[ 17%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_00.c.o
[ 17%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run66dd.c.o
[ 18%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run6764_32.c.o
[ 18%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run670f.c.o
[ 18%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_0f.c.o
[ 18%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run66f0.c.o
[ 19%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run6766.c.o
[ 19%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run67.c.o
[ 19%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run67_32.c.o
[ 20%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_64.c.o
[ 21%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64run67660f.c.o
[ 21%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64rund8.c.o
[ 21%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_66.c.o
[ 22%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run6764_32.c.o
[ 22%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_helper.c.o
[ 22%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_67.c.o
[ 23%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64rund9.c.o
[ 24%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run670f.c.o
[ 24%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_emit_tests.c.o
[ 24%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64runda.c.o
[ 25%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_67_32.c.o
[ 25%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run6766.c.o
[ 26%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_emit_math.c.o
[ 27%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64rundb.c.o
[ 27%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_emit_logic.c.o
[ 27%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64rundc.c.o
[ 28%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_6764_32.c.o
[ 28%] Building C object CMakeFiles/interpreter.dir/src/emu/x64run67660f.c.o
[ 28%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_emit_shift.c.o
[ 28%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64rundd.c.o
[ 29%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_d8.c.o
[ 31%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64runde.c.o
[ 31%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_00.c.o
[ 31%] Building C object CMakeFiles/interpreter.dir/src/emu/x64rund8.c.o
[ 31%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_d9.c.o
[ 31%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64rundf.c.o
[ 31%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_0f.c.o
[ 31%] Building C object CMakeFiles/interpreter.dir/src/emu/x64rund9.c.o
[ 32%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_da.c.o
[ 33%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_64.c.o
[ 34%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64runf0.c.o
[ 35%] Building C object CMakeFiles/interpreter.dir/src/emu/x64runda.c.o
[ 35%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_66.c.o
[ 35%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_db.c.o
[ 35%] Building C object CMakeFiles/interpreter.dir/src/emu/x64rundb.c.o
[ 35%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64runf20f.c.o
[ 36%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_67.c.o
[ 36%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_dc.c.o
[ 37%] Building C object CMakeFiles/interpreter.dir/src/emu/x64rundc.c.o
[ 38%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x64runf30f.c.o
[ 38%] Building C object CMakeFiles/interpreter.dir/src/emu/x64rundd.c.o
[ 38%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_67_32.c.o
[ 39%] Building C object CMakeFiles/interpreter.dir/src/emu/x64runde.c.o
[ 39%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_6764_32.c.o
[ 40%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_dd.c.o
[ 40%] Built target test_interpreter
[ 40%] Building C object CMakeFiles/interpreter.dir/src/emu/x64rundf.c.o
[ 40%] Building C object CMakeFiles/interpreter.dir/src/emu/x64runf0.c.o
[ 41%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_d8.c.o
[ 41%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_de.c.o
[ 42%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_df.c.o
[ 42%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_d9.c.o
[ 43%] Building C object CMakeFiles/interpreter.dir/src/emu/x64runf20f.c.o
[ 43%] Building C object CMakeFiles/interpreter.dir/src/emu/x64runf30f.c.o
[ 44%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_da.c.o
[ 44%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_f0.c.o
[ 44%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_660f.c.o
[ 44%] Built target interpreter
[ 45%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_db.c.o
[ 45%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_66f20f.c.o
[ 45%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_dc.c.o
[ 45%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_66f30f.c.o
[ 45%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_helper.c.o
[ 45%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_helper.c.o
[ 46%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_dd.c.o
[ 47%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_6664.c.o
[ 47%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_emit_tests.c.o
[ 47%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_de.c.o
[ 47%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_66f0.c.o
[ 47%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_emit_tests.c.o
[ 48%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_emit_math.c.o
[ 49%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_df.c.o
[ 50%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_f20f.c.o
[ 51%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_emit_math.c.o
[ 51%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/arm64/dynarec_arm64_f30f.c.o
[ 51%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_emit_logic.c.o
[ 51%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_emit_logic.c.o
[ 51%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_f0.c.o
[ 52%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_emit_shift.c.o
[ 52%] Building C object CMakeFiles/native_pass0.dir/src/dynarec/dynarec_native_pass.c.o
[ 53%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_emit_shift.c.o
[ 54%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_660f.c.o
[ 54%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_00.c.o
[ 54%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_00.c.o
[ 54%] Built target native_pass0
[ 54%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_66f20f.c.o
[ 55%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_0f.c.o
[ 55%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_0f.c.o
[ 55%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_66f30f.c.o
[ 56%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_64.c.o
[ 56%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_64.c.o
[ 57%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_6664.c.o
[ 58%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_67.c.o
[ 58%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_66.c.o
[ 58%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_66.c.o
[ 58%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_66f0.c.o
[ 59%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_67.c.o
[ 59%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_67_32.c.o
[ 60%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_f20f.c.o
[ 61%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_6764_32.c.o
[ 61%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/arm64/dynarec_arm64_f30f.c.o
[ 61%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_67_32.c.o
[ 62%] Building C object CMakeFiles/native_pass1.dir/src/dynarec/dynarec_native_pass.c.o
[ 62%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_d8.c.o
[ 63%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_6764_32.c.o
[ 63%] Built target native_pass1
[ 63%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_d8.c.o
[ 64%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_d9.c.o
[ 64%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_d9.c.o
[ 64%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_da.c.o
[ 64%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_db.c.o
[ 65%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_dc.c.o
[ 66%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_da.c.o
[ 66%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_dd.c.o
[ 67%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_df.c.o
[ 67%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_de.c.o
[ 67%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_db.c.o
[ 68%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_dc.c.o
[ 68%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_f0.c.o
[ 69%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_660f.c.o
[ 69%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_de.c.o
[ 69%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_dd.c.o
[ 69%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_66f20f.c.o
[ 70%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_df.c.o
[ 71%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_66f30f.c.o
[ 71%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_6664.c.o
[ 71%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_f0.c.o
[ 71%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_f30f.c.o
[ 71%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_f20f.c.o
[ 72%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/arm64/dynarec_arm64_66f0.c.o
[ 73%] Building C object CMakeFiles/native_pass3.dir/src/dynarec/dynarec_native_pass.c.o
[ 74%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_660f.c.o
[ 74%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_66f20f.c.o
[ 75%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_66f30f.c.o
[ 75%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_6664.c.o
[ 75%] Built target native_pass3
[ 75%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_66f0.c.o
[ 75%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_f30f.c.o
[ 76%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/arm64/dynarec_arm64_f20f.c.o
[ 77%] Building C object CMakeFiles/native_pass2.dir/src/dynarec/dynarec_native_pass.c.o
[ 77%] Built target native_pass2
[ 78%] Linking C static library libdynarec.a
[ 78%] Built target dynarec
[ 78%] Generating /home/alex/box64/src/git_head.h
[ 80%] Building C object CMakeFiles/box64.dir/src/main.c.o
[ 80%] Building C object CMakeFiles/box64.dir/src/build_info.c.o
[ 80%] Building C object CMakeFiles/box64.dir/src/custommem.c.o
[ 80%] Building C object CMakeFiles/box64.dir/src/box64context.c.o
[ 80%] Building C object CMakeFiles/box64.dir/src/dynarec/dynarec.c.o
[ 81%] Building C object CMakeFiles/box64.dir/src/elfs/elfhash.c.o
[ 82%] Building C object CMakeFiles/box64.dir/src/elfs/elfparser.c.o
[ 82%] Building C object CMakeFiles/box64.dir/src/elfs/elfloader.c.o
[ 82%] Building C object CMakeFiles/box64.dir/src/elfs/elfload_dump.c.o
[ 83%] Building C object CMakeFiles/box64.dir/src/elfs/elfdwarf_private.c.o
[ 83%] Building C object CMakeFiles/box64.dir/src/emu/x64compstrings.c.o
[ 83%] Building C object CMakeFiles/box64.dir/src/emu/x64emu.c.o
[ 83%] Building C object CMakeFiles/box64.dir/src/emu/x87emu_private.c.o
[ 85%] Building C object CMakeFiles/box64.dir/src/emu/x64primop.c.o
[ 85%] Building C object CMakeFiles/box64.dir/src/emu/x64int3.c.o
[ 85%] Building C object CMakeFiles/box64.dir/src/emu/x64run_private.c.o
[ 85%] Building C object CMakeFiles/box64.dir/src/emu/x64shaext.c.o
[ 86%] Building C object CMakeFiles/box64.dir/src/emu/x64syscall.c.o
[ 87%] Building C object CMakeFiles/box64.dir/src/emu/x64tls.c.o
[ 87%] Building C object CMakeFiles/box64.dir/src/emu/x64trace.c.o
[ 87%] Building C object CMakeFiles/box64.dir/src/emu/x86syscall.c.o
[ 88%] Building C object CMakeFiles/box64.dir/src/librarian/librarian.c.o
[ 88%] Building C object CMakeFiles/box64.dir/src/librarian/library.c.o
[ 88%] Building C object CMakeFiles/box64.dir/src/librarian/dictionnary.c.o
/home/alex/box64/src/librarian/library.c: In function ‘getSymbolInDataMaps’:
/home/alex/box64/src/librarian/library.c:790:16: warning: assignment to ‘void *’ from ‘uintptr_t’ {aka ‘long unsigned int’} makes pointer from integer without a cast [-Wint-conversion]
  790 |         symbol = kh_value(lib->w.mydatamap, k).addr;
      |                ^
[ 89%] Building C object CMakeFiles/box64.dir/src/libtools/auxval.c.o
[ 89%] Building C object CMakeFiles/box64.dir/src/librarian/symbols.c.o
[ 90%] Building C object CMakeFiles/box64.dir/src/libtools/signals.c.o
[ 90%] Building C object CMakeFiles/box64.dir/src/libtools/myalign.c.o
[ 91%] Building C object CMakeFiles/box64.dir/src/libtools/threads.c.o
[ 91%] Building C object CMakeFiles/box64.dir/src/tools/bitutils.c.o
[ 91%] Building C object CMakeFiles/box64.dir/src/tools/box64stack.c.o
[ 92%] Building C object CMakeFiles/box64.dir/src/tools/bridge.c.o
[ 93%] Building C object CMakeFiles/box64.dir/src/tools/my_cpuid.c.o
[ 93%] Building C object CMakeFiles/box64.dir/src/tools/fileutils.c.o
[ 93%] Building C object CMakeFiles/box64.dir/src/tools/callback.c.o
[ 93%] Building C object CMakeFiles/box64.dir/src/tools/pathcoll.c.o
[ 94%] Building C object CMakeFiles/box64.dir/src/tools/rbtree.c.o
[ 94%] Building C object CMakeFiles/box64.dir/src/tools/rcfile.c.o
[ 94%] Building C object CMakeFiles/box64.dir/src/wrapped/generated/wrapper.c.o
[ 95%] Building C object CMakeFiles/box64.dir/src/tools/wine_tools.c.o
[ 95%] Building C object CMakeFiles/box64.dir/src/libtools/obstack.c.o
[ 96%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedldlinux.c.o
[ 96%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedlibbsd.c.o
[ 97%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedlibc.c.o
[ 98%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedlibdl.c.o
In file included from /home/alex/box64/src/wrapped/wrappedlibc.c:3519:
/home/alex/box64/src/libtools/static_libc.h:195:14: warning: conflicting types for built-in function ‘__memcpy_chk’; expected ‘void *(void *, const void *, long unsigned int,  long unsigned int)’ [-Wbuiltin-declaration-mismatch]
  195 | extern void* __memcpy_chk(void*, void*, uint32_t, size_t);
      |              ^~~~~~~~~~~~
/home/alex/box64/src/libtools/static_libc.h:253:14: warning: conflicting types for built-in function ‘__stpcpy_chk’; expected ‘char *(char *, const char *, long unsigned int)’ [-Wbuiltin-declaration-mismatch]
  253 | extern void* __stpcpy_chk(void*, void*, size_t);
      |              ^~~~~~~~~~~~
/home/alex/box64/src/libtools/static_libc.h:254:14: warning: conflicting types for built-in function ‘__stpncpy_chk’; expected ‘char *(char *, const char *, long unsigned int,  long unsigned int)’ [-Wbuiltin-declaration-mismatch]
  254 | extern void* __stpncpy_chk(void*, void*, size_t, size_t);
      |              ^~~~~~~~~~~~~
/home/alex/box64/src/libtools/static_libc.h:257:14: warning: conflicting types for built-in function ‘__strcat_chk’; expected ‘char *(char *, const char *, long unsigned int)’ [-Wbuiltin-declaration-mismatch]
  257 | extern void* __strcat_chk(void*, void*, size_t);
      |              ^~~~~~~~~~~~
/home/alex/box64/src/libtools/static_libc.h:259:14: warning: conflicting types for built-in function ‘__strcpy_chk’; expected ‘char *(char *, const char *, long unsigned int)’ [-Wbuiltin-declaration-mismatch]
  259 | extern void* __strcpy_chk(void*, void*, size_t);
      |              ^~~~~~~~~~~~
/home/alex/box64/src/libtools/static_libc.h:264:14: warning: conflicting types for built-in function ‘__strncat_chk’; expected ‘char *(char *, const char *, long unsigned int,  long unsigned int)’ [-Wbuiltin-declaration-mismatch]
  264 | extern void* __strncat_chk(void*, void*, size_t, size_t);
      |              ^~~~~~~~~~~~~
/home/alex/box64/src/libtools/static_libc.h:265:14: warning: conflicting types for built-in function ‘__strncpy_chk’; expected ‘char *(char *, const char *, long unsigned int,  long unsigned int)’ [-Wbuiltin-declaration-mismatch]
  265 | extern void* __strncpy_chk(void*, void*, size_t, size_t);
      |              ^~~~~~~~~~~~~
[ 98%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedlibcmusl.c.o
[ 98%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedutil.c.o
[ 98%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedlibm.c.o
[ 99%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedlibresolv.c.o
/home/alex/box64/src/wrapped/wrappedlibresolv.c: In function ‘__res_nquery’:
/home/alex/box64/src/wrapped/wrappedlibresolv.c:42:90: warning: passing argument 1 of ‘res_nquery’ makes pointer from integer without a cast [-Wint-conversion]
   42 | extern int __res_nquery(int a, void* b, int c, int d, void* e, int f) {return res_nquery(a, b, c, d, e, f);}
      |                                                                                          ^
      |                                                                                          |
      |                                                                                          int
In file included from /home/alex/box64/src/wrapped/wrappedlibresolv.c:25:
/usr/include/resolv.h:293:29: note: expected ‘res_state’ {aka ‘struct __res_state *’} but argument is of type ‘int’
  293 | int             res_nquery (res_state, const char *, int, int,
      |                             ^~~~~~~~~
[100%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedlibpthread.c.o
[100%] Building C object CMakeFiles/box64.dir/src/wrapped/wrappedlibrt.c.o
[100%] Linking C executable box64
/usr/bin/ld: cannot find -lc: No such file or directory
/usr/bin/ld: cannot find -lm: No such file or directory
/usr/bin/ld: cannot find -lresolv: No such file or directory
/usr/bin/ld: cannot find -lbsd: No such file or directory
/usr/bin/ld: cannot find -lc: No such file or directory
/usr/bin/ld: cannot find -lm: No such file or directory
/usr/bin/ld: cannot find -lresolv: No such file or directory
/usr/bin/ld: cannot find -lbsd: No such file or directory
/usr/bin/ld: cannot find -lc: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/box64.dir/build.make:1047: box64] Error 1
make[1]: *** [CMakeFiles/Makefile2:342: CMakeFiles/box64.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
ptitSeb commented 7 months ago

It seems you don't have the needed static lib (like libc.a, libm.a....)

m1m1k4tz commented 7 months ago

Okay I installed glibc-static and libbsd-ctor-static and now I just get -lbsd: No such file or directory even with it installed and I ran ld -lbsd —verbose and it looked like it loaded the .so files but couldn’t find the .a files for some reason

ptitSeb commented 7 months ago

Yeah, I need to do something about those bsd lib/sysmbol. I'll work on that soon-ish.

m1m1k4tz commented 7 months ago

Sweet, no rush it would be pretty cool to see if you could demonstrate podman or docker running with this though on risc v I think people would be interested in that for datacenters and stuff

ptitSeb commented 7 months ago

yeah. That would be cool. Probably need a bit of work to get there tho.

m1m1k4tz commented 7 months ago

Probably but I think most containers don’t use the gpu anyway so maybe not too much 🤔

m1m1k4tz commented 7 months ago

This is a cool project the EU is doing btw if you haven’t already heard of it https://cordis.europa.eu/project/id/101092993

dgageot commented 4 months ago

I've got a similar error when trying to build for M1 in static mode:

128.0 /box64/src/librarian/library.c: In function 'getSymbolInDataMaps':
128.0 /box64/src/librarian/library.c:795:16: error: assignment to 'void *' from 'uintptr_t' {aka 'long unsigned int'} makes pointer from integer without a cast [-Wint-conversion]
128.0   795 |         symbol = kh_value(lib->w.mydatamap, k).addr;
128.0       |                ^
128.0 make[2]: *** [CMakeFiles/box64.dir/build.make:510: CMakeFiles/box64.dir/src/librarian/library.c.o] Error 1
128.0 make[1]: *** [CMakeFiles/Makefile2:342: CMakeFiles/box64.dir/all] Error 2
128.0 make: *** [Makefile:166: all] Error 2

How I build:

docker build .

With this Dockerfile:

FROM fedora AS build
RUN dnf install -y git gcc cmake glibc-static libbsd-ctor-static
RUN git clone https://github.com/ptitSeb/box64
WORKDIR /box64/build
RUN cmake -DSTATICBUILD=1 .. -D M1=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
RUN make -j "$(getconf _NPROCESSORS_ONLN)"

FROM scratch
COPY --link --from=build /box64/build/box64 /

Did I do something wrong?

ptitSeb commented 4 months ago

Compiler error here instead of a Warning. The compiler use some strict "warning as error" I guess here? I'll fix the issue tomorrow.

ptitSeb commented 4 months ago

Ok, I have pushed a fix for this. It should go farther now.

dgageot commented 4 months ago
21.65 /box64/src/wrapped/wrappedlibresolv.c: In function '__res_nquery':
21.65 /box64/src/wrapped/wrappedlibresolv.c:42:90: error: passing argument 1 of 'res_nquery' makes pointer from integer without a cast [-Wint-conversion]
21.65    42 | extern int __res_nquery(int a, void* b, int c, int d, void* e, int f) {return res_nquery(a, b, c, d, e, f);}
21.65       |                                                                                          ^
21.65       |                                                                                          |
21.65       |                                                                                          int
21.65 In file included from /box64/src/wrapped/wrappedlibresolv.c:25:
21.65 /usr/include/resolv.h:293:29: note: expected 'res_state' {aka 'struct __res_state *'} but argument is of type 'int'
21.65   293 | int             res_nquery (res_state, const char *, int, int,
21.65       |                             ^~~~~~~~~
21.66 make[2]: *** [CMakeFiles/box64.dir/build.make:882: CMakeFiles/box64.dir/src/wrapped/wrappedlibresolv.c.o] Error 1
21.66 make[2]: *** Waiting for unfinished jobs....
21.67 In file included from /box64/src/wrapped/wrappedlibpthread.c:84:
21.67 /box64/src/wrapped/wrappedlib_init.h:64:31: error: 'my_pthread_cond_signal' undeclared here (not in a function); did you mean 'pthread_cond_signal'?
21.67    64 | #define GOM(N, W) {#N, W, 0, &my_##N},
21.67       |                               ^~~
21.67 /box64/src/wrapped/wrappedlibpthread_private.h:110:1: note: in expansion of macro 'GOM'
21.67   110 | GOM(pthread_cond_signal, iFEp)
21.67       | ^~~
21.67 make[2]: *** [CMakeFiles/box64.dir/build.make:912: CMakeFiles/box64.dir/src/wrapped/wrappedlibpthread.c.o] Error 1
21.67 In file included from /box64/src/wrapped/wrappedlibc.c:3678:
21.67 /box64/src/libtools/static_libc.h:195:14: warning: conflicting types for built-in function '__memcpy_chk'; expected 'void *(void *, const void *, long unsigned int,  long unsigned int)' [-Wbuiltin-declaration-mismatch]
21.67   195 | extern void* __memcpy_chk(void*, void*, uint32_t, size_t);
21.67       |              ^~~~~~~~~~~~
21.67 /box64/src/libtools/static_libc.h:253:14: warning: conflicting types for built-in function '__stpcpy_chk'; expected 'char *(char *, const char *, long unsigned int)' [-Wbuiltin-declaration-mismatch]
21.67   253 | extern void* __stpcpy_chk(void*, void*, size_t);
21.67       |              ^~~~~~~~~~~~
21.67 /box64/src/libtools/static_libc.h:254:14: warning: conflicting types for built-in function '__stpncpy_chk'; expected 'char *(char *, const char *, long unsigned int,  long unsigned int)' [-Wbuiltin-declaration-mismatch]
21.67   254 | extern void* __stpncpy_chk(void*, void*, size_t, size_t);
21.67       |              ^~~~~~~~~~~~~
21.67 /box64/src/libtools/static_libc.h:257:14: warning: conflicting types for built-in function '__strcat_chk'; expected 'char *(char *, const char *, long unsigned int)' [-Wbuiltin-declaration-mismatch]
21.67   257 | extern void* __strcat_chk(void*, void*, size_t);
21.67       |              ^~~~~~~~~~~~
21.67 /box64/src/libtools/static_libc.h:259:14: warning: conflicting types for built-in function '__strcpy_chk'; expected 'char *(char *, const char *, long unsigned int)' [-Wbuiltin-declaration-mismatch]
21.67   259 | extern void* __strcpy_chk(void*, void*, size_t);
21.67       |              ^~~~~~~~~~~~
21.67 /box64/src/libtools/static_libc.h:264:14: warning: conflicting types for built-in function '__strncat_chk'; expected 'char *(char *, const char *, long unsigned int,  long unsigned int)' [-Wbuiltin-declaration-mismatch]
21.67   264 | extern void* __strncat_chk(void*, void*, size_t, size_t);
21.67       |              ^~~~~~~~~~~~~
21.67 /box64/src/libtools/static_libc.h:265:14: warning: conflicting types for built-in function '__strncpy_chk'; expected 'char *(char *, const char *, long unsigned int,  long unsigned int)' [-Wbuiltin-declaration-mismatch]
21.67   265 | extern void* __strncpy_chk(void*, void*, size_t, size_t);
21.67       |              ^~~~~~~~~~~~~
21.68 In file included from /box64/src/wrapped/wrappedlibc.c:3738:
21.68 /box64/src/wrapped/wrappedlibc_private.h:178:4: error: '__confstr_chk' undeclared here (not in a function)
21.68   178 | GO(__confstr_chk, LFipLL)
21.68       |    ^~~~~~~~~~~~~
21.68 /box64/src/wrapped/wrappedlib_init.h:48:30: note: in definition of macro 'GO'
21.68    48 | #define GO(N, W) {#N, W, 0, &N},
21.68       |                              ^
21.68 /box64/src/wrapped/wrappedlibc_private.h:300:5: error: 'error' undeclared here (not in a function); did you mean 'herror'?
21.68   300 | GOW(error, vFiipV)
21.68       |     ^~~~~
21.68 /box64/src/wrapped/wrappedlib_init.h:49:31: note: in definition of macro 'GOW'
21.68    49 | #define GOW(N, W) {#N, W, 1, &N},
21.68       |                               ^
21.69 /box64/src/wrapped/wrappedlibc_private.h:1583:4: error: 'res_nsearch' undeclared here (not in a function); did you mean 're_search'?
21.69  1583 | GO(res_nsearch, iFppiipi)
21.69       |    ^~~~~~~~~~~
21.69 /box64/src/wrapped/wrappedlib_init.h:48:30: note: in definition of macro 'GO'
21.69    48 | #define GO(N, W) {#N, W, 0, &N},
21.69       |                              ^
21.69 /box64/src/wrapped/wrappedlibc_private.h:2214:4: error: '__wcrtomb_chk' undeclared here (not in a function); did you mean '__wctomb_chk'?
21.69  2214 | GO(__wcrtomb_chk, LFpupL)
21.69       |    ^~~~~~~~~~~~~
21.69 /box64/src/wrapped/wrappedlib_init.h:48:30: note: in definition of macro 'GO'
21.69    48 | #define GO(N, W) {#N, W, 0, &N},
21.69       |                              ^
21.70 /box64/src/wrapped/wrappedlibc_private.h:2248:4: error: '__wcsrtombs_chk' undeclared here (not in a function); did you mean '__wctomb_chk'?
21.70  2248 | GO(__wcsrtombs_chk, LFppLpL)
21.70       |    ^~~~~~~~~~~~~~~
21.70 /box64/src/wrapped/wrappedlib_init.h:48:30: note: in definition of macro 'GO'
21.70    48 | #define GO(N, W) {#N, W, 0, &N},
21.70       |                              ^
21.71 make[2]: *** [CMakeFiles/box64.dir/build.make:807: CMakeFiles/box64.dir/src/wrapped/wrappedlibc.c.o] Error 1
22.13 make[1]: *** [CMakeFiles/Makefile2:342: CMakeFiles/box64.dir/all] Error 2
22.13 make: *** [Makefile:166: all] Error 2
ptitSeb commented 4 months ago

but is this build with -Werror? Do you really need Warning as Error? Also, is this gcc or clang? gcc build is tested, not much for clang.

dgageot commented 4 months ago

I'm using gcc and it's using whatever -W config is in the Makefile. I'll try to tweak it

dgageot commented 4 months ago

Thanks to your latest changes @ptitSeb, I got it to compile statically with this Dockerfile:

FROM debian AS build
RUN apt-get update -y && apt-get install -y git gcc cmake python3 libbsd-dev
WORKDIR /box64
RUN <<EOF
    set -e
    git init .
    git remote add origin https://github.com/ptitSeb/box64
    git fetch --depth 1 origin e792f003630f08703f903ce072f7ce0a26b2870d
    git checkout FETCH_HEAD
EOF
WORKDIR /box64/build
RUN cmake -DSTATICBUILD=1 .. -D M1=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo
RUN make -j "$(getconf _NPROCESSORS_ONLN)"

FROM alpine
COPY --link --from=build /box64/build/box64 /box64
ptitSeb commented 4 months ago

Good to know!

Unfortunatly, CI is still red on STATICBUILD, so it's not over...

LukeShortCloud commented 1 week ago

This should be fixed now. Closing as resolved.