On Mon, Oct 14, 2024 at 3:09 PM Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx> wrote: > > On Mon, Oct 14, 2024 at 8:46 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote: > > > > rustc ignores --emit=link=rust/libmacro.so > > and produces rust/libmacro.dylib. > > > > Is this a bug in rustc? This was my bad - I set this thread down the wrong path. In fact the current build produces libmacros.so, but I haven't been able to convince rustc to consume it. Changing `--extern macros` to `--extern macros=$(objtree)/$(obj)/libmacros.so` produces 'error[E0463]: can't find crate for `macros`'. With a toy example, trying to link a proc-macro crate .so produces a more informative message than the kernel build does: ``` rustc main.rs --extern macros=./libmacros.so error: extern location for macros is of an unknown type: ./libmacros.so --> main.rs:4:1 | 4 | extern crate macros; | ^^^^^^^^^^^^^^^^^^^^ error: file name should be lib*.rlib or lib*.dylib --> main.rs:4:1 | 4 | extern crate macros; | ^^^^^^^^^^^^^^^^^^^^ ``` I've opened https://github.com/rust-lang/rust/issues/131720, let's see what the experts think.