Control: tags 914128 patch

On 2018-11-19, Niko Tyni wrote:
> Diffoscoping a perl built on a usrmerged [1] system with
> one built on a non-usrmerged system reveals the configure
> process hardcoding some paths in the build results,
>
> [1] https://wiki.debian.org/UsrMerge
>
> Snippets from config.h, Config.pm, Config_heavy.pl, config.sh.debug.gz
> and so forth include things below.
>
> The /bin vs. /usr/bin command paths can probably be fixed/worked around
> by passing the full /bin paths (which should work on both systems)
> directly to Configure. The /lib64 thing in libpth / glibpth looks like
> a bug to me. I don't know what to do about libsdirs and libsfound.
>
> There's potential breakage if perl is built on a usrmerged system but
> run on a non-usrmerged one. I suspect the breakage would not be very bad
> and that most of this is cosmetic and not widely used.

Attached are two patches which *partially* address the issues, fixing
binary paths and glibpth.


> -libpth => '/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed 
> /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib 
> /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib',
> +libpth => '/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed 
> /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib 
> /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64',

Still an issue. I tried patching Configure (and the relevent
regen-configure files) to not de-duplicate directories, but without
success. How to patch Configure sure is "fun". :)


> -lns='/bin/ln -s'
> +lns='/usr/bin/ln -s'
>
> -rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* 
> try.core*'
> +rm_try='/usr/bin/rm -f try try a.out .out try.[cho] try..o core core.try* 
> try.core*'

Fixed by attached patch, *mostly* using unspecified binary paths.
full_sed is intended to actually contain a full path, so I specified
/bin/sed explicitly (since it works on both usrmerge/non-usrmerge
systems).


> -glibpth='/usr/shlib  /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib 
> /usr/ucblib /usr/local/lib '
> +glibpth='/usr/shlib  /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib 
> /usr/ucblib /usr/local/lib /lib64 /usr/lib64 /usr/local/lib64 '

Fixed by attached patch. Debian mostly uses multiarch rather than
bi-arch, and the bi-arch directories were only added when /usr/lib64
exists anyways...


> -libsdirs=' /usr/lib/x86_64-linux-gnu'
> +libsdirs=' /lib/x86_64-linux-gnu'
...
> -libsfound=' /usr/lib/x86_64-linux-gnu/libgdbm.so 
> /usr/lib/x86_64-linux-gnu/libgdbm_compat.so 
> /usr/lib/x86_64-linux-gnu/libdb.so /usr/lib/x86_64-linux-gnu/libdl.so 
> /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libpthread.so 
> /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libcrypt.so'

No longer issues... ?


> -libspath=' /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed 
> /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib 
> /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib'
> +libspath=' /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed 
> /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib 
> /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64'

Still an issue. Probably inherited from libpth...


live well,
  vagrant
From 1a0d653ef6fdbaa136625e1251493a3d918e78f3 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Thu, 15 Jul 2021 20:20:07 +0000
Subject: [PATCH 1/2] Configure / libpth.U: Do not adjust glibpth when
 /usr/lib64 is present.

This results in differing values when built on a usrmerge system.
---
 Configure                           | 1 -
 regen-configure/U/modified/libpth.U | 1 -
 2 files changed, 2 deletions(-)

diff --git a/Configure b/Configure
index 952d09990..ade58f915 100755
--- a/Configure
+++ b/Configure
@@ -1462,7 +1462,6 @@ glibpth="/lib /usr/lib $xlibpth"
 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
 test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
-test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
 
 : Private path used by Configure to find libraries.  Its value
 : is prepended to libpth. This variable takes care of special
diff --git a/regen-configure/U/modified/libpth.U b/regen-configure/U/modified/libpth.U
index ba7126df4..d42928078 100644
--- a/regen-configure/U/modified/libpth.U
+++ b/regen-configure/U/modified/libpth.U
@@ -83,7 +83,6 @@
 ?X:	/usr/shlib is for OSF/1 systems.
 ?INIT:test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
 ?INIT:test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
-?INIT:test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
 ?INIT:
 ?INIT:: Private path used by Configure to find libraries.  Its value
 ?INIT:: is prepended to libpth. This variable takes care of special
-- 
2.32.0

From dd552f8d359e33af0f703680edab2f61a1127435 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Thu, 15 Jul 2021 20:22:21 +0000
Subject: [PATCH 2/2] debian/config.over: Set working values for full_sed,
 aphostname, lns and rm_try.

Without explicitly setting these, different (potentially incompatible)
values are embedded when built on a usrmerge system vs. a non-usrmerge
system.
---
 debian/config.over | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/debian/config.over b/debian/config.over
index d41e70fba..f793f48c8 100644
--- a/debian/config.over
+++ b/debian/config.over
@@ -146,3 +146,8 @@ if [ -n "$osdesc" ]; then
   myarchname="${machine_uname}-${osname}"
   myuname="$osname $myhostname $osvers $osdesc $machine_uname $os "
 fi
+
+full_sed='/bin/sed'
+aphostname='hostname'
+lns='ln -s'
+rm_try='rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*'
-- 
2.32.0

Attachment: signature.asc
Description: PGP signature

Reply via email to