Bug 23492 - Support analysing libgfortran.so
Summary: Support analysing libgfortran.so
Status: RESOLVED FIXED
Alias: None
Product: libabigail
Classification: Unclassified
Component: default (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: Dodji Seketeli
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-07 16:34 UTC by Dodji Seketeli
Modified: 2018-11-29 14:04 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dodji Seketeli 2018-08-07 16:34:18 UTC
The fine folks behind the freedesktop-sdk flatpak effort stumbled upon abidiff not supporting libgfortran.so, at least on aarch64.  You can see the error at
https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/jobs/87258888:

===============
Comparing ABIs…
===============
master/files/lib/aarch64-linux-gnu/libgfortran.so
=================================================

in die_pretty_print_type at: abg-dwarf-reader.cc:10955: execution should not have reached this point!


Basically, this means that libabigail needs to understand Fortran binaries.
Comment 1 Mathieu Bridon 2018-08-07 16:46:37 UTC
Here's how you can get the offending file:

1. install flatpak
2. add the remote:

  flatpak remote-add --user freedesktop-sdk https://cache.sdk.freedesktop.org/freedesktop-sdk.flatpakrepo

3. pull the Aarch64 sdk:

  flatpak install --user freedesktop-sdk org.freedesktop.Sdk/aarch64/unstable


At this point, you can reproduce the problem:

  $ abidiff \
      ~/.local/share/flatpak/runtime/org.freedesktop.Sdk/aarch64/unstable/active/files/lib/aarch64-linux-gnu/libgfortran.so \
      ~/.local/share/flatpak/runtime/org.freedesktop.Sdk/aarch64/unstable/active/files/lib/aarch64-linux-gnu/libgfortran.so
  in die_pretty_print_type at: abg-dwarf-reader.cc:10916: execution should not have reached this point!
  Aborted (core dumped)

(yes, comparing the file to itself, why not :P )

(in fact, at this point you have the whole Aarch64 Sdk in ~/.local/share/flatpak/runtime/org.freedesktop.Sdk/aarch64/unstable/active/files so you can even try the rest of the libraries in there if you want :) )

You can run the above on an x86_64 machine, you shouldn't need to have an Aarch64 one.
Comment 2 Mathieu Bridon 2018-08-07 16:48:49 UTC
Dodji said on IRC the debuginfos are needed as well.

You can get them with:

  flatpak install --user freedesktop-sdk org.freedesktop.Sdk.Debug/aarch64/unstable

The files will be located in ~/.local/share/flatpak/runtime/org.freedesktop.Sdk.Debug/aarch64/unstable/active/files/
Comment 3 Mathieu Bridon 2018-08-08 09:47:56 UTC
Confirming it fails on all architectures, not just x86_64.

The reason it didn't fail on other arches is that I wasn't telling abidiff to look at the debuginfo. Now that I do, it fails as well.

It was failing on Aarch64 though, because for some reason libgfortran.so is not stripped in our Sdk on Aarch64. :-/

---

tl;dr: Now that I'm using abidiff correctly, it fails the exact same way on libgfortran.so on all architectures.
Comment 4 Dodji Seketeli 2018-11-29 14:04:28 UTC
This should be now fixed with the commit https://sourceware.org/git/gitweb.cgi?p=libabigail.git;a=commit;h=2c6ecfad6fe61c02ef78db97d1b96039c0892fa0 in the master branch of the upstream repository.