ltrace - build on ppc64el fails

Bug #1967518 reported by Olivier Gayot
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ltrace (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The build on ppc64el fails with the following error:

plt.c: In function ‘arch_elf_add_plt_entry’:
plt.c:781:17: error: ‘libsym’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  781 | free(libsym);
      | ^~~~~~~~~~~~
cc1: all warnings being treated as errors

This seems to be happening because our back-port of this upstream patch is wrong:

commit 7f20cb21a0d021ab3b12d8a5187beb728f339b0f
Author: Thierry Fauck <email address hidden>
AuthorDate: Tue May 13 07:48:24 2014 -0400
Commit: Petr Machata <email address hidden>
CommitDate: Wed Nov 11 19:08:43 2015 +0100

    Support for powerpc64 arch ppc64el

    Signed-off-by: Thierry Fauck <email address hidden>

            Add support for ppc64le proc and ELF ABIv2.
            Provides support for irelative and wchar

The original patch leans on a jump to a "fail" label (that is declared near the beginning of the function and does the following):

  free(name);
  return PLT_FAIL;

In the 0.7.3 code, however, a different definition of the "fail" label exists. It is declared later in the function and relies on the libsym variable being initialized:

  free(name);
  free(libsym);
  return plt_fail;

Revision history for this message
Olivier Gayot (ogayot) wrote :

Hello,

Adding a .debdiff to fix the FTBFS issue on ppc64el.

Built properly on a PPA:

https://launchpad.net/~ogayot/+archive/ubuntu/ltrace/+build/23518042

Thanks,
Olivier

Changed in ltrace (Ubuntu):
status: New → Confirmed
Olivier Gayot (ogayot)
tags: added: fr-2163
Revision history for this message
Olivier Gayot (ogayot) wrote :

Agreed on reworking the patch to have less of a noise in it:

<xnox> ogayot: less noise in the update of the diff of the diff would be nice; or like a second/new patch ppc64el-2.diff
<ogayot> xnox: thanks! sure no problem. I'll try to find a way to avoid the noise with quilt refresh ; or I will edit the diff afterwards
<xnox> ogayot: maybe fiddle with settings to produce similarish type of diff.
<xnox> (context / no context / git-no-git diff etc)
<xnox> or a second new patch file.
<xnox> which is on top of the previous one.

Steve Langasek (vorlon)
tags: added: update-excuse
Revision history for this message
Olivier Gayot (ogayot) wrote :

Adding reworked debdiff.

The new debdiff does not quilt refresh-es existing patches but introduces a new patch that applies on top of the others.

I would have liked to "fix" the existing patch rather than introducing a new one. Unfortunately, this caused too many unwanted changes in the final diff. At least the debdiff is much easier to read now :)

Build on ppc64el on PPA still ok: https://launchpad.net/~ogayot/+archive/ubuntu/ltrace/+build/23530024

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ltrace - 0.7.3-6.1ubuntu6

---------------
ltrace (0.7.3-6.1ubuntu6) jammy; urgency=medium

  * Fix backport of upstream patch for ppc64el support (LP: #1967518)

 -- Olivier Gayot <email address hidden> Fri, 01 Apr 2022 12:28:12 +0200

Changed in ltrace (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.