@bjorn3@hachyderm.io avatar

bjorn3

@bjorn3@hachyderm.io

Student. #rust programmer. Creator of rustc_codegen_cranelift. He/Him

Dieses Profil is von einem föderierten Server und möglicherweise unvollständig. Auf der Original-Instanz anzeigen

fasterthanlime , an Random Englisch
@fasterthanlime@hachyderm.io avatar

Found another snag re: dynamic linking Rust code — N copies of tokio are present, so that's N distinct thread-locals storing the "current tokio context"

...and the binary is calling the library from an executor, but the library doesn't think so.

https://github.com/tokio-rs/tokio/blob/65d0e08d39f06eba88661d3d6de665b14588f30d/tokio/src/runtime/context.rs#L77-L122

bjorn3 ,
@bjorn3@hachyderm.io avatar

@fasterthanlime You can make a dylib which depends on tokio and then depend on this dylib from all your other dylibs to ensure only a single copy of tokio is present. Make sure to use use foo as _; or something similar to male rustc actually register a dependency on foo. Just having it in your Cargo.toml is not enough.

fasterthanlime , an Random Englisch
@fasterthanlime@hachyderm.io avatar

@bjorn3 !! all 689 crates in the dep graph of my website do compile under aarch64-apple-darwin (but do not link, either with the hacky patch in you-know-which-wasmtime-issue, or with the classic linker).

I'm really excited though!

bjorn3 ,
@bjorn3@hachyderm.io avatar

@fasterthanlime What is the linker error with the classic linker? As far as I'm aware it should work with the classic linker.

fasterthanlime , an Random Englisch
@fasterthanlime@hachyderm.io avatar

so... rustc's cranelift backend won't work on macOS arm64 because cranelift lacks variadic argument support apparently?

and the last comment on that was 5 years ago: https://github.com/bytecodealliance/wasmtime/issues/1030

mhh.

bjorn3 ,
@bjorn3@hachyderm.io avatar

@fasterthanlime A contributor figured out a hack to make varargs work on arm64 macOS without needing Cranelift changes: https://hachyderm.io/@bjorn3/112648887843960881

  • Alle
  • Abonniert
  • Moderiert
  • Favoriten
  • random
  • haupteingang
  • Alle Magazine