Bug#845414: cdebconf: makes debian-installer FTBFS due to libdebconf.so issues (binutils)

2016-11-22 Thread Cyril Brulebois
Control: clone 845414 -1
Control: reassign -1 mklibs-copy 0.1.42
Control: retitle -1 mklibs-copy: add support for RUNPATH (for newer binutils)
Control: severity -1 important
Control: tags -1 patch pending
Control: block 845414 by -1

Cyril Brulebois  (2016-11-23):
> As expected, libdebconf.so didn't change too much: nm -D and objdump -x
> don't show any differences before/after. But binaries depending on it do
> change; let's look at /usr/lib/cdebconf/debconf for example (still from the
> cdebconf package):
> | (sid-amd64-devel)kibi@wodi:~/debian-installer/packages$ diff -u 
> /tmp/debconf.objdump.{ok,ko}
> | --- /tmp/debconf.objdump.ok 2016-11-23 08:09:37.715596978 +0100
> | +++ /tmp/debconf.objdump.ko 2016-11-23 08:09:42.735672870 +0100
> | @@ -29,7 +29,7 @@
> |NEEDED   libpthread.so.0
> |NEEDED   libdebconf.so
> |NEEDED   libc.so.6
> | -  RPATH/usr/lib/cdebconf
> | +  RUNPATH  /usr/lib/cdebconf
> |INIT 0x0f58
> |FINI 0x1d94
> |INIT_ARRAY   0x00202da8
> 
> Let's see if I can do something with mklibs to account for this change.

It seems it's sufficient to teach mklibs-copy that it can handle RPATH and
RUNPATH in the same way. I've successfully tested a patch that implements
this change, mixing both old and new binaries.

I've managed to build netboot and netboot-gtk images (fetching udebs from
testing to avoid the X11 transition, but pulling cdebconf udebs from sid),
and everything seems to work as intended: build time is OK, and run time
shows cdebconf starting properly (text or gtk).

I think I'll upload mklibs with that patch soon, and I'll probably close
the cdebconf bug report only when that mklibs update reaches testing. With
a little chance, the X11 transition won't last too long, and daily builds
might confirm things are looking good everywhere.

Patch attached for reference.


KiBi.
From 184905b0e534d68400834c1bc4d0d3808c5ab650 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois 
Date: Wed, 23 Nov 2016 08:25:29 +0100
Subject: [PATCH] Add support for DT_RUNPATH in addition to DT_RPATH.

Main reasons to do so include:
 - according to the elf.h header, the latter is deprecated.
 - new versions of binutils generate DT_RUNPATH entries instead of
   DT_RPATH ones, as detailed in cdebconf's #845414.
---
 debian/changelog| 10 ++
 src/mklibs-readelf/elf.cpp  |  1 +
 src/mklibs-readelf/main.cpp |  1 +
 3 files changed, 12 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index b90315d..8af9465 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+mklibs (0.1.43) UNRELEASED; urgency=medium
+
+  * Add support for DT_RUNPATH in addition to DT_RPATH. Main reasons to
+do so include:
+ - according to the elf.h header, the latter is deprecated.
+ - new versions of binutils generate DT_RUNPATH entries instead of
+   DT_RPATH ones, as detailed in cdebconf's #845414.
+
+ -- Cyril Brulebois   Wed, 23 Nov 2016 08:21:57 +0100
+
 mklibs (0.1.42) unstable; urgency=high
 
   * mklibs-readelf: Initialize section_DYNAMIC and section_DYNSYM to
diff --git a/src/mklibs-readelf/elf.cpp b/src/mklibs-readelf/elf.cpp
index b8baa9f..0e4c0f3 100644
--- a/src/mklibs-readelf/elf.cpp
+++ b/src/mklibs-readelf/elf.cpp
@@ -419,6 +419,7 @@ dynamic_data<_class, _data>::dynamic_data (Dyn *dyn) throw ()
 case DT_NEEDED:
 case DT_SONAME:
 case DT_RPATH:
+case DT_RUNPATH:
   this->is_string = true;
   break;
 default:
diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp
index 2444c39..5eace3b 100644
--- a/src/mklibs-readelf/main.cpp
+++ b/src/mklibs-readelf/main.cpp
@@ -147,6 +147,7 @@ static void process (command cmd, const char *filename)
   break;
 case COMMAND_PRINT_RPATH:
   process_dynamics (file, DT_RPATH);
+  process_dynamics (file, DT_RUNPATH);
   break;
 case COMMAND_PRINT_SONAME:
   process_dynamics (file, DT_SONAME);
-- 
2.10.2



signature.asc
Description: Digital signature


Bug#845414: cdebconf: makes debian-installer FTBFS due to libdebconf.so issues (binutils)

