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.


>Also, should this bug have been submitted against dpkg-cross?
The version in cross-toolchain-base and dpkg-cross pkg are some different.

On Thu, Nov 30, 2017 at 9:26 PM, YunQiang Su <wzss...@gmail.com> wrote:
> On Thu, 30 Nov 2017 21:18:29 +0800 YunQiang Su <wzss...@gmail.com> wrote:
>> On Wed, 29 Nov 2017 13:51:20 +0000 James Cowgill <jcowg...@debian.org> wrote:
>> > Hi YunQiang,
>> >
>> > On 14/11/17 03:34, YunQiang Su wrote:
>> > > Package: dpkg-cross
>> > > Version: 2.6.15-2
>> > >
>> > > the ld.so.1 of n32 and 64 should be in
>> > >     lib32  and lib64.
>> > > We should not put them in
>> > >     /usr/$(multiarch)/lib
>> > > as o32 will put its ld.so.1 their.
>> >
>> > Are you sure this is correct? At least the o32 ld.so.1 from
>> > cross-toolchain-base 19 gets installed into
>> > "/usr/mips64el-linux-gnuabi64/libo32/ld.so.1" and doesn't conflict with
>> > the n64 linker here.
>> >
>> > > --- /usr/bin/dpkg-cross 2017-07-24 15:47:10.000000000 +0000
>> > > +++ dpkg-cross  2017-11-14 03:30:13.175812265 +0000
>> > > @@ -1019,6 +1019,10 @@
>> > >                 # 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[n32,64]/ && $_ =~
>> > > m/lib\/ld.so.1$/);
>> > > +
>> > >                 # 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
>> >
>> > As Helmut noted this causes bug #882263 which broke the mips64el cross
>> > compilers. That bug is caused by not fixing up the libc.so linker script
>> > to go with this change.
>> >
>> > libc6 installs "/usr/lib/mips64el-linux-gnuabi64/libc.so" which is an
>> > ld-script and hardcodes the path "/lib/mips64el-linux-gnuabi64/ld.so.1".
>> > dpkg-cross changes this to "/usr/mips64el-linux-gnuabi64/lib/ld.so.1"
>> > which no longer exists after this patch.
>>
>> Yes, we should change it to "/usr/mips64el-linux-gnuabi64/lib64/ld.so.1"
>> instead of "/usr/mips64el-linux-gnuabi64/lib/ld.so.1".
>>
>> The patch is for Doko.
>
> Ohhh, sorry, this patch has a problem: I lost the ld.so.1 filename :(
>
>>
>> @Wooky: it seems that your version of dpkg-cross is some different with 
>> doko's.
>> I will try to figure one patch for you.
>>
>>
>> >
>> > James
>> >



-- 
YunQiang Su
--- /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,13 @@
                        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;
+                       }
                        s:(^|[^-\w/])(/usr)?/lib/$multiarch:$1$crosslib/:g;
                        unless ($multiarch) {
                                s:(^|[^-\w/])(/usr)?/lib32/:$1$crosslib32/:g;
@@ -1018,7 +1025,11 @@
 
                # 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$/);
+               
                # 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

Reply via email to