Control: tags -1 - moreinfo + patch
Hi Wookey and YunQiang,
On Thu, Nov 30, 2017 at 10:10:25PM +0800, YunQiang Su wrote:
> Wooky, this patch should work for the dpkg-cross package in repo.
>
> @James:
> >YunQiang, you still haven't told me why we need to do any of these
> >dpkg-cross changes (I'm referring to #881687 as well as this bug). What
> >exactly was the problem that lead you to submitting #881687? I can't see
> >the bug you are trying to solve.
>
> libc6_mips64el contains a file `/usr/lib/mips64el-linux-gnuabi64/ld.so.1'
> libc6-mips32_mips64el contains a file `/lib/ld.so.1'
>
> when process with dpkg-cross:
> libc6-mips64el-cross will contains /usr/mips64el-linux-gnuabi64/lib/ld.so.1,
> and
> libc6-mips32-mips64el-cross also contains
> /usr/mips64el-linux-gnuabi64/lib/ld.so.1.
>
> So my patch is to solve this file conflicts by obeying the old mips layout,
> ld.so.1 for N64 to lib64/
> ld.so.1 for N32 to lib32/
> ld.so.1 for O32 still in lib/
>
> In fact for gcc-multilib/mips64, I also put all o32 files in libo32/
> and with ld.so.1 still in lib/
> This is a tradeoff between Debian's layout and old mips layout.
>
> x86 doesn't have this problem due to it uses different ld.so file name
> for x64/x32/i386.
Thank you for his detailed explanation. I agree with the analysis. I
added the moreinfo tag to an earlier version of this patch, but my
concern has since been resolved in the updated patch. Therefore, I am
replacing the moreinfo tag with the patch tag.
I've also noticed that sparc64 is affected in the very same way as it
uses ld-linux.so.2 for both sparc (32bit) and sparc64. Therefore, I've
sent another patch for gcc-10 to add the relevant lib64 path in the -l
flag for dh_shlibdeps and I've updated your patch to also cover sparc64.
The attached patch therefore is a slight adaption of YunQiang Su's work.
Please consider applying it.
Helmut
--- /usr/bin/dpkg-cross 2017-07-24 23:47:10.000000000 +0800
+++ dpkg-cross 2017-11-30 21:55:14.612364968 +0800
@@ -631,6 +631,15 @@
return 0;
}
while (<FROM>) {
+ if ($multiarch =~ m/mips(isa)?64.*-linux.*-gnuabi64.*/) {
+ s:(^|[^-\w/])(/usr)?/lib/${multiarch}ld\.so\.1:$1$crosslib64/ld.so.1:g;
+ } elsif ($multiarch =~ m/^mips(isa)?64.*-linux.*-gnuabin32.*/) {
+ s:(^|[^-\w/])(/usr)?/lib/${multiarch}ld\.so\.1:$1$crosslibn32/ld.so.1:g;
+ } elsif ($multiarch =~ m/^mips(isa32)?.*-linux.*-gnu.*/) {
+ s:(^|[^-\w/])(/usr)?/lib/${multiarch}ld\.so\.1:$1$crosslib/ld.so.1:g;
+ } elsif ($multiarchtriplet eq "sparc64-linux-gnu") {
+ s:(^|[^-\w/])(/usr)?/lib/${multiarch}ld-linux\.so\.2:$1$crosslib64/ld-linux.so.2:g;
+ }
s:(^|[^-\w/])(/usr)?/lib/$multiarch:$1$crosslib/:g;
unless ($multiarch) {
s:(^|[^-\w/])(/usr)?/lib32/:$1$crosslib32/:g;
@@ -1018,7 +1025,12 @@
# Skip links that are going to point to themselves
next if ($lv eq $_);
-
+
+ # skip /usr/$(multiarch)/lib/ld.so.1 for mips n32 and 64.
+ # their ld.so.1 should be in lib32 and lib64.
+ next if ($multiarch =~ m/^mips(isa)?64/ && $_ =~ m:lib/ld\.so\.1$:);
+ next if ($multiarchtriplet eq "sparc64-linux-gnu" && $_ =~ m:lib/ld-linux\.so\.2$:);
+
# skip links to private modules and plugins that are not
# useful or packaged in the -cross package, basically anything
# in a directory beneath /usr/lib/. See #499292