KaruroChori / tcc-vs

Fork of tinycc to support some extra bits I need in `vs`
GNU Lesser General Public License v2.1
0 stars 1 forks source link

Meson build not working #1

Open andy5995 opened 3 hours ago

andy5995 commented 3 hours ago

I got some errors when building with meson:

11/11] Linking target libtcc.so
FAILED: libtcc.so 
cc  -o libtcc.so libtcc.so.p/libtcc.c.o libtcc.so.p/tccpp.c.o libtcc.so.p/tccgen.c.o libtcc.so.p/tccelf.c.o libtcc.so.p/tccasm.c.o libtcc.so.p/tccrun.c.o libtcc.so.p/x86_64-gen.c.o libtcc.so.p/x86_64-link.c.o libtcc.so.p/i386-asm.c.o libtcc.so.p/lib_va_list.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libtcc.so -pthread -ldl
/usr/bin/ld: libtcc.so.p/tccpp.c.o: in function `parse_include':
/home/andy/src/tcc-vs/_build/../tccpp.c:1450:(.text+0x2ef1): undefined reference to `tcc_debug_bincl'
/usr/bin/ld: libtcc.so.p/tccpp.c.o: in function `tccpp_putfile':
/home/andy/src/tcc-vs/_build/../tccpp.c:1809:(.text+0x3eab): undefined reference to `tcc_debug_newfile'
/usr/bin/ld: libtcc.so.p/tccpp.c.o: in function `next_nomacro':
/home/andy/src/tcc-vs/_build/../tccpp.c:2606:(.text+0x5b7b): undefined reference to `tcc_debug_eincl'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `gind':
/home/andy/src/tcc-vs/_build/../tccgen.c:180:(.text+0x140): undefined reference to `tcc_tcov_block_begin'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `tccgen_compile':
/home/andy/src/tcc-vs/_build/../tccgen.c:391:(.text+0x648): undefined reference to `tcc_debug_start'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:392:(.text+0x654): undefined reference to `tcc_tcov_start'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:405:(.text+0x68d): undefined reference to `tcc_debug_end'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:406:(.text+0x699): undefined reference to `tcc_tcov_end'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `tccgen_finish':
/home/andy/src/tcc-vs/_build/../tccgen.c:412:(.text+0x6b8): undefined reference to `tcc_debug_end'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `put_extern_sym2':
/home/andy/src/tcc-vs/_build/../tccgen.c:547:(.text+0xb21): undefined reference to `tcc_debug_extern_sym'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `pop_local_syms':
/home/andy/src/tcc-vs/_build/../tccgen.c:1696:(.text+0x37dd): undefined reference to `tcc_add_debug_info'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `struct_decl':
/home/andy/src/tcc-vs/_build/../tccgen.c:4567:(.text+0x9a2b): undefined reference to `tcc_debug_fix_anon'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `unary':
/home/andy/src/tcc-vs/_build/../tccgen.c:5465:(.text+0xb738): undefined reference to `tcc_debug_line'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:5465:(.text+0xb74f): undefined reference to `tcc_tcov_check_line'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:6190:(.text+0xd00d): undefined reference to `tcc_tcov_block_end'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `block':
/home/andy/src/tcc-vs/_build/../tccgen.c:6971:(.text+0xe8b5): undefined reference to `tcc_tcov_check_line'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:6971:(.text+0xe8c7): undefined reference to `tcc_tcov_block_begin'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:7007:(.text+0xea87): undefined reference to `tcc_debug_stabn'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:7033:(.text+0xeba1): undefined reference to `tcc_debug_stabn'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:7062:(.text+0xed17): undefined reference to `tcc_tcov_block_end'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:7281:(.text+0xf8ff): undefined reference to `tcc_tcov_reset_ind'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:7310:(.text+0xf9c2): undefined reference to `tcc_tcov_check_line'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:7310:(.text+0xf9d9): undefined reference to `tcc_tcov_block_end'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `decl_initializer':
/home/andy/src/tcc-vs/_build/../tccgen.c:7784:(.text+0x10b0c): undefined reference to `tcc_debug_line'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:7784:(.text+0x10b23): undefined reference to `tcc_tcov_check_line'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `gen_function':
/home/andy/src/tcc-vs/_build/../tccgen.c:8331:(.text+0x12296): undefined reference to `tcc_debug_funcstart'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:8337:(.text+0x122e1): undefined reference to `tcc_debug_prolog_epilog'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:8349:(.text+0x1235b): undefined reference to `tcc_debug_prolog_epilog'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccgen.c:8353:(.text+0x12388): undefined reference to `tcc_debug_funcend'
/usr/bin/ld: libtcc.so.p/tccgen.c.o: in function `decl':
/home/andy/src/tcc-vs/_build/../tccgen.c:8642:(.text+0x12ec2): undefined reference to `tcc_debug_typedef'
/usr/bin/ld: libtcc.so.p/tccelf.c.o: in function `tccelf_new':
/home/andy/src/tcc-vs/_build/../tccelf.c:95:(.text+0x39a): undefined reference to `tcc_debug_new'
/usr/bin/ld: libtcc.so.p/tccasm.c.o: in function `tcc_assemble_internal':
/home/andy/src/tcc-vs/_build/../tccasm.c:981:(.text+0x23cf): undefined reference to `tcc_debug_line'
/usr/bin/ld: libtcc.so.p/tccasm.c.o: in function `tcc_assemble':
/home/andy/src/tcc-vs/_build/../tccasm.c:1032:(.text+0x25df): undefined reference to `tcc_debug_start'
/usr/bin/ld: /home/andy/src/tcc-vs/_build/../tccasm.c:1039:(.text+0x2672): undefined reference to `tcc_debug_end'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
KaruroChori commented 3 hours ago

Thanks for the report. Sadly it is a known issue for me to fix before v0.1.1-alpha of vs is released.

TinyCC is distributed with no meson nor cmake support out of the box. As a temporary stopgap, I put together a very half baked (and questionable) meson file (on the other repo, this one is overridden because as you have seen it does not work. It is barely enough to make it work on my system, and it still requires to manually run make inside the tcc subdir during its first build).

andy5995 commented 2 hours ago

Can I take this issue?

KaruroChori commented 2 hours ago

Yes, sure! For reference, this is what is injected when imported in the other repo: https://github.com/KaruroChori/vs-fltk/tree/master/subprojects/packagefiles/libtcc