Replies: 1 comment 7 replies
-
|
I don't think it does, and in fact, I can't reproduce this error inside a fresh $ docker run --rm -it homebrew/brew
linuxbrew@9571c822b8ba:~$ brew install binutils libosip
[...]
linuxbrew@9571c822b8ba:~$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
[...]
linuxbrew@9571c822b8ba:~$ source "$HOME/.cargo/env"
linuxbrew@9571c822b8ba:~$ which rustc
/home/linuxbrew/.cargo/bin/rustc
linuxbrew@9571c822b8ba:~$ rustc -vV
rustc 1.90.0 (1159e78c4 2025-09-14)
binary: rustc
commit-hash: 1159e78c4747b02ef996e55082b704c09b970588
commit-date: 2025-09-14
host: x86_64-unknown-linux-gnu
release: 1.90.0
LLVM version: 20.1.8
linuxbrew@9571c822b8ba:~$ export PATH="/home/linuxbrew/.linuxbrew/opt/binutils/bin:$PATH"
linuxbrew@9571c822b8ba:~$ which ld
/home/linuxbrew/.linuxbrew/opt/binutils/bin/ld
linuxbrew@9571c822b8ba:~$ which ld.bfd
/home/linuxbrew/.linuxbrew/opt/binutils/bin/ld.bfd
linuxbrew@9571c822b8ba:~$ echo "fn main() {}" > /tmp/a.rs
linuxbrew@9571c822b8ba:~$ rustc -losipparser2 /tmp/a.rs
error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-m64" "/tmp/rustccIkIep/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bdynamic" "-losipparser2" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustccIkIep/raw-dylibs" "-B<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "a" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: rust-lld: error: unable to find library -losipparser2
collect2: error: ld returned 1 exit status
error: aborting due to 1 previous error
linuxbrew@9571c822b8ba:~$ rustc -Clinker-features=-lld -losipparser2 /tmp/a.rs
error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-m64" "/tmp/rustcWZVcoS/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bdynamic" "-losipparser2" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcWZVcoS/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "a" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: /home/linuxbrew/.linuxbrew/opt/binutils/bin/ld: cannot find -losipparser2: No such file or directory
collect2: error: ld returned 1 exit status
error: aborting due to 1 previous error
[Above snippet updated as I missed putting Homebrew Binutils in However, it does find the library if you set LIBRARY_PATH=/home/linuxbrew/.linuxbrew/lib rustc -Clinker-features=-lld -losipparser2 /tmp/a.rsCan you check if you have any of those environment variables set? Try e.g. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Additional Info
Output of
brew configOutput of
brew doctorDescription of issue
rust-lld can't find a system wide lib. homebrew ld can. Is there an embedded sysroot or search path?
I'm trying to debug the following as per my Rust issue - rust-lang/rust#147329
vs which works and uses
ldfrom homebrew.Thanks.
Beta Was this translation helpful? Give feedback.
All reactions