paradigmxyz / revmc

JIT and AOT compiler for the Ethereum Virtual Machine, built on Revm.
Apache License 2.0
194 stars 13 forks source link

Could you statically link with cc #42

Closed 0xDmtri closed 2 months ago

0xDmtri commented 2 months ago

Tried to build an example but facing these issues:

error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.nvim-linux64/bin:/root/.foundry/bin:/root/.huff/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcOFwehH/symbols.o" "/root/repos/bots/dexy/bot/target/release/deps/dexy-95f118e3ef9e29e9.dexy.864cc12664bb441d-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/root/repos/bots/dexy/bot/target/release/deps" "-L" "/root/repos/bots/dexy/bot/target/release/build/c-kzg-aeee49dd8266e254/out" "-L" "/root/repos/bots/dexy/bot/target/release/build/blst-2c7d85070746cc32/out" "-L" "/root/repos/bots/dexy/bot/target/release/build/ring-a9241130804d937d/out" "-L" "/root/repos/bots/dexy/bot/target/release/build/secp256k1-sys-5a117361a56f802d/out" "-L" "/root/repos/bots/dexy/bot/target/release/build/zstd-sys-132f9bf75435cefa/out" "-L" "/root/repos/bots/dexy/bot/target/release/build/reth-mdbx-sys-3a5a1fd324017fd6/out" "-L" "/root/repos/bots/dexy/bot/target/release/build/strategy-78bd32dd00137d6e/out" "-L" "/root/repos/bots/dexy/bot/target/release/build/tikv-jemalloc-sys-e46e1e79fbdedced/out/build/lib" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustcOFwehH/libstrategy-dcf672f15cf63c52.rlib" "/tmp/rustcOFwehH/libreth_mdbx_sys-2f7ae91b6954939b.rlib" "/tmp/rustcOFwehH/libzstd_sys-f47275f6b83e33be.rlib" "/tmp/rustcOFwehH/libsecp256k1_sys-b29e003dbf06f140.rlib" "/tmp/rustcOFwehH/libring-2241961d7f127131.rlib" "/tmp/rustcOFwehH/libc_kzg-ddfeccd164d450f0.rlib" "/tmp/rustcOFwehH/libblst-2269550becd58e9f.rlib" "/tmp/rustcOFwehH/libtikv_jemalloc_sys-3ec8ee885f74f19f.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-d9076ee5964191bf.rlib" "-Wl,-Bdynamic" "-lssl" "-lcrypto" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/root/repos/bots/dexy/bot/target/release/deps/dexy-95f118e3ef9e29e9" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: /usr/bin/ld: /root/repos/bots/dexy/bot/target/release/deps/dexy-95f118e3ef9e29e9.dexy.864cc12664bb441d-cgu.0.rcgu.o: in function `strategy::simulators::register_handler::{{closure}}':
          dexy.864cc12664bb441d-cgu.0:(.text._ZN8strategy10simulators16register_handler28_$u7b$$u7b$closure$u7d$$u7d$17hb92fb93cfd549d23E+0x1b1): undefined reference to `lil_dexy'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
DaniPopes commented 2 months ago

Could you please elaborate a bit more? What are you trying to do? You can check out how to link statically a compiled code in the runner example

0xDmtri commented 2 months ago

Could you please elaborate a bit more? What are you trying to do? You can check out how to link statically a compiled code in the runner example

thats the weird thing, i pretty much copy pasted runners example...

I am running Debian 12

0xDmtri commented 2 months ago

Could you please elaborate a bit more? What are you trying to do? You can check out how to link statically a compiled code in the runner example

All i wanna do is to integrate revmc into my sim engine that was based on revm

DaniPopes commented 2 months ago

Could you please share the code? I updated the runner example to also have a main.rs, if you can run that with cargo run -p revmc-examples-runner then you can also integrate it into your project.

0xDmtri commented 2 months ago

Could you please share the code? I updated the runner example to also have a main.rs, if you can run that with cargo run -p revmc-examples-runner then you can also integrate it into your project.

sorry ser, im retarded, i had a typo in a name for linking... l and I ffs :D

All GG thx a lot!