Repository navigation
"Linking with cc failed" - trying to cargo compile rust-based find-fd on OmniOS #145
Copy link
Copy link
Closed
Description
I need to run rust-based fd-find.
Instead of bothering the super-busy Joyent/pkgsrc devs (by the way thank you for ripgrep!), I thought of compiling it using cargo.
On OmniOS r151026 with pkgsrc 2018Q2,
root@omnios:~# uname -a
SunOS omnios 5.11 omnios-r151026-d258f672aa i86pc i386 i86pc
I have successfully installed rust and gcc,
root@omnios:~# rustc --version
rustc 1.27.0
root@omnios:~# cc --version
cc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Also, I have this as $PATH
root@omnios:~# echo $PATH
/opt/local/sbin:/opt/local/bin:/usr/sbin:/usr/bin
Still, trying to install fd-find using cargo I get errors like error: linking with cc failed: exit code: 1,
root@fido:~# cargo install fd-find
Updating registry `https://github.com/rust-lang/crates.io-index`
Installing fd-find v7.1.0
Compiling semver-parser v0.7.0
Compiling version_check v0.1.4
Compiling void v1.0.2
Compiling rand_core v0.2.1
Compiling libc v0.2.43
Compiling stable_deref_trait v1.1.1
Compiling cfg-if v0.1.5
Compiling ucd-util v0.1.1
Compiling unicode-width v0.1.5
Compiling regex v1.0.5
Compiling nodrop v0.1.12
Compiling scopeguard v0.3.3
Compiling nix v0.11.0
Compiling crossbeam-utils v0.5.0
Compiling ansi_term v0.11.0
Compiling strsim v0.7.0
Compiling bitflags v1.0.4
Compiling vec_map v0.8.1
Compiling memoffset v0.2.1
Compiling utf8-ranges v1.0.1
Compiling same-file v1.0.3
Compiling fnv v1.0.6
Compiling log v0.4.5
Compiling owning_ref v0.3.3
Compiling arrayvec v0.4.7
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-m64" "-L" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib" "/tmp/cargo-installWG6UWN/release/build/nix-aacaf4418f670152/build_script_build-aacaf4418f670152.build_script_build0-c1f9b7886081f32c63a6dc6adfadc212.rs.rcgu.o" "/tmp/cargo-installWG6UWN/release/build/nix-aacaf4418f670152/build_script_build-aacaf4418f670152.build_script_build1-c1f9b7886081f32c63a6dc6adfadc212.rs.rcgu.o" "-o" "/tmp/cargo-installWG6UWN/release/build/nix-aacaf4418f670152/build_script_build-aacaf4418f670152" "/tmp/cargo-installWG6UWN/release/build/nix-aacaf4418f670152/build_script_build-aacaf4418f670152.crate.allocator.rcgu.o" "-Wl,-z" "-Wl,ignore" "-nodefaultlibs" "-L" "/tmp/cargo-installWG6UWN/release/deps" "-L" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib/libstd-e3cf0fe0847ed813.rlib" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib/libpanic_unwind-d20975b11a4ea47b.rlib" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib/libunwind-340827095a1c5df9.rlib" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib/liballoc_system-3cef478229e227eb.rlib" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib/liblibc-ec41d1fdd7710214.rlib" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib/liballoc-90d8f0bc63b583d9.rlib" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib/libcore-aa4dc5503cc5c8c8.rlib" "-Wl,--end-group" "/opt/local/lib/rustlib/x86_64-sun-solaris/lib/libcompiler_builtins-06be8eed06a72164.rlib" "-Wl,-Bdynamic" "-l" "socket" "-l" "posix4" "-l" "pthread" "-l" "resolv" "-l" "ssp" "-l" "umem" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread"
= note: ld: fatal: file crt1.o: open failed: No such file or directory
collect2: error: ld returned 1 exit status
Compiling unreachable v1.0.0
error: aborting due to previous error
[more similar errors]
It seems like cargo does not see cc?
Could somebody point to me pages or tips on how to solve this?
It would be good for others to know too, as quite a few very nice tools are developed in rust nowadays.
Thank you in advance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
jperkin commentedon Sep 18, 2018
The error here is this line:
This file belongs in /usr/lib and needs to be provided by the OS, I think on OmniOS it is in the "gcc-runtime" package but I am not sure. Install the relevant package and things should work.
rmustacc commentedon Sep 18, 2018
priyadarshan commentedon Sep 19, 2018
Thank you for quick reply. After installing proper OmniOS tooling,
lderror disappear, whilecc failederror remains, with no explanation. It seems there's some kind of "impedence mismatch" between pkgsrc and OmniOS native packages. I will investigate this further and report back.priyadarshan commentedon Oct 6, 2018
I am back as promised. It turns out it was not a missing dependency, but rather an issue with nix missing Illumos/Solaris Bindings.
Since I am able to compile smoothly other rust apps, like ripgrep's latest version, I hope that issue will solve this as well.
[-]"Linking with cc failed" - trying to cargo compile rust-based find-fd[/-][+]"Linking with cc failed" - trying to cargo compile rust-based find-fd on OmniOS[/+]liferea: Update www/liferea to 1.12.5a
papertigers commentedon Jan 14, 2019
@priyadarshan btw here are the missing pieces in libc needed by nix:
papertigers/libc@6b9b207
I have also hacked nix to a state where it can compile and I was able to successfully build fd-find on illumos. It seems to function correctly and all of its tests pass via
cargo test.Next steps:
priyadarshan commentedon Jan 15, 2019
Thank you so much for the enormous work.
I am sure many, including the open nix issue will benefit.
Update logrotate to version 3.15.0.
fasttracker2: update to b147
libepoxy: Update to 1.5.3
cups-filters: Update to 1.25.11
Update to network-3.1.1.1
Update to yaml-0.11.2.0
115 remaining items
devel/serie: update to 0.7.1
p5-YAML-Syck: update to 1.45.
devel/serie: update to 0.7.1
p5-YAML-Syck: update to 1.45.
fig2dev: update to 3.2.9a.
bfs: update to 4.1.3. Changes:
ocaml-zarith: update to 1.14
Update to 0.41
news/bulletty: update to 0.3.0
databases/ruby-with_advisory_lock: update to 7.6.0
news/bulletty: update to 0.3.0
databases/ruby-with_advisory_lock: update to 7.6.0
confuse: update to 3.4.
pdsh: Update to 2.36
py-aiostream: update to 0.8.1.