On Tue, Jan 2, 2024 at 1:09 PM Richard W.M. Jones <rjo...@redhat.com> wrote:
>
>
> I'm not sure exactly the effect on RISC-V binaries, but I wanted to
> raise it here to get the attention of the Fedora toolchain team ...
>
> Here's the bug:
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=31179
> RISC-V: The SET/ADD/SUB fix breaks ABI compatibility with 2.41 objects
>
> It refers to this change in binutils 2.41:
>
> https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=73d931e560059a87d76f528fafbb4270a98746bc
>
> As far as I understand the issue (which is not too far) this mainly
> affects shipped *.o and *.a files (ie. static libraries and similar)
> which were compiled with binutils < 2.41, which either won't link
> correctly or will give a linker error when using GNU ld from binutils 2.41.

Correction. This is broken in <= 2.41 (incl. the current stable
binutils release).

>
> Unclear if it also affects *.so files (which would be a much more
> serious ABI break), and also if it affects most binaries or just a
> few.  I initially thought this only affected programs using 128 bit
> ints, so didn't think it was too important, but after reading the
> commit I'm not sure that is really true.

Nelson Chu committed (5 days ago) a change:

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=73d931e560059a87d76f528fafbb4270a98746bc

This will accept whatever is produced by <= 2.41 and the final binary
will be correct. There is also a new ld flag (--check-uleb128) which
can produce a warning if it detects an issue.

I plan/hope to use binutils 2.42 in Fedora/RISCV 40. That would happen
before I start mass rebuilding, and that should fix this.

>
> There's been discussion about adding an ELF tag, but that seems very
> problematic to me:
> https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/414

Yeah. I doubt we need a tag. I don't think it solves anything. Nelson
commit (i.e. workaround) + mass rebuild should resolve any
inconveniences AFAIK.

Cheers,
david

>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> virt-p2v converts physical machines to virtual machines.  Boot with a
> live CD or over the network (PXE) and turn machines into KVM guests.
> http://libguestfs.org/virt-v2v
> --
> _______________________________________________
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> 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/devel@lists.fedoraproject.org
> Do not reply to spam, report it: 
> https://pagure.io/fedora-infrastructure/new_issue
--
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
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/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to