2016-11-22 Thread Cyril Brulebois
Cyril Brulebois  (2016-11-23):
> | mklibs-copy -L ./tmp/netboot/tree/usr/lib -L 
> ./tmp/netboot/tree/usr/lib/x86_64-linux-gnu \
> | -L ./tmp/netboot/udeblibs -v -d ./tmp/netboot/tree/lib 
> --root=./tmp/netboot/tree \
> | -L ./tmp/netboot/tree/usr/lib/cdebconf/frontend \
> | -ltext.so -lnewt.so \
> | `find ./tmp/netboot -type f -a \( -perm /0111 -o -name '*.so' -o -name 
> '*.so.*' \) | \
> |  grep -v udeblibs | grep -v 'usr/lib/xorg/modules/.*\.so'`
> | INFO: Using /lib64/ld-linux-x86-64.so.2 as dynamic linker
> | INFO: library reduction pass 1
> | File not found:libdebconf.so
> | Makefile:485: recipe for target 'stamps/tree-netboot-stamp' failed
> 
> This happened for daily builds, and is reproducible on sid devel chroots,
> on various architectures.
> 
> Based on a hunch, I investigated a few things around binutils: downgrading
> it to try a debian-installer build, with or without cdebconf udebs rebuilt
> against the said binutils. Results:
> 
> cdebconf 0.219 (rebuilt with 2.27.51.20161108-1) => debian-installer builds 
> fine, with old & new binutils.
> cdebconf 0.219 (rebuilt with 2.27.51.20161118-2) => debian-installer FTBFS, 
> with old & new binutils.
> 
> I'll try and investigate a bit more, maybe some other packages are going
> to be affected by this, but cdebconf is special considering it has
> plugins; also, binutils had commits touching the linker…

As expected, libdebconf.so didn't change too much: nm -D and objdump -x
don't show any differences before/after. But binaries depending on it do
change; let's look at /usr/lib/cdebconf/debconf for example (still from the
cdebconf package):
| (sid-amd64-devel)kibi@wodi:~/debian-installer/packages$ diff -u 
/tmp/debconf.objdump.{ok,ko}
| --- /tmp/debconf.objdump.ok   2016-11-23 08:09:37.715596978 +0100
| +++ /tmp/debconf.objdump.ko   2016-11-23 08:09:42.735672870 +0100
| @@ -29,7 +29,7 @@
|NEEDED   libpthread.so.0
|NEEDED   libdebconf.so
|NEEDED   libc.so.6
| -  RPATH/usr/lib/cdebconf
| +  RUNPATH  /usr/lib/cdebconf
|INIT 0x0f58
|FINI 0x1d94
|INIT_ARRAY   0x00202da8

Let's see if I can do something with mklibs to account for this change.


KiBi.


signature.asc
Description: Digital signature


Bug#845414: cdebconf: makes debian-installer FTBFS due to libdebconf.so issues (binutils)

2016-11-22 Thread Cyril Brulebois
Source: cdebconf
Version: 0.219
Severity: grave
Justification: renders package unusable

This update has to stay away from testing since it generates the following
issue during the build:
| # HACK ALERT: X.Org modules are excluded from the scan as mklibs
| # is unable to find symbols provided by the /usr/bin/Xorg binary
| mklibs-copy -L ./tmp/netboot/tree/usr/lib -L 
./tmp/netboot/tree/usr/lib/x86_64-linux-gnu \
|   -L ./tmp/netboot/udeblibs -v -d ./tmp/netboot/tree/lib 
--root=./tmp/netboot/tree \
|   -L ./tmp/netboot/tree/usr/lib/cdebconf/frontend \
|   -ltext.so -lnewt.so \
|   `find ./tmp/netboot -type f -a \( -perm /0111 -o -name '*.so' -o -name 
'*.so.*' \) | \
|grep -v udeblibs | grep -v 'usr/lib/xorg/modules/.*\.so'`
| INFO: Using /lib64/ld-linux-x86-64.so.2 as dynamic linker
| INFO: library reduction pass 1
| File not found:libdebconf.so
| Makefile:485: recipe for target 'stamps/tree-netboot-stamp' failed

This happened for daily builds, and is reproducible on sid devel chroots,
on various architectures.

Based on a hunch, I investigated a few things around binutils: downgrading
it to try a debian-installer build, with or without cdebconf udebs rebuilt
against the said binutils. Results:

cdebconf 0.219 (rebuilt with 2.27.51.20161108-1) => debian-installer builds 
fine, with old & new binutils.
cdebconf 0.219 (rebuilt with 2.27.51.20161118-2) => debian-installer FTBFS, 
with old & new binutils.

I'll try and investigate a bit more, maybe some other packages are going
to be affected by this, but cdebconf is special considering it has
plugins; also, binutils had commits touching the linker…


On not entirely unrelated notes:
 - cdebconf will FTBFS on buildds due to this x11-common bug: #845405
   (seen with jenkins jobs going red as noticed on IRC)
 - d-i will FTBFS for a while on x86 due to the X11 transition.


KiBi.