Build problem: cannot find -lc++ #18

Closed
opened 2025-04-09 14:58:14 +00:00 by tcsenpai · 0 comments
Owner

Originally created by @0-wiz-0 on 2/14/2025

Version

0.5.1, but also ecc05cdd60

Description

I've tried packaging this for pkgsrc. My test system is a NetBSD-10.99.12/x86_64.
The build seems to mostly work fine, but at the end, linking fails with:

   Compiling unrar v0.5.7
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/usr/pkg/lib/rustlib/x86_64-unknown-netbsd/bin:/usr/pkg/lib/rustlib/x86_64-unknown-netbsd/bin:/usr/pkg/lib/rustlib/x86_64-unknown-netbsd/bin:/scratch/wip/ouch/work/.cwrapper/bin:/scratch/wip/ouch/work/.buildlink/bin:/scratch/wip/ouch/work/.gcc/bin:/scratch/wip/ouch/work/.tools/bin:/usr/pkg/bin:/usr/bin:/bin:/usr/pkg/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/pkg_bulk/bin:/usr/pkg/bin:/usr/pkg/bin" VSLANG="1033" "cc" "-Wl,-R/usr/pkg/lib/libatomic" "-Wl,-L/usr/pkg/lib/libatomic" "-m64" "/tmp/rustcekknHa/symbols.o" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/deps/ouch-4e3663c301fdeb2c.ouch.fa12934dc8acb9d4-cgu.0.rcgu.o" "-Wl,--as-needed" "-Wl,-Bstatic" "/tmp/rustcekknHa/libzstd_sys-b2bc71eaec4db6a4.rlib" "/tmp/rustcekknHa/liblzma_sys-a6b6aeb0ad42aecb.rlib" "/tmp/rustcekknHa/libbzip2_sys-277a4
e3ea078da0a.rlib" "/tmp/rustcekknHa/liblibbzip3_sys-e696356b96914af3.rlib" "/tmp/rustcekknHa/libunrar_sys-60c2102fcfe3e739.rlib" "/usr/pkg/lib/rustlib/x86_64-unknown-netbsd/lib/libcompiler_builtins-4f6bad7a53f64524.rlib" "-Wl,-Bdynamic" "-lz" "-lc++" "-lpthread" "-lutil" "-lrt" "-lutil" "-lexecinfo" "-lexecinfo" "-lpthread" "-lrt" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lrt" "-lutil" "-lexecinfo" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/bzip2-sys-a836338c410cbcb7/out/lib" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/libbzip3-sys-e2c868e6f835058a/out" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/unrar_sys-009dd15ab9827324/out" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/lzma-sys-1e8898c0ff919b25/out" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/zstd-sys-e9ae2d61d7708ce0/out" "-o" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/deps/ouch-4e3663c301fdeb2c" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-all"
  = note: ld: cannot find -lc++: No such file or directory

My system does not provide a libc++ library, but it has a libstdc++ one. I think that is quite common, so I wonder if there's some code that checks for this and just doesn't trigger correctly on my system.

Current Behavior

Linking fails, see above.

Expected Behavior

Linking succeeds.

Additional Information

No response

*Originally created by @0-wiz-0 on 2/14/2025* ### Version 0.5.1, but also ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321 ### Description I've tried packaging this for pkgsrc. My test system is a NetBSD-10.99.12/x86_64. The build seems to mostly work fine, but at the end, linking fails with: ``` Compiling unrar v0.5.7 error: linking with `cc` failed: exit status: 1 | = note: LC_ALL="C" PATH="/usr/pkg/lib/rustlib/x86_64-unknown-netbsd/bin:/usr/pkg/lib/rustlib/x86_64-unknown-netbsd/bin:/usr/pkg/lib/rustlib/x86_64-unknown-netbsd/bin:/scratch/wip/ouch/work/.cwrapper/bin:/scratch/wip/ouch/work/.buildlink/bin:/scratch/wip/ouch/work/.gcc/bin:/scratch/wip/ouch/work/.tools/bin:/usr/pkg/bin:/usr/bin:/bin:/usr/pkg/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/pkg_bulk/bin:/usr/pkg/bin:/usr/pkg/bin" VSLANG="1033" "cc" "-Wl,-R/usr/pkg/lib/libatomic" "-Wl,-L/usr/pkg/lib/libatomic" "-m64" "/tmp/rustcekknHa/symbols.o" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/deps/ouch-4e3663c301fdeb2c.ouch.fa12934dc8acb9d4-cgu.0.rcgu.o" "-Wl,--as-needed" "-Wl,-Bstatic" "/tmp/rustcekknHa/libzstd_sys-b2bc71eaec4db6a4.rlib" "/tmp/rustcekknHa/liblzma_sys-a6b6aeb0ad42aecb.rlib" "/tmp/rustcekknHa/libbzip2_sys-277a4 e3ea078da0a.rlib" "/tmp/rustcekknHa/liblibbzip3_sys-e696356b96914af3.rlib" "/tmp/rustcekknHa/libunrar_sys-60c2102fcfe3e739.rlib" "/usr/pkg/lib/rustlib/x86_64-unknown-netbsd/lib/libcompiler_builtins-4f6bad7a53f64524.rlib" "-Wl,-Bdynamic" "-lz" "-lc++" "-lpthread" "-lutil" "-lrt" "-lutil" "-lexecinfo" "-lexecinfo" "-lpthread" "-lrt" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lrt" "-lutil" "-lexecinfo" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/bzip2-sys-a836338c410cbcb7/out/lib" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/libbzip3-sys-e2c868e6f835058a/out" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/unrar_sys-009dd15ab9827324/out" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/lzma-sys-1e8898c0ff919b25/out" "-L" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/build/zstd-sys-e9ae2d61d7708ce0/out" "-o" "/scratch/wip/ouch/work/ouch-ecc05cdd60dc7e180ddf10a2e6a3c6bcea475321/target/release/deps/ouch-4e3663c301fdeb2c" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-all" = note: ld: cannot find -lc++: No such file or directory ``` My system does not provide a `libc++` library, but it has a `libstdc++` one. I think that is quite common, so I wonder if there's some code that checks for this and just doesn't trigger correctly on my system. ### Current Behavior Linking fails, see above. ### Expected Behavior Linking succeeds. ### Additional Information _No response_
tcsenpai added the
upstream
bug
bug
bug
bug
labels 2025-04-09 14:58:15 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/ouch#18
No description provided.