https://bugzilla.redhat.com/show_bug.cgi?id=2449216



--- Comment #45 from Brad Smith <[email protected]> ---
1. With

%build
export LIBPATHRS_CAPI_BUILDMODE=cdylib
%cargo_build -f capi
...

Result:

... -Cforce-frame-pointers=yes
-Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn -C
link-arg=-Wl,-soname,libpathrs.so.0 -C
link-arg=-Wl,--version-script=/tmp/libpathrs-version-script.BlObHB -C
link-arg=-fuse-ld=lld --cfg cdylib`
error: linking with `cc` failed: exit status: 1

and

ipt=/tmp/libpathrs-version-script.BlObHB" "-fuse-ld=lld"
  = note: some arguments are omitted. use `--verbose` to show all linker
arguments
  = note: collect2: fatal error: cannot find 'ld'
          compilation terminated.

2. Add

BuildRequires:  lld

Success with build.

3. Given the remarks from @cyphar:

>> Is using clang a hard requirement?

> So, lld is a hard requirement for all architectures -- GNU ld doesn't like 
> the hacks you need to do to get symbol versioning > working with Rust, so lld 
> is a requirement.
> On *some* architectures (aarch64, if memory serves) rustc will pass special 
> linker flags based on what -linker= flag you have > configured (to work 
> around some arch-specific issues on a per-linker basis), and in my experience 
> that meant you needed to
> use clang (-fuse-ld=lld isn't enough to stop rustc from passing bad flags to 
> lld). It is possible that the newest Rust 
> versions (>=1.90, which default to lld) don't need these workarounds but most 
> of my packaging / testing work was dealing
> with old Rust versions.

Adding 

%global toolchain clang
...
BuildRequires:  clang

Also builds successfully.

Thoughts?


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
https://bugzilla.redhat.com/show_bug.cgi?id=2449216

Report this comment as SPAM: 
https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=report-spam&short_desc=Report%20of%20Bug%202449216%23c45

-- 
_______________________________________________
package-review mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://forge.fedoraproject.org/infra/tickets/issues/new

Reply via email to