[GH-ISSUE #14] bin/ld: cannot find -lsgutils2 #10

Closed
opened 2026-02-27 21:01:11 +03:00 by kerem · 3 comments
Owner

Originally created by @sg4r on GitHub (Mar 29, 2021).
Original GitHub issue: https://github.com/sg4r/proxmox-backup-client/issues/14

hi
sgutils the bindings for libsgutils2 not find sgutils2

nown-linux-gnu/lib/liballoc-db37898996f45c13.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-25b7435131fc4938.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-9d4b6f3c097e876e.rlib" "-Wl,--end-group" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3f953ad652ab829a.rlib" "-Wl,-Bdynamic" "-lacl" "-lsgutils2" "-lcrypt" "-lpam" "-lpam_misc" "-ludev" "-lfuse3" "-lrt" "-lc" "-luuid" "-lssl" "-lcrypto" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
= note: /bin/ld: cannot find -lsgutils2
collect2: error: ld returned 1 exit status

error: aborting due to previous error
error: could not compile proxmox-backup
[root@pbs proxmox-backup]#
[root@pbs proxmox-backup]# rpm -ql sg3_utils-libs
/usr/lib/.build-id
/usr/lib/.build-id/15
/usr/lib/.build-id/15/ff9e158de1d6bd43b00ab6ef0116a2650c2771
/usr/lib64/libsgutils2.so.2
/usr/lib64/libsgutils2.so.2.0.0
/usr/share/doc/sg3_utils-libs
/usr/share/doc/sg3_utils-libs/BSD_LICENSE
/usr/share/doc/sg3_utils-libs/COPYING

[root@pbs proxmox-backup]# ld -lsgutils2 --verbose
attempt to open //lib64/libsgutils2.so failed

[root@pbs proxmox-backup]# ll /usr/lib64/libs*.2
lrwxrwxrwx. 1 root root 19 27 avril 2020 /usr/lib64/libseccomp.so.2 -> libseccomp.so.2.4.3
lrwxrwxrwx. 1 root root 20 24 avril 2020 /usr/lib64/libsgutils2.so.2 -> libsgutils2.so.2.0.0

the name is /usr/lib64/libsgutils2.so.2
Add the following line to your Cargo.toml file:
sgutils = "0.0.1" do nothing

howto fix it ?

Originally created by @sg4r on GitHub (Mar 29, 2021). Original GitHub issue: https://github.com/sg4r/proxmox-backup-client/issues/14 hi sgutils the bindings for libsgutils2 not find sgutils2 nown-linux-gnu/lib/liballoc-db37898996f45c13.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-25b7435131fc4938.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-9d4b6f3c097e876e.rlib" "-Wl,--end-group" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3f953ad652ab829a.rlib" "-Wl,-Bdynamic" "-lacl" "-lsgutils2" "-lcrypt" "-lpam" "-lpam_misc" "-ludev" "-lfuse3" "-lrt" "-lc" "-luuid" "-lssl" "-lcrypto" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" = note: /bin/ld: cannot find -lsgutils2 collect2: error: ld returned 1 exit status error: aborting due to previous error error: could not compile `proxmox-backup` [root@pbs proxmox-backup]# [root@pbs proxmox-backup]# rpm -ql sg3_utils-libs /usr/lib/.build-id /usr/lib/.build-id/15 /usr/lib/.build-id/15/ff9e158de1d6bd43b00ab6ef0116a2650c2771 /usr/lib64/libsgutils2.so.2 /usr/lib64/libsgutils2.so.2.0.0 /usr/share/doc/sg3_utils-libs /usr/share/doc/sg3_utils-libs/BSD_LICENSE /usr/share/doc/sg3_utils-libs/COPYING [root@pbs proxmox-backup]# ld -lsgutils2 --verbose attempt to open //lib64/libsgutils2.so failed [root@pbs proxmox-backup]# ll /usr/lib64/libs*.2 lrwxrwxrwx. 1 root root 19 27 avril 2020 /usr/lib64/libseccomp.so.2 -> libseccomp.so.2.4.3 lrwxrwxrwx. 1 root root 20 24 avril 2020 /usr/lib64/libsgutils2.so.2 -> libsgutils2.so.2.0.0 the name is /usr/lib64/libsgutils2.so.2 Add the following line to your Cargo.toml file: sgutils = "0.0.1" do nothing howto fix it ?
kerem closed this issue 2026-02-27 21:01:11 +03:00
Author
Owner

@1nv0k32 commented on GitHub (Mar 29, 2021):

I had this problem too. install sg3_utils and create a link like this:
ln -s /lib64/libsgutils2.so.2.0.0 /lib64/libsgutils2.so
after this, we have a kernel problem:
= note: /root/proxmox-backup-client/proxmox-backup/target/release/deps/libproxmox-36a477b4857ce617.rlib(proxmox-36a477b4857ce617.proxmox.ag4rcajl-cgu.14.rcgu.o): In function 'proxmox::sys::linux::random_data::hb01d81547cb78b53': proxmox.ag4rcajl-cgu.14:(.text._ZN7proxmox3sys5linux11random_data17hb01d81547cb78b53E+0x6b): undefined reference to 'getrandom' /root/proxmox-backup-client/proxmox-backup/target/release/deps/libproxmox-36a477b4857ce617.rlib(proxmox-36a477b4857ce617.proxmox.ag4rcajl-cgu.14.rcgu.o): In function 'proxmox::sys::linux::fill_with_random_data::h85a98e1897f7e0a7': proxmox.ag4rcajl-cgu.14:(.text._ZN7proxmox3sys5linux21fill_with_random_data17h85a98e1897f7e0a7E+0xb): undefined reference to 'getrandom' collect2: error: ld returned 1 exit status

<!-- gh-comment-id:809745678 --> @1nv0k32 commented on GitHub (Mar 29, 2021): I had this problem too. install sg3_utils and create a link like this: `ln -s /lib64/libsgutils2.so.2.0.0 /lib64/libsgutils2.so` after this, we have a kernel problem: ` = note: /root/proxmox-backup-client/proxmox-backup/target/release/deps/libproxmox-36a477b4857ce617.rlib(proxmox-36a477b4857ce617.proxmox.ag4rcajl-cgu.14.rcgu.o): In function 'proxmox::sys::linux::random_data::hb01d81547cb78b53': proxmox.ag4rcajl-cgu.14:(.text._ZN7proxmox3sys5linux11random_data17hb01d81547cb78b53E+0x6b): undefined reference to 'getrandom' /root/proxmox-backup-client/proxmox-backup/target/release/deps/libproxmox-36a477b4857ce617.rlib(proxmox-36a477b4857ce617.proxmox.ag4rcajl-cgu.14.rcgu.o): In function 'proxmox::sys::linux::fill_with_random_data::h85a98e1897f7e0a7': proxmox.ag4rcajl-cgu.14:(.text._ZN7proxmox3sys5linux21fill_with_random_data17h85a98e1897f7e0a7E+0xb): undefined reference to 'getrandom' collect2: error: ld returned 1 exit status`
Author
Owner

@sg4r commented on GitHub (Mar 30, 2021):

Hi,
thanks for the workaround
normally this should be handled by the crate sgutils = "0.0.1"?

For random_data I will be working on a fix this week.

<!-- gh-comment-id:810003571 --> @sg4r commented on GitHub (Mar 30, 2021): Hi, thanks for the workaround normally this should be handled by the crate sgutils = "0.0.1"? For random_data I will be working on a fix this week.
Author
Owner

@sg4r commented on GitHub (Apr 5, 2021):

hi,it's corrected. can you test the build and the client please ?

Compiling proxmox v0.11.0 (/root/proxmox-backup-client/proxmox/proxmox)
Compiling zstd-sys v1.4.13+zstd.1.4.3
Compiling zstd-safe v1.4.13+zstd.1.4.3
Compiling zstd v0.4.28+zstd.1.4.3
Compiling proxmox-backup v1.0.11 (/root/proxmox-backup-client/proxmox-backup)
Finished release [optimized] target(s) in 8m 52s

<!-- gh-comment-id:813544877 --> @sg4r commented on GitHub (Apr 5, 2021): hi,it's corrected. can you test the build and the client please ? Compiling proxmox v0.11.0 (/root/proxmox-backup-client/proxmox/proxmox) Compiling zstd-sys v1.4.13+zstd.1.4.3 Compiling zstd-safe v1.4.13+zstd.1.4.3 Compiling zstd v0.4.28+zstd.1.4.3 Compiling proxmox-backup v1.0.11 (/root/proxmox-backup-client/proxmox-backup) Finished release [optimized] target(s) in 8m 52s
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-backup-client#10
No description provided.