• Compile 32bit MIPS program on 64bit MIPS - possible?

    From Jun Sun@21:1/5 to All on Mon May 20 01:50:01 2019
    Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine. But it does not seem to work.

    Does anybody know for sure whether this is a dead end or just a hiccup
    which I should overcome?

    Thanks.

    Jun

    <div dir="ltr">Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu.  See 

    <a href="https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/">https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/</a><div><br></div><div>I tried to install multilib in the hope to
    compile 32bit mips code on this 64bit machine.  But it does not seem to work.</div><div><br></div><div>Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?</div><div><br></div><div>Thanks.</div><div><br></div><
    Jun</div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Mon May 20 03:00:01 2019
    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine. But it does not seem to work.



    Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?

    Thanks.

    Jun



    --
    YunQiang Su

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jun Sun@21:1/5 to wzssyqa@gmail.com on Mon May 20 06:20:01 2019
    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but
    -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would do
    "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who created
    64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on
    this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup
    which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su


    <div dir="ltr"><div dir="ltr"><div dir="ltr">This is very cool!  It worked!  Thanks.<div><br></div><div>For a complete record here is what I did:</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,
    204,204);padding-left:1ex"><span style="background-color:rgb(245,246,247);color:black;font-size:13px">dpkg --add-architecture mipsel</span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);
    padding-left:1ex">apt-get update </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">apt-get install gcc-multilib<br></blockquote><blockquote class="gmail_quote" style="
    margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> </blockquote><div><br></div><div>Earlier I was using &quot;-m32&quot; option which was not recognized. but  -march=mips32 -mabi=32 worked just fine.</div><div><br></div><
    Also, just for the record, if one likes to install 32bit library later, you would just add &quot;:mipsel&quot; to the package name.  For example, you would do &quot;apt install zlib1g:mipsel&quot; to install 32bit version of zlib.</div><div><br></
    <div>Cheers.</div><div><br></div><div>Jun</div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 19, 2019 at 5:55 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com">wzssyqa@gmail.com</
    &gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年5月20日周一
    上午7:42写道:<br>
    &gt;<br>
    &gt; Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu.  See  <a href="https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/" rel="noreferrer" target="_blank">
    https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/</a><br>
    &gt;<br>
    &gt; I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine.  But it does not seem to work.<br>
    &gt;<br>
    how did you install it?<br>
    it should be done like:<br>

    apt-get install libc6-dev-mips32 gcc<br>
       and<br>
    gcc -march=mips32 -mabi=32 xx.c<br>

    If your app needs libc only, it is enough.<br>

    &gt; Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?<br>

    If your app depends on more libraries, you may need to use an mipsel<br>
    env, or use multiarch.<br>
    <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>

    &gt;<br>
    &gt; Thanks.<br>
    &gt;<br>
    &gt; Jun<br>



    -- <br>
    YunQiang Su<br>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jun Sun@21:1/5 to jsun@junsun.net on Sat Dec 28 22:50:01 2019
    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment
    apt install -y crossbuild-essential-armhf # this install 32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    However, similar steps don't work on mips64. Specifically it is apparent crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment than
    what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but
    -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later,
    you would just add ":mipsel" to the package name. For example, you would
    do "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who created
    64bit MIPSEL debian image that runs on qemu. See
    https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on
    this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup
    which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    <div dir="ltr">re-surfacing my own old thread ...<div><br></div><div>On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:</div><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:
    0px"><div>apt install -y build-essential    # this install 64bit dev environment<br></div><div>apt install -y crossbuild-essential-armhf   # this install 32bit cross-dev environment<br></div><div>apt install -y libc6:armhf<br></div><div>apt install -
    y libstdc++6:armhf<br></div><div><br></div></blockquote>However, similar steps don&#39;t work on mips64.  Specifically it is apparent 

    crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential. </div><div><br></div><div>Are there more better way to install a complete 32bit dev environment than what is
    mentioned earlier in this thread?</div><div><br></div><div>Thanks!</div><div><br></div><div>Jun<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div></blockquote></div></div><br><div class="gmail_quote"><div dir="ltr" class="
    gmail_attr">On Sun, May 19, 2019 at 9:10 PM Jun Sun &lt;<a href="mailto:jsun@junsun.net">jsun@junsun.net</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div
    dir="ltr"><div dir="ltr"><div dir="ltr">This is very cool!  It worked!  Thanks.<div><br></div><div>For a complete record here is what I did:</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)
    ;padding-left:1ex"><span style="background-color:rgb(245,246,247);color:black;font-size:13px">dpkg --add-architecture mipsel</span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-
    left:1ex">apt-get update </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">apt-get install gcc-multilib<br></blockquote><blockquote class="gmail_quote" style="margin:0px
    0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> </blockquote><div><br></div><div>Earlier I was using &quot;-m32&quot; option which was not recognized. but  -march=mips32 -mabi=32 worked just fine.</div><div><br></div><div>Also,
    just for the record, if one likes to install 32bit library later, you would just add &quot;:mipsel&quot; to the package name.  For example, you would do &quot;apt install zlib1g:mipsel&quot; to install 32bit version of zlib.</div><div><br></div><div>
    Cheers.</div><div><br></div><div>Jun</div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 19, 2019 at 5:55 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@
    gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年5月
    20日周一 上午7:42写道:<br>
    &gt;<br>
    &gt; Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu.  See  <a href="https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/" rel="noreferrer" target="_blank">
    https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/</a><br>
    &gt;<br>
    &gt; I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine.  But it does not seem to work.<br>
    &gt;<br>
    how did you install it?<br>
    it should be done like:<br>

    apt-get install libc6-dev-mips32 gcc<br>
       and<br>
    gcc -march=mips32 -mabi=32 xx.c<br>

    If your app needs libc only, it is enough.<br>

    &gt; Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?<br>

    If your app depends on more libraries, you may need to use an mipsel<br>
    env, or use multiarch.<br>
    <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>

    &gt;<br>
    &gt; Thanks.<br>
    &gt;<br>
    &gt; Jun<br>



    -- <br>
    YunQiang Su<br>
    </blockquote></div>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Sun Dec 29 01:20:01 2019
    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道:

    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment
    apt install -y crossbuild-essential-armhf # this install 32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf && gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not
    needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it is apparent crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jun Sun@21:1/5 to wzssyqa@gmail.com on Sun Dec 29 02:50:02 2019
    installing g++-mipsel-linux-gnu gives an error below. Any suggestions?
    Also, what is the recommended way to set up full 32bit dev environment on
    64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is referred to by
    another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation candidate



    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道:

    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete
    32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment
    apt install -y crossbuild-essential-armhf # this install 32bit
    cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf && gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not
    needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it is
    apparent crossbuild-essential-mipsel dependency is broken, and if you try
    to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment
    than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would
    do "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道: >>> >
    Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code
    on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a
    hiccup which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su


    <div dir="ltr">installing g++-mipsel-linux-gnu gives an error below.  Any suggestions?  Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?<div><br></div><div>Jun</div><div><br></div><div>
    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu<br>Reading package lists... Done<br>Building dependency tree       <br>Reading state information... Done<br>Package g++-mipsel-linux-gnu is not available, but is referred to by another
    package.<br>This may mean that the package is missing, has been obsoleted, or<br>is only available from another source<br><br>E: Package &#39;g++-mipsel-linux-gnu&#39; has no installation candidate<br></div><div><br></div><div><br></div></div><br><div
    class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com">wzssyqa@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:
    1px solid rgb(204,204,204);padding-left:1ex">Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 上午5:43写道:<br>
    &gt;<br>
    &gt; re-surfacing my own old thread ...<br>
    &gt;<br>
    &gt; On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:<br>
    &gt;<br>
    &gt; apt install -y build-essential    # this install 64bit dev environment<br>
    &gt; apt install -y crossbuild-essential-armhf   # this install 32bit cross-dev environment<br>
    &gt; apt install -y libc6:armhf<br>
    &gt; apt install -y libstdc++6:armhf<br>

    yep. we don&#39;t have the crossbuild-essential-mipsel package.<br>
    While for normal user, it is not useful at all.<br>

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &amp;&amp;<br> gcc-arm-linux-gnueabihf<br>

    So, you can do the same thing just by<br>
       apt install g++-mipsel-linux-gnu   # gcc-mipsel-linux-gnu is not<br> needed, since g++ depeds on gcc.<br>

    &gt;<br>
    &gt; However, similar steps don&#39;t work on mips64.  Specifically it is apparent  crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.<br>
    &gt;<br>
    &gt; Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?<br>
    &gt;<br>
    &gt; Thanks!<br>
    &gt;<br>
    &gt; Jun<br>
    &gt;<br>
    &gt;<br>
    &gt;<br>
    &gt; On Sun, May 19, 2019 at 9:10 PM Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; wrote:<br>
    &gt;&gt;<br>
    &gt;&gt; This is very cool!  It worked!  Thanks.<br>
    &gt;&gt;<br>
    &gt;&gt; For a complete record here is what I did:<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; dpkg --add-architecture mipsel<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; apt-get update<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; apt-get install gcc-multilib<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt; Earlier I was using &quot;-m32&quot; option which was not recognized. but  -march=mips32 -mabi=32 worked just fine.<br>
    &gt;&gt;<br>
    &gt;&gt; Also, just for the record, if one likes to install 32bit library later, you would just add &quot;:mipsel&quot; to the package name.  For example, you would do &quot;apt install zlib1g:mipsel&quot; to install 32bit version of zlib.<br>
    &gt;&gt;<br>
    &gt;&gt; Cheers.<br>
    &gt;&gt;<br>
    &gt;&gt; Jun<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt; On Sun, May 19, 2019 at 5:55 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年5月20日周一 上午7:42写道:<br>
    &gt;&gt;&gt; &gt;<br>
    &gt;&gt;&gt; &gt; Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu.  See  <a href="https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/" rel="noreferrer"
    target="_blank">https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/</a><br>
    &gt;&gt;&gt; &gt;<br>
    &gt;&gt;&gt; &gt; I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine.  But it does not seem to work.<br>
    &gt;&gt;&gt; &gt;<br>
    &gt;&gt;&gt; how did you install it?<br>
    &gt;&gt;&gt; it should be done like:<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; apt-get install libc6-dev-mips32 gcc<br>
    &gt;&gt;&gt;    and<br>
    &gt;&gt;&gt; gcc -march=mips32 -mabi=32 xx.c<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; If your app needs libc only, it is enough.<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; &gt; Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; If your app depends on more libraries, you may need to use an mipsel<br>
    &gt;&gt;&gt; env, or use multiarch.<br>
    &gt;&gt;&gt; <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; &gt;<br>
    &gt;&gt;&gt; &gt; Thanks.<br>
    &gt;&gt;&gt; &gt;<br>
    &gt;&gt;&gt; &gt; Jun<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt;<br>
    &gt;&gt;&gt; --<br>
    &gt;&gt;&gt; YunQiang Su<br>



    -- <br>
    YunQiang Su<br>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Sun Dec 29 06:30:01 2019
    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午9:43写道:

    installing g++-mipsel-linux-gnu gives an error below. Any suggestions? Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation candidate

    Ohh, sorry. you are on a mips64el system...
    We don't have that compiler, while you can just
    apt install libc6-dev-mips32
    gcc -mabi=32




    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道:

    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment
    apt install -y crossbuild-essential-armhf # this install 32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &&
    gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not
    needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it is apparent crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道: >> >>> >
    Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jun Sun@21:1/5 to wzssyqa@gmail.com on Sun Dec 29 08:40:02 2019
    Thanks for the info, YunQiang.

    For simple compiling, I can see "gcc -mabl=32" working well. If we want to
    port complex project and build in 32 bit, we would need to supply CC, AS,
    LD, AR, CXX, etc. Do we just use all the 64bit versions with "-mabi=32"?
    For compiling C++ code, what additional package should we install?

    Cheers.

    Jun




    On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午9:43写道:

    installing g++-mipsel-linux-gnu gives an error below. Any suggestions?
    Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is referred to by
    another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation candidate

    Ohh, sorry. you are on a mips64el system...
    We don't have that compiler, while you can just
    apt install libc6-dev-mips32
    gcc -mabi=32




    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道: >> >
    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment >> > apt install -y crossbuild-essential-armhf # this install 32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &&
    gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not
    needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it is apparent crossbuild-essential-mipsel dependency is broken, and if you try
    to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library
    later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com>
    wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who
    created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips
    code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel >> >>> env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su


    <div dir="ltr">Thanks for the info, YunQiang.<div><br></div><div>For simple compiling, I can see &quot;gcc -mabl=32&quot; working well. If we want to port complex project and build in 32 bit, we would need to supply CC, AS, LD, AR, CXX, etc.  Do we just
    use all the 64bit versions with &quot;-mabi=32&quot;?  For compiling C++ code, what additional package should we install?</div><div><br></div><div>Cheers.</div><div><br></div><div>Jun</div><div><br></div><div>  </div><div><br></div></div><br><div
    class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com">wzssyqa@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:
    1px solid rgb(204,204,204);padding-left:1ex">Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 上午9:43写道:<br>
    &gt;<br>
    &gt; installing g++-mipsel-linux-gnu gives an error below.  Any suggestions?  Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?<br>
    &gt;<br>
    &gt; Jun<br>
    &gt;<br>
    &gt; root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu<br>
    &gt; Reading package lists... Done<br>
    &gt; Building dependency tree<br>
    &gt; Reading state information... Done<br>
    &gt; Package g++-mipsel-linux-gnu is not available, but is referred to by another package.<br>
    &gt; This may mean that the package is missing, has been obsoleted, or<br>
    &gt; is only available from another source<br>
    &gt;<br>
    &gt; E: Package &#39;g++-mipsel-linux-gnu&#39; has no installation candidate<br>

    Ohh, sorry. you are on a mips64el system...<br>
    We don&#39;t have that compiler, while you can just<br>
        apt install libc6-dev-mips32<br>
        gcc -mabi=32<br>

    &gt;<br>
    &gt;<br>
    &gt;<br>
    &gt; On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt;<br>
    &gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 上午5:43写道:<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; re-surfacing my own old thread ...<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; apt install -y build-essential    # this install 64bit dev environment<br>
    &gt;&gt; &gt; apt install -y crossbuild-essential-armhf   # this install 32bit cross-dev environment<br>
    &gt;&gt; &gt; apt install -y libc6:armhf<br>
    &gt;&gt; &gt; apt install -y libstdc++6:armhf<br>
    &gt;&gt;<br>
    &gt;&gt; yep. we don&#39;t have the crossbuild-essential-mipsel package.<br> &gt;&gt; While for normal user, it is not useful at all.<br>
    &gt;&gt;<br>
    &gt;&gt; crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &amp;&amp;<br>
    &gt;&gt; gcc-arm-linux-gnueabihf<br>
    &gt;&gt;<br>
    &gt;&gt; So, you can do the same thing just by<br>
    &gt;&gt;    apt install g++-mipsel-linux-gnu   # gcc-mipsel-linux-gnu is not<br>
    &gt;&gt; needed, since g++ depeds on gcc.<br>
    &gt;&gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; However, similar steps don&#39;t work on mips64.  Specifically it is apparent  crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Thanks!<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Jun<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; On Sun, May 19, 2019 at 9:10 PM Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; wrote:<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; This is very cool!  It worked!  Thanks.<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; For a complete record here is what I did:<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; dpkg --add-architecture mipsel<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; apt-get update<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; apt-get install gcc-multilib<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; Earlier I was using &quot;-m32&quot; option which was not recognized. but  -march=mips32 -mabi=32 worked just fine.<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; Also, just for the record, if one likes to install 32bit library later, you would just add &quot;:mipsel&quot; to the package name.  For example, you would do &quot;apt install zlib1g:mipsel&quot; to install 32bit version of zlib.<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; Cheers.<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; Jun<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; On Sun, May 19, 2019 at 5:55 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年5月20日周一 上午7:42写道:<br>
    &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt;&gt; &gt; Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu.  See  <a href="https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/" rel="
    noreferrer" target="_blank">https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/</a><br>
    &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt;&gt; &gt; I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine.  But it does not seem to work.<br>
    &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt;&gt; how did you install it?<br>
    &gt;&gt; &gt;&gt;&gt; it should be done like:<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; apt-get install libc6-dev-mips32 gcc<br>
    &gt;&gt; &gt;&gt;&gt;    and<br>
    &gt;&gt; &gt;&gt;&gt; gcc -march=mips32 -mabi=32 xx.c<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; If your app needs libc only, it is enough.<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; &gt; Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; If your app depends on more libraries, you may need to use an mipsel<br>
    &gt;&gt; &gt;&gt;&gt; env, or use multiarch.<br>
    &gt;&gt; &gt;&gt;&gt; <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt;&gt; &gt; Thanks.<br>
    &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt;&gt; &gt; Jun<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt;&gt; --<br>
    &gt;&gt; &gt;&gt;&gt; YunQiang Su<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt; --<br>
    &gt;&gt; YunQiang Su<br>



    -- <br>
    YunQiang Su<br>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Sun Dec 29 14:10:02 2019
    YunQiang Su <wzssyqa@gmail.com> 于2019年12月29日周日 下午8:43写道:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 下午3:33写道:

    Thanks for the info, YunQiang.

    For simple compiling, I can see "gcc -mabl=32" working well. If we want to port complex project and build in 32 bit, we would need to supply CC, AS, LD, AR, CXX, etc. Do we just use all the 64bit versions with "-mabi=32"? For compiling C++ code,
    what additional package should we install?


    If only stdc++ is needed, install g++-multlib is enough.

    If you need more libraries like boost etc, the best choice for you is
    to use mipsel port:

    sudo apt install debootstrap systemd-container
    sudo debootstrap sid sid-mipsel http://ftp.cn.debian.org/debian # I
    suppose you are in China.
    sudo systemd-nspawn -D sid-mipsel

    Or you can have a try of lxc.


    there is another way is that maybe you can have a try multiarch:
    https://wiki.debian.org/Multiarch/HOWTO

    Cheers.

    Jun




    On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午9:43写道: >> >
    installing g++-mipsel-linux-gnu gives an error below. Any suggestions? Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation candidate

    Ohh, sorry. you are on a mips64el system...
    We don't have that compiler, while you can just
    apt install libc6-dev-mips32
    gcc -mabi=32




    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <wzssyqa@gmail.com> wrote: >> >>
    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道:

    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment
    apt install -y crossbuild-essential-armhf # this install 32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &&
    gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not
    needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it is apparent crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Sun Dec 29 13:50:01 2019
    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 下午3:33写道:

    Thanks for the info, YunQiang.

    For simple compiling, I can see "gcc -mabl=32" working well. If we want to port complex project and build in 32 bit, we would need to supply CC, AS, LD, AR, CXX, etc. Do we just use all the 64bit versions with "-mabi=32"? For compiling C++ code, what
    additional package should we install?


    If only stdc++ is needed, install g++-multlib is enough.

    If you need more libraries like boost etc, the best choice for you is
    to use mipsel port:

    sudo apt install debootstrap systemd-container
    sudo debootstrap sid sid-mipsel http://ftp.cn.debian.org/debian # I
    suppose you are in China.
    sudo systemd-nspawn -D sid-mipsel

    Or you can have a try of lxc.

    Cheers.

    Jun




    On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午9:43写道:

    installing g++-mipsel-linux-gnu gives an error below. Any suggestions? Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation candidate

    Ohh, sorry. you are on a mips64el system...
    We don't have that compiler, while you can just
    apt install libc6-dev-mips32
    gcc -mabi=32




    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道: >> >> >
    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment >> >> > apt install -y crossbuild-essential-armhf # this install 32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &&
    gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not
    needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it is apparent crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com> wrote: >> >> >>>
    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel >> >> >>> env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jun Sun@21:1/5 to wzssyqa@gmail.com on Sun Dec 29 23:10:04 2019
    Multiarch is the first thing I tried. It generally works in terms of
    adding foreign architecture, finding/install packages with proper
    dependencies, runtime support, linkers and etc. The only thing seemingly broken is the crossbuild-essential-mipsel, (or build-essential:mipsel, I think), which is needed to develop 32bit in this multiarch environment.
    See my earlier email on this.

    I think multiarch is the future for debian. We should get it working on
    64bit MIPS. It does not seem too far to fix it. From surface, the
    crossbuild has some unnecessary conflict with native build essential
    package. Maybe removing those should be fine?

    Cheers.

    Jun


    On Sun, Dec 29, 2019 at 4:59 AM YunQiang Su <wzssyqa@gmail.com> wrote:

    YunQiang Su <wzssyqa@gmail.com> 于2019年12月29日周日 下午8:43写道:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 下午3:33写道:

    Thanks for the info, YunQiang.

    For simple compiling, I can see "gcc -mabl=32" working well. If we
    want to port complex project and build in 32 bit, we would need to supply
    CC, AS, LD, AR, CXX, etc. Do we just use all the 64bit versions with "-mabi=32"? For compiling C++ code, what additional package should we install?


    If only stdc++ is needed, install g++-multlib is enough.

    If you need more libraries like boost etc, the best choice for you is
    to use mipsel port:

    sudo apt install debootstrap systemd-container
    sudo debootstrap sid sid-mipsel http://ftp.cn.debian.org/debian # I suppose you are in China.
    sudo systemd-nspawn -D sid-mipsel

    Or you can have a try of lxc.


    there is another way is that maybe you can have a try multiarch:
    https://wiki.debian.org/Multiarch/HOWTO

    Cheers.

    Jun




    On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午9:43写道: >> >
    installing g++-mipsel-linux-gnu gives an error below. Any
    suggestions? Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is referred to
    by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation candidate

    Ohh, sorry. you are on a mips64el system...
    We don't have that compiler, while you can just
    apt install libc6-dev-mips32
    gcc -mabi=32




    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <wzssyqa@gmail.com>
    wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道:

    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain
    complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev
    environment
    apt install -y crossbuild-essential-armhf # this install 32bit
    cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &&
    gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not >> >> needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it is
    apparent crossbuild-essential-mipsel dependency is broken, and if you try
    to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev
    environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized.
    but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit
    library later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version
    of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com>
    wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who
    created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit
    mips code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or
    just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to use an
    mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su


    <div dir="ltr">Multiarch is the first thing I tried.  It generally works in terms of adding foreign architecture, finding/install packages with proper dependencies, runtime support, linkers and etc.  The only thing seemingly broken is the crossbuild-
    essential-mipsel, (or build-essential:mipsel, I think), which is needed to develop 32bit in this multiarch environment.  See my earlier email on this.<div><br></div><div>I think multiarch is the future for debian.  We should get it working on 64bit
    MIPS.  It does not seem too far to fix it.  From surface, the crossbuild has some unnecessary conflict with native build essential package.  Maybe removing those should be fine?</div><div><br></div><div>Cheers.</div><div><br></div><div>Jun</div><div><
    </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 29, 2019 at 4:59 AM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com">wzssyqa@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px
    0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; 于2019年12月29日周日 下午8:43写道:<br>
    &gt;<br>
    &gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 下午3:33写道:<br>
    &gt; &gt;<br>
    &gt; &gt; Thanks for the info, YunQiang.<br>
    &gt; &gt;<br>
    &gt; &gt; For simple compiling, I can see &quot;gcc -mabl=32&quot; working well. If we want to port complex project and build in 32 bit, we would need to supply CC, AS, LD, AR, CXX, etc.  Do we just use all the 64bit versions with &quot;-mabi=32&quot;? 
    For compiling C++ code, what additional package should we install?<br>
    &gt; &gt;<br>
    &gt;<br>
    &gt; If only stdc++ is needed, install g++-multlib is enough.<br>
    &gt;<br>
    &gt; If you need more libraries like boost etc, the best choice for you is<br> &gt; to use mipsel port:<br>
    &gt;<br>
    &gt; sudo apt install debootstrap systemd-container<br>
    &gt; sudo debootstrap sid sid-mipsel <a href="http://ftp.cn.debian.org/debian" rel="noreferrer" target="_blank">http://ftp.cn.debian.org/debian</a>  # I<br>
    &gt; suppose you are in China.<br>
    &gt; sudo systemd-nspawn -D sid-mipsel<br>
    &gt;<br>
    &gt; Or you can have a try of lxc.<br>
    &gt;<br>

    there is another way is that maybe you can have a try multiarch:<br>
       <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>

    &gt; &gt; Cheers.<br>
    &gt; &gt;<br>
    &gt; &gt; Jun<br>
    &gt; &gt;<br>
    &gt; &gt;<br>
    &gt; &gt;<br>
    &gt; &gt;<br>
    &gt; &gt; On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt; &gt;&gt;<br>
    &gt; &gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 上午9:43写道:<br>
    &gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt; installing g++-mipsel-linux-gnu gives an error below.  Any suggestions?  Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?<br>
    &gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt; Jun<br>
    &gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt; root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu<br>
    &gt; &gt;&gt; &gt; Reading package lists... Done<br>
    &gt; &gt;&gt; &gt; Building dependency tree<br>
    &gt; &gt;&gt; &gt; Reading state information... Done<br>
    &gt; &gt;&gt; &gt; Package g++-mipsel-linux-gnu is not available, but is referred to by another package.<br>
    &gt; &gt;&gt; &gt; This may mean that the package is missing, has been obsoleted, or<br>
    &gt; &gt;&gt; &gt; is only available from another source<br>
    &gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt; E: Package &#39;g++-mipsel-linux-gnu&#39; has no installation candidate<br>
    &gt; &gt;&gt;<br>
    &gt; &gt;&gt; Ohh, sorry. you are on a mips64el system...<br>
    &gt; &gt;&gt; We don&#39;t have that compiler, while you can just<br>
    &gt; &gt;&gt;     apt install libc6-dev-mips32<br>
    &gt; &gt;&gt;     gcc -mabi=32<br>
    &gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt; On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 上午5:43写道:<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt; re-surfacing my own old thread ...<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt; On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt; apt install -y build-essential    # this install 64bit dev environment<br>
    &gt; &gt;&gt; &gt;&gt; &gt; apt install -y crossbuild-essential-armhf   # this install 32bit cross-dev environment<br>
    &gt; &gt;&gt; &gt;&gt; &gt; apt install -y libc6:armhf<br>
    &gt; &gt;&gt; &gt;&gt; &gt; apt install -y libstdc++6:armhf<br>
    &gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; yep. we don&#39;t have the crossbuild-essential-mipsel package.<br>
    &gt; &gt;&gt; &gt;&gt; While for normal user, it is not useful at all.<br>
    &gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &amp;&amp;<br>
    &gt; &gt;&gt; &gt;&gt; gcc-arm-linux-gnueabihf<br>
    &gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; So, you can do the same thing just by<br>
    &gt; &gt;&gt; &gt;&gt;    apt install g++-mipsel-linux-gnu   # gcc-mipsel-linux-gnu is not<br>
    &gt; &gt;&gt; &gt;&gt; needed, since g++ depeds on gcc.<br>
    &gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt; However, similar steps don&#39;t work on mips64.  Specifically it is apparent  crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt; Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt; Thanks!<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt; Jun<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt; On Sun, May 19, 2019 at 9:10 PM Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; wrote:<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt; This is very cool!  It worked!  Thanks.<br> &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt; For a complete record here is what I did:<br> &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; dpkg --add-architecture mipsel<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; apt-get update<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; apt-get install gcc-multilib<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt; Earlier I was using &quot;-m32&quot; option which was not recognized. but  -march=mips32 -mabi=32 worked just fine.<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt; Also, just for the record, if one likes to install 32bit library later, you would just add &quot;:mipsel&quot; to the package name.  For example, you would do &quot;apt install zlib1g:mipsel&quot; to install 32bit version
    of zlib.<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt; Cheers.<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt; Jun<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt; On Sun, May 19, 2019 at 5:55 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年5月20日周一 上午7:42写道:<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu.  See  <a href="https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-
    mipsel/" rel="noreferrer" target="_blank">https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/</a><br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine.  But it does not seem to work.<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; how did you install it?<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; it should be done like:<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; apt-get install libc6-dev-mips32 gcc<br> &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;    and<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; gcc -march=mips32 -mabi=32 xx.c<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; If your app needs libc only, it is enough.<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; If your app depends on more libraries, you may need to use an mipsel<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; env, or use multiarch.<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Thanks.<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Jun<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; --<br>
    &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; YunQiang Su<br>
    &gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt;<br>
    &gt; &gt;&gt; &gt;&gt; --<br>
    &gt; &gt;&gt; &gt;&gt; YunQiang Su<br>
    &gt; &gt;&gt;<br>
    &gt; &gt;&gt;<br>
    &gt; &gt;&gt;<br>
    &gt; &gt;&gt; --<br>
    &gt; &gt;&gt; YunQiang Su<br>
    &gt;<br>
    &gt;<br>
    &gt;<br>
    &gt; --<br>
    &gt; YunQiang Su<br>



    -- <br>
    YunQiang Su<br>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Mon Dec 30 02:10:01 2019
    Jun Sun <jsun@junsun.net> 于2019年12月30日周一 上午6:01写道:

    Multiarch is the first thing I tried. It generally works in terms of adding foreign architecture, finding/install packages with proper dependencies, runtime support, linkers and etc. The only thing seemingly broken is the crossbuild-essential-mipsel,
    (or build-essential:mipsel, I think), which is needed to develop 32bit in this multiarch environment. See my earlier email on this.


    Sorry. My stack is toooo shallow.
    build-essential make no sense for normal user at all.
    It is used to make sbuild/pbuilder happier.
    In fact you should not install crossbuild-essential-* manually at all.


    I think multiarch is the future for debian. We should get it working on 64bit MIPS. It does not seem too far to fix it. From surface, the crossbuild has some unnecessary conflict with native build essential package. Maybe removing those should be
    fine?

    In fact it is too hard to fix.
    For a suggestion, the normal user should choose only on from mutlilib
    and multiarch.

    For example, if you want to use multiarch, you'd have to purge
    multilib packages.


    Cheers.

    Jun


    On Sun, Dec 29, 2019 at 4:59 AM YunQiang Su <wzssyqa@gmail.com> wrote:

    YunQiang Su <wzssyqa@gmail.com> 于2019年12月29日周日 下午8:43写道:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 下午3:33写道: >> > >
    Thanks for the info, YunQiang.

    For simple compiling, I can see "gcc -mabl=32" working well. If we want to port complex project and build in 32 bit, we would need to supply CC, AS, LD, AR, CXX, etc. Do we just use all the 64bit versions with "-mabi=32"? For compiling C++ code,
    what additional package should we install?


    If only stdc++ is needed, install g++-multlib is enough.

    If you need more libraries like boost etc, the best choice for you is
    to use mipsel port:

    sudo apt install debootstrap systemd-container
    sudo debootstrap sid sid-mipsel http://ftp.cn.debian.org/debian # I
    suppose you are in China.
    sudo systemd-nspawn -D sid-mipsel

    Or you can have a try of lxc.


    there is another way is that maybe you can have a try multiarch:
    https://wiki.debian.org/Multiarch/HOWTO

    Cheers.

    Jun




    On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su <wzssyqa@gmail.com> wrote: >> > >>
    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午9:43写道:

    installing g++-mipsel-linux-gnu gives an error below. Any suggestions? Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation candidate

    Ohh, sorry. you are on a mips64el system...
    We don't have that compiler, while you can just
    apt install libc6-dev-mips32
    gcc -mabi=32




    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道:

    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment
    apt install -y crossbuild-essential-armhf # this install 32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &&
    gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not >> > >> >> needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it is apparent crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote: >> > >> >> >>
    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Mon Dec 30 05:50:01 2019
    Jun Sun <jsun@junsun.net> 于2019年12月30日周一 下午12:31写道:

    I might be out of touch. Who are considered "normal users" for MIPS today? I always thought for a long time MIPS users are pretty much just developers, which means they would need build-essentials. Having crossbuild is just a convenient way to
    enable development for both 32bit and 64bit on 64bit machine, because I thought, which could be wrong, 32bit crossbuild are simply the same as 32bit native build tools (as in the case of ARM and x86, I presume).


    "normal users" here means people not work on Debian itself.
    Normal for Debian not MIPS here.

    in fact build-essentials package is for some people like some people
    who are maintaining the sbuild/chroot etc for Debian its self.

    Sure, cross-build is very useful for normal user (read it as: upstream developers, or downstream hardware/software vendors).
    So, you are wanting the
    `mipsel-linux-gnu-gcc`
    command on a mips64el env, instead of to use
    `mips64el-linux-gnuabi64-gcc -mabi=32`
    ?

    If you, yes, we don't provides it with src:gcc-9-cross-mipsen, since I
    proposed that it is not so useful.
    If it is really needed. I will add it.

    In any case, multilib works as expected so far. Thanks for your help. I will move on down the path of multilib for now.

    Cheers.

    Jun


    On Sun, Dec 29, 2019 at 5:02 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月30日周一 上午6:01写道:

    Multiarch is the first thing I tried. It generally works in terms of adding foreign architecture, finding/install packages with proper dependencies, runtime support, linkers and etc. The only thing seemingly broken is the crossbuild-essential-
    mipsel, (or build-essential:mipsel, I think), which is needed to develop 32bit in this multiarch environment. See my earlier email on this.


    Sorry. My stack is toooo shallow.
    build-essential make no sense for normal user at all.
    It is used to make sbuild/pbuilder happier.
    In fact you should not install crossbuild-essential-* manually at all.


    I think multiarch is the future for debian. We should get it working on 64bit MIPS. It does not seem too far to fix it. From surface, the crossbuild has some unnecessary conflict with native build essential package. Maybe removing those should
    be fine?

    In fact it is too hard to fix.
    For a suggestion, the normal user should choose only on from mutlilib
    and multiarch.

    For example, if you want to use multiarch, you'd have to purge
    multilib packages.


    Cheers.

    Jun


    On Sun, Dec 29, 2019 at 4:59 AM YunQiang Su <wzssyqa@gmail.com> wrote:

    YunQiang Su <wzssyqa@gmail.com> 于2019年12月29日周日 下午8:43写道:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 下午3:33写道:

    Thanks for the info, YunQiang.

    For simple compiling, I can see "gcc -mabl=32" working well. If we want to port complex project and build in 32 bit, we would need to supply CC, AS, LD, AR, CXX, etc. Do we just use all the 64bit versions with "-mabi=32"? For compiling C++
    code, what additional package should we install?


    If only stdc++ is needed, install g++-multlib is enough.

    If you need more libraries like boost etc, the best choice for you is >> >> > to use mipsel port:

    sudo apt install debootstrap systemd-container
    sudo debootstrap sid sid-mipsel http://ftp.cn.debian.org/debian # I
    suppose you are in China.
    sudo systemd-nspawn -D sid-mipsel

    Or you can have a try of lxc.


    there is another way is that maybe you can have a try multiarch:
    https://wiki.debian.org/Multiarch/HOWTO

    Cheers.

    Jun




    On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午9:43写道:

    installing g++-mipsel-linux-gnu gives an error below. Any suggestions? Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or >> >> > >> > is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation candidate

    Ohh, sorry. you are on a mips64el system...
    We don't have that compiler, while you can just
    apt install libc6-dev-mips32
    gcc -mabi=32




    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道:

    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment
    apt install -y crossbuild-essential-armhf # this install 32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf && >> >> > >> >> gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not
    needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it is apparent crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized. but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to use an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jun Sun@21:1/5 to wzssyqa@gmail.com on Mon Dec 30 05:40:01 2019
    I might be out of touch. Who are considered "normal users" for MIPS
    today? I always thought for a long time MIPS users are pretty much just developers, which means they would need build-essentials. Having
    crossbuild is just a convenient way to enable development for both 32bit
    and 64bit on 64bit machine, because I thought, which could be wrong, 32bit crossbuild are simply the same as 32bit native build tools (as in the case
    of ARM and x86, I presume).

    In any case, multilib works as expected so far. Thanks for your help. I
    will move on down the path of multilib for now.

    Cheers.

    Jun


    On Sun, Dec 29, 2019 at 5:02 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月30日周一 上午6:01写道:

    Multiarch is the first thing I tried. It generally works in terms of
    adding foreign architecture, finding/install packages with proper dependencies, runtime support, linkers and etc. The only thing seemingly broken is the crossbuild-essential-mipsel, (or build-essential:mipsel, I think), which is needed to develop 32bit in this multiarch environment.
    See my earlier email on this.


    Sorry. My stack is toooo shallow.
    build-essential make no sense for normal user at all.
    It is used to make sbuild/pbuilder happier.
    In fact you should not install crossbuild-essential-* manually at all.


    I think multiarch is the future for debian. We should get it working on
    64bit MIPS. It does not seem too far to fix it. From surface, the crossbuild has some unnecessary conflict with native build essential
    package. Maybe removing those should be fine?

    In fact it is too hard to fix.
    For a suggestion, the normal user should choose only on from mutlilib
    and multiarch.

    For example, if you want to use multiarch, you'd have to purge
    multilib packages.


    Cheers.

    Jun


    On Sun, Dec 29, 2019 at 4:59 AM YunQiang Su <wzssyqa@gmail.com> wrote:

    YunQiang Su <wzssyqa@gmail.com> 于2019年12月29日周日 下午8:43写道:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 下午3:33写道: >> > >
    Thanks for the info, YunQiang.

    For simple compiling, I can see "gcc -mabl=32" working well. If we want to port complex project and build in 32 bit, we would need to supply
    CC, AS, LD, AR, CXX, etc. Do we just use all the 64bit versions with "-mabi=32"? For compiling C++ code, what additional package should we install?


    If only stdc++ is needed, install g++-multlib is enough.

    If you need more libraries like boost etc, the best choice for you is
    to use mipsel port:

    sudo apt install debootstrap systemd-container
    sudo debootstrap sid sid-mipsel http://ftp.cn.debian.org/debian # I
    suppose you are in China.
    sudo systemd-nspawn -D sid-mipsel

    Or you can have a try of lxc.


    there is another way is that maybe you can have a try multiarch:
    https://wiki.debian.org/Multiarch/HOWTO

    Cheers.

    Jun




    On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su <wzssyqa@gmail.com>
    wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午9:43写道:

    installing g++-mipsel-linux-gnu gives an error below. Any suggestions? Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is referred
    to by another package.
    This may mean that the package is missing, has been obsoleted, or >> > >> > is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation candidate

    Ohh, sorry. you are on a mips64el system...
    We don't have that compiler, while you can just
    apt install libc6-dev-mips32
    gcc -mabi=32




    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道:

    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment
    apt install -y crossbuild-essential-armhf # this install
    32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf && >> > >> >> gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu is not
    needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically it
    is apparent crossbuild-essential-mipsel dependency is broken, and if you
    try to fix the dependencies and it ended up conflicting with
    build-essential.

    Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net>
    wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not recognized.
    but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version
    of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su < wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by blahcat
    who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to use
    an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su


    <div dir="ltr">I might be out of touch.  Who are considered &quot;normal users&quot; for MIPS today?  I always thought for a long time MIPS users are pretty much just developers, which means they would need build-essentials.  Having crossbuild is just
    a convenient way to enable development for both 32bit and 64bit on 64bit machine, because I thought, which could be wrong, 32bit crossbuild are simply the same as 32bit native build tools (as in the case of ARM and x86, I presume).<div><br></div><div>In
    any case, multilib works as expected so far.  Thanks for your help.  I will move on down the path of multilib for now.</div><div><br></div><div>Cheers.</div><div><br></div><div>Jun</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr"
    class="gmail_attr">On Sun, Dec 29, 2019 at 5:02 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com">wzssyqa@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-
    left:1ex">Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月30日周一 上午6:01写道:<br>
    &gt;<br>
    &gt; Multiarch is the first thing I tried.  It generally works in terms of adding foreign architecture, finding/install packages with proper dependencies, runtime support, linkers and etc.  The only thing seemingly broken is the crossbuild-essential-
    mipsel, (or build-essential:mipsel, I think), which is needed to develop 32bit in this multiarch environment.  See my earlier email on this.<br>
    &gt;<br>

    Sorry. My stack is toooo shallow.<br>
    build-essential make no sense for normal user at all.<br>
    It is used to make sbuild/pbuilder happier.<br>
    In fact you should not install crossbuild-essential-* manually at all.<br>


    &gt; I think multiarch is the future for debian.  We should get it working on 64bit MIPS.  It does not seem too far to fix it.  From surface, the crossbuild has some unnecessary conflict with native build essential package.  Maybe removing those
    should be fine?<br>

    In fact it is too hard to fix.<br>
    For a suggestion, the normal user should choose only on from mutlilib<br>
    and multiarch.<br>

    For example, if you want to use multiarch, you&#39;d have to purge<br>
    multilib packages.<br>

    &gt;<br>
    &gt; Cheers.<br>
    &gt;<br>
    &gt; Jun<br>
    &gt;<br>
    &gt;<br>
    &gt; On Sun, Dec 29, 2019 at 4:59 AM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt;<br>
    &gt;&gt; YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; 于2019年12月29日周日 下午8:43写道:<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 下午3:33写道:<br>
    &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt; &gt; Thanks for the info, YunQiang.<br>
    &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt; &gt; For simple compiling, I can see &quot;gcc -mabl=32&quot; working well. If we want to port complex project and build in 32 bit, we would need to supply CC, AS, LD, AR, CXX, etc.  Do we just use all the 64bit versions with &quot;-mabi=
    32&quot;?  For compiling C++ code, what additional package should we install?<br>
    &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; If only stdc++ is needed, install g++-multlib is enough.<br> &gt;&gt; &gt;<br>
    &gt;&gt; &gt; If you need more libraries like boost etc, the best choice for you is<br>
    &gt;&gt; &gt; to use mipsel port:<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; sudo apt install debootstrap systemd-container<br>
    &gt;&gt; &gt; sudo debootstrap sid sid-mipsel <a href="http://ftp.cn.debian.org/debian" rel="noreferrer" target="_blank">http://ftp.cn.debian.org/debian</a>  # I<br>
    &gt;&gt; &gt; suppose you are in China.<br>
    &gt;&gt; &gt; sudo systemd-nspawn -D sid-mipsel<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Or you can have a try of lxc.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt;<br>
    &gt;&gt; there is another way is that maybe you can have a try multiarch:<br> &gt;&gt;    <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>
    &gt;&gt;<br>
    &gt;&gt; &gt; &gt; Cheers.<br>
    &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt; &gt; Jun<br>
    &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt; &gt; On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 上午9:43写道:<br>
    &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt; installing g++-mipsel-linux-gnu gives an error below.  Any suggestions?  Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?<br>
    &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt; Jun<br>
    &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt; root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu<br>
    &gt;&gt; &gt; &gt;&gt; &gt; Reading package lists... Done<br>
    &gt;&gt; &gt; &gt;&gt; &gt; Building dependency tree<br>
    &gt;&gt; &gt; &gt;&gt; &gt; Reading state information... Done<br>
    &gt;&gt; &gt; &gt;&gt; &gt; Package g++-mipsel-linux-gnu is not available, but is referred to by another package.<br>
    &gt;&gt; &gt; &gt;&gt; &gt; This may mean that the package is missing, has been obsoleted, or<br>
    &gt;&gt; &gt; &gt;&gt; &gt; is only available from another source<br>
    &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt; E: Package &#39;g++-mipsel-linux-gnu&#39; has no installation candidate<br>
    &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; Ohh, sorry. you are on a mips64el system...<br>
    &gt;&gt; &gt; &gt;&gt; We don&#39;t have that compiler, while you can just<br> &gt;&gt; &gt; &gt;&gt;     apt install libc6-dev-mips32<br>
    &gt;&gt; &gt; &gt;&gt;     gcc -mabi=32<br>
    &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt; On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 上午5:43写道:<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; re-surfacing my own old thread ...<br> &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; apt install -y build-essential    # this install 64bit dev environment<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; apt install -y crossbuild-essential-armhf   # this install 32bit cross-dev environment<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; apt install -y libc6:armhf<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; apt install -y libstdc++6:armhf<br> &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; yep. we don&#39;t have the crossbuild-essential-mipsel package.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; While for normal user, it is not useful at all.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &amp;&amp;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; gcc-arm-linux-gnueabihf<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; So, you can do the same thing just by<br> &gt;&gt; &gt; &gt;&gt; &gt;&gt;    apt install g++-mipsel-linux-gnu   # gcc-mipsel-linux-gnu is not<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; needed, since g++ depeds on gcc.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; However, similar steps don&#39;t work on mips64.  Specifically it is apparent  crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-
    essential.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; Thanks!<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; Jun<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; On Sun, May 19, 2019 at 9:10 PM Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; wrote:<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; This is very cool!  It worked!  Thanks.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; For a complete record here is what I did:<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; dpkg --add-architecture mipsel<br> &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; apt-get update<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; apt-get install gcc-multilib<br> &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; Earlier I was using &quot;-m32&quot; option which was not recognized. but  -march=mips32 -mabi=32 worked just fine.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; Also, just for the record, if one likes to install 32bit library later, you would just add &quot;:mipsel&quot; to the package name.  For example, you would do &quot;apt install zlib1g:mipsel&quot; to install
    32bit version of zlib.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; Cheers.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; Jun<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; On Sun, May 19, 2019 at 5:55 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年5月20日周一 上午7:42写道:<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu.  See  <a href="https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-
    for-mipsel/" rel="noreferrer" target="_blank">https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/</a><br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine.  But it does not seem to work.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; how did you install it?<br> &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; it should be done like:<br> &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; apt-get install libc6-dev-mips32 gcc<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;    and<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; gcc -march=mips32 -mabi=32 xx.c<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; If your app needs libc only, it is enough.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; If your app depends on more libraries, you may need to use an mipsel<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; env, or use multiarch.<br> &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Thanks.<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Jun<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; --<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; YunQiang Su<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; --<br>
    &gt;&gt; &gt; &gt;&gt; &gt;&gt; YunQiang Su<br>
    &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt; &gt;&gt; --<br>
    &gt;&gt; &gt; &gt;&gt; YunQiang Su<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; --<br>
    &gt;&gt; &gt; YunQiang Su<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt; --<br>
    &gt;&gt; YunQiang Su<br>



    -- <br>
    YunQiang Su<br>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jun Sun@21:1/5 to wzssyqa@gmail.com on Mon Dec 30 07:40:01 2019
    See my comments below.

    On Sun, Dec 29, 2019 at 8:48 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月30日周一 下午12:31写道:

    I might be out of touch. Who are considered "normal users" for MIPS
    today? I always thought for a long time MIPS users are pretty much just developers, which means they would need build-essentials. Having
    crossbuild is just a convenient way to enable development for both 32bit
    and 64bit on 64bit machine, because I thought, which could be wrong, 32bit crossbuild are simply the same as 32bit native build tools (as in the case
    of ARM and x86, I presume).


    "normal users" here means people not work on Debian itself.
    Normal for Debian not MIPS here.

    in fact build-essentials package is for some people like some people
    who are maintaining the sbuild/chroot etc for Debian its self.


    Sure. The original purpose of build-essentials might be fore Debian
    developers themselves. But today it becomes synonym for almost all open
    source development. A famous example is Android build which asks to
    install build-essentials first ( https://source.android.com/setup/build/initializing). A less famous
    example is openssl (https://source.android.com/setup/build/initializing)

    It is not surprising to see wide adoption of using build-essential as dev environment. After all, it is just a collection of gcc/g++/libc/make. It
    is much easier to refer to build-essential than those individual packages.

    Sure, cross-build is very useful for normal user (read it as: upstream
    developers, or downstream hardware/software vendors).
    So, you are wanting the
    `mipsel-linux-gnu-gcc`
    command on a mips64el env, instead of to use
    `mips64el-linux-gnuabi64-gcc -mabi=32`
    ?

    Yes. Here are the reasons:

    - it is easier to port existing projects because of exact 1:1 mapping of
    CPP/AS/CC/C++/LD etc.
    - it fits multiarch approach (I think)
    - it seems to be standard or popular way to support 32bit dev work in
    x86_64 and ARM64

    I must declare that I'm not an expert in any of these areas. These are
    just my impressions from my experience. I'd love to hear from you and
    others and see if they are indeed true. If they are, I think it is a good
    idea to supply the crossbuild tools for 32bit mips. I would feel guilty to
    ask for a feature that only I want. :)

    Hope my 2 cents help. Thanks again for your work and support!

    Jun


    If you, yes, we don't provides it with src:gcc-9-cross-mipsen, since I proposed that it is not so useful.
    If it is really needed. I will add it.

    In any case, multilib works as expected so far. Thanks for your help.
    I will move on down the path of multilib for now.

    Cheers.

    Jun


    On Sun, Dec 29, 2019 at 5:02 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月30日周一 上午6:01写道: >> >
    Multiarch is the first thing I tried. It generally works in terms of adding foreign architecture, finding/install packages with proper dependencies, runtime support, linkers and etc. The only thing seemingly broken is the crossbuild-essential-mipsel, (or build-essential:mipsel, I think), which is needed to develop 32bit in this multiarch environment.
    See my earlier email on this.


    Sorry. My stack is toooo shallow.
    build-essential make no sense for normal user at all.
    It is used to make sbuild/pbuilder happier.
    In fact you should not install crossbuild-essential-* manually at all.


    I think multiarch is the future for debian. We should get it working
    on 64bit MIPS. It does not seem too far to fix it. From surface, the crossbuild has some unnecessary conflict with native build essential
    package. Maybe removing those should be fine?

    In fact it is too hard to fix.
    For a suggestion, the normal user should choose only on from mutlilib
    and multiarch.

    For example, if you want to use multiarch, you'd have to purge
    multilib packages.


    Cheers.

    Jun


    On Sun, Dec 29, 2019 at 4:59 AM YunQiang Su <wzssyqa@gmail.com>
    wrote:

    YunQiang Su <wzssyqa@gmail.com> 于2019年12月29日周日 下午8:43写道:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 下午3:33写道:

    Thanks for the info, YunQiang.

    For simple compiling, I can see "gcc -mabl=32" working well. If
    we want to port complex project and build in 32 bit, we would need to
    supply CC, AS, LD, AR, CXX, etc. Do we just use all the 64bit versions
    with "-mabi=32"? For compiling C++ code, what additional package should we install?


    If only stdc++ is needed, install g++-multlib is enough.

    If you need more libraries like boost etc, the best choice for you
    is
    to use mipsel port:

    sudo apt install debootstrap systemd-container
    sudo debootstrap sid sid-mipsel http://ftp.cn.debian.org/debian
    # I
    suppose you are in China.
    sudo systemd-nspawn -D sid-mipsel

    Or you can have a try of lxc.


    there is another way is that maybe you can have a try multiarch:
    https://wiki.debian.org/Multiarch/HOWTO

    Cheers.

    Jun




    On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su <wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午9:43写道:

    installing g++-mipsel-linux-gnu gives an error below. Any suggestions? Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?

    Jun

    root@debian-mips:/home/debian# apt install
    g++-mipsel-linux-gnu
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package g++-mipsel-linux-gnu is not available, but is
    referred to by another package.
    This may mean that the package is missing, has been
    obsoleted, or
    is only available from another source

    E: Package 'g++-mipsel-linux-gnu' has no installation
    candidate

    Ohh, sorry. you are on a mips64el system...
    We don't have that compiler, while you can just
    apt install libc6-dev-mips32
    gcc -mabi=32




    On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su <
    wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年12月29日周日 上午5:43写道:

    re-surfacing my own old thread ...

    On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:

    apt install -y build-essential # this install 64bit dev environment
    apt install -y crossbuild-essential-armhf # this install 32bit cross-dev environment
    apt install -y libc6:armhf
    apt install -y libstdc++6:armhf

    yep. we don't have the crossbuild-essential-mipsel package.
    While for normal user, it is not useful at all.

    crossbuild-essential-armhf depends on
    g++-arm-linux-gnueabihf &&
    gcc-arm-linux-gnueabihf

    So, you can do the same thing just by
    apt install g++-mipsel-linux-gnu # gcc-mipsel-linux-gnu
    is not
    needed, since g++ depeds on gcc.


    However, similar steps don't work on mips64. Specifically
    it is apparent crossbuild-essential-mipsel dependency is broken, and if
    you try to fix the dependencies and it ended up conflicting with build-essential.

    Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?

    Thanks!

    Jun



    On Sun, May 19, 2019 at 9:10 PM Jun Sun <jsun@junsun.net> wrote:

    This is very cool! It worked! Thanks.

    For a complete record here is what I did:

    dpkg --add-architecture mipsel

    apt-get update

    apt-get install gcc-multilib




    Earlier I was using "-m32" option which was not
    recognized. but -march=mips32 -mabi=32 worked just fine.

    Also, just for the record, if one likes to install 32bit library later, you would just add ":mipsel" to the package name. For example, you would do "apt install zlib1g:mipsel" to install 32bit version
    of zlib.

    Cheers.

    Jun


    On Sun, May 19, 2019 at 5:55 PM YunQiang Su < wzssyqa@gmail.com> wrote:

    Jun Sun <jsun@junsun.net> 于2019年5月20日周一 上午7:42写道:

    Recently I came across a piece of great work by
    blahcat who created 64bit MIPSEL debian image that runs on qemu. See https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/

    I tried to install multilib in the hope to compile
    32bit mips code on this 64bit machine. But it does not seem to work.

    how did you install it?
    it should be done like:

    apt-get install libc6-dev-mips32 gcc
    and
    gcc -march=mips32 -mabi=32 xx.c

    If your app needs libc only, it is enough.

    Does anybody know for sure whether this is a dead end
    or just a hiccup which I should overcome?

    If your app depends on more libraries, you may need to
    use an mipsel
    env, or use multiarch.
    https://wiki.debian.org/Multiarch/HOWTO


    Thanks.

    Jun



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su



    --
    YunQiang Su


    <div dir="ltr"><div dir="ltr">See my comments below.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 29, 2019 at 8:48 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com">wzssyqa@gmail.com</a>&gt; wrote:<br></div><
    blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月30日周一 下午12:31写道:<

    &gt;<br>
    &gt; I might be out of touch.  Who are considered &quot;normal users&quot; for MIPS today?  I always thought for a long time MIPS users are pretty much just developers, which means they would need build-essentials.  Having crossbuild is just a
    convenient way to enable development for both 32bit and 64bit on 64bit machine, because I thought, which could be wrong, 32bit crossbuild are simply the same as 32bit native build tools (as in the case of ARM and x86, I presume).<br>
    &gt;<br>

    &quot;normal users&quot; here means people not work on Debian itself.<br> Normal for Debian not MIPS here.<br>

    in fact build-essentials package is for some people like some people<br>
    who are maintaining the sbuild/chroot etc for Debian its self.<br> <br></blockquote><div><br></div><div>Sure.  The original purpose of build-essentials might be fore Debian developers themselves.  But today it becomes synonym for almost all open source development.   A famous example is Android build which asks to
    install build-essentials first (<a href="https://source.android.com/setup/build/initializing">https://source.android.com/setup/build/initializing</a>).  A less famous example is openssl (<a href="https://source.android.com/setup/build/initializing">
    https://source.android.com/setup/build/initializing</a>) </div><div><br></div><div>It is not surprising to see wide adoption of using build-essential as dev environment.  After all, it is just a collection of gcc/g++/libc/make.  It is much easier to
    refer to build-essential than those individual packages.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    Sure, cross-build is very useful for normal user (read it as: upstream<br> developers, or downstream hardware/software vendors).<br>
    So, you are wanting the<br>
        `mipsel-linux-gnu-gcc`<br>
    command on a mips64el env, instead of to use<br>
        `mips64el-linux-gnuabi64-gcc -mabi=32`<br>
    ?<br>
    <br></blockquote><div>Yes.  Here are the reasons:</div><div><ul><li>it is easier to port existing projects because of exact 1:1 mapping of CPP/AS/CC/C++/LD etc.</li><li>it fits multiarch approach (I think)</li><li>it seems to be standard or popular way
    to support 32bit dev work in x86_64 and ARM64</li></ul><div>I must declare that I&#39;m not an expert in any of these areas.  These are just my impressions from my experience.  I&#39;d love to hear from you and others and see if they are indeed true. 
    If they are, I think it is a good idea to supply the crossbuild tools for 32bit mips.  I would feel guilty to ask for a feature that only I want. :)</div></div><div><br></div><div>Hope my 2 cents help.  Thanks again for your work and support!</div><div>
    <br></div><div>Jun</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    If you, yes, we don&#39;t provides it with src:gcc-9-cross-mipsen, since I<br> proposed that it is not so useful.<br>
    If it is really needed. I will add it.<br>

    &gt; In any case, multilib works as expected so far.  Thanks for your help.  I will move on down the path of multilib for now.<br>
    &gt;<br>
    &gt; Cheers.<br>
    &gt;<br>
    &gt; Jun<br>
    &gt;<br>
    &gt;<br>
    &gt; On Sun, Dec 29, 2019 at 5:02 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt;<br>
    &gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月30日周一 上午6:01写道:<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Multiarch is the first thing I tried.  It generally works in terms of adding foreign architecture, finding/install packages with proper dependencies, runtime support, linkers and etc.  The only thing seemingly broken is the crossbuild-
    essential-mipsel, (or build-essential:mipsel, I think), which is needed to develop 32bit in this multiarch environment.  See my earlier email on this.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt;<br>
    &gt;&gt; Sorry. My stack is toooo shallow.<br>
    &gt;&gt; build-essential make no sense for normal user at all.<br>
    &gt;&gt; It is used to make sbuild/pbuilder happier.<br>
    &gt;&gt; In fact you should not install crossbuild-essential-* manually at all.<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt; &gt; I think multiarch is the future for debian.  We should get it working on 64bit MIPS.  It does not seem too far to fix it.  From surface, the crossbuild has some unnecessary conflict with native build essential package.  Maybe removing
    those should be fine?<br>
    &gt;&gt;<br>
    &gt;&gt; In fact it is too hard to fix.<br>
    &gt;&gt; For a suggestion, the normal user should choose only on from mutlilib<br>
    &gt;&gt; and multiarch.<br>
    &gt;&gt;<br>
    &gt;&gt; For example, if you want to use multiarch, you&#39;d have to purge<br> &gt;&gt; multilib packages.<br>
    &gt;&gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Cheers.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Jun<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; On Sun, Dec 29, 2019 at 4:59 AM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; 于2019年12月29日周日 下午8:43写道:<br>
    &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 下午3:33写道:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt; Thanks for the info, YunQiang.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt; For simple compiling, I can see &quot;gcc -mabl=32&quot; working well. If we want to port complex project and build in 32 bit, we would need to supply CC, AS, LD, AR, CXX, etc.  Do we just use all the 64bit versions with &
    quot;-mabi=32&quot;?  For compiling C++ code, what additional package should we install?<br>
    &gt;&gt; &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; If only stdc++ is needed, install g++-multlib is enough.<br>
    &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; If you need more libraries like boost etc, the best choice for you is<br>
    &gt;&gt; &gt;&gt; &gt; to use mipsel port:<br>
    &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; sudo apt install debootstrap systemd-container<br> &gt;&gt; &gt;&gt; &gt; sudo debootstrap sid sid-mipsel <a href="http://ftp.cn.debian.org/debian" rel="noreferrer" target="_blank">http://ftp.cn.debian.org/debian</a>  # I<br>
    &gt;&gt; &gt;&gt; &gt; suppose you are in China.<br>
    &gt;&gt; &gt;&gt; &gt; sudo systemd-nspawn -D sid-mipsel<br>
    &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; Or you can have a try of lxc.<br>
    &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; there is another way is that maybe you can have a try multiarch:<br>
    &gt;&gt; &gt;&gt;    <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt; Cheers.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt; Jun<br>
    &gt;&gt; &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt; On Sat, Dec 28, 2019 at 9:28 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 上午9:43写道:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; installing g++-mipsel-linux-gnu gives an error below.  Any suggestions?  Also, what is the recommended way to set up full 32bit dev environment on 64bit host if crossbuild is not the one?<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; Jun<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; root@debian-mips:/home/debian# apt install g++-mipsel-linux-gnu<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; Reading package lists... Done<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; Building dependency tree<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; Reading state information... Done<br> &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; Package g++-mipsel-linux-gnu is not available, but is referred to by another package.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; This may mean that the package is missing, has been obsoleted, or<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; is only available from another source<br> &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; E: Package &#39;g++-mipsel-linux-gnu&#39; has no installation candidate<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; Ohh, sorry. you are on a mips64el system...<br> &gt;&gt; &gt;&gt; &gt; &gt;&gt; We don&#39;t have that compiler, while you can just<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt;     apt install libc6-dev-mips32<br> &gt;&gt; &gt;&gt; &gt; &gt;&gt;     gcc -mabi=32<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt; On Sat, Dec 28, 2019 at 4:14 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年12月29日周日 上午5:43写道:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; re-surfacing my own old thread ...<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; On ARM, I was able to do something really simple to obtain complete 32bit development on a 64bit host:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; apt install -y build-essential    # this install 64bit dev environment<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; apt install -y crossbuild-essential-armhf   # this install 32bit cross-dev environment<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; apt install -y libc6:armhf<br> &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; apt install -y libstdc++6:armhf<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; yep. we don&#39;t have the crossbuild-essential-mipsel package.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; While for normal user, it is not useful at all.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; crossbuild-essential-armhf depends on g++-arm-linux-gnueabihf &amp;&amp;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; gcc-arm-linux-gnueabihf<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; So, you can do the same thing just by<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt;    apt install g++-mipsel-linux-gnu   # gcc-mipsel-linux-gnu is not<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; needed, since g++ depeds on gcc.<br> &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; However, similar steps don&#39;t work on mips64.  Specifically it is apparent  crossbuild-essential-mipsel dependency is broken, and if you try to fix the dependencies and it ended up conflicting with build-
    essential.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; Are there more better way to install a complete 32bit dev environment than what is mentioned earlier in this thread?<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; Thanks!<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; Jun<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; On Sun, May 19, 2019 at 9:10 PM Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; wrote:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; This is very cool!  It worked!  Thanks.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; For a complete record here is what I did:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; dpkg --add-architecture mipsel<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; apt-get update<br> &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; apt-get install gcc-multilib<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; Earlier I was using &quot;-m32&quot; option which was not recognized. but  -march=mips32 -mabi=32 worked just fine.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; Also, just for the record, if one likes to install 32bit library later, you would just add &quot;:mipsel&quot; to the package name.  For example, you would do &quot;apt install zlib1g:mipsel&quot; to
    install 32bit version of zlib.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; Cheers.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; Jun<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt; On Sun, May 19, 2019 at 5:55 PM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com" target="_blank">wzssyqa@gmail.com</a>&gt; wrote:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; 于2019年5月20日周一 上午7:42写道:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Recently I came across a piece of great work by blahcat who created 64bit MIPSEL debian image that runs on qemu.  See  <a href="https://blahcat.github.io/2017/07/14/building-a-debian-stretch-
    qemu-image-for-mipsel/" rel="noreferrer" target="_blank">https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/</a><br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; I tried to install multilib in the hope to compile 32bit mips code on this 64bit machine.  But it does not seem to work.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; how did you install it?<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; it should be done like:<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; apt-get install libc6-dev-mips32 gcc<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;    and<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; gcc -march=mips32 -mabi=32 xx.c<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; If your app needs libc only, it is enough.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Does anybody know for sure whether this is a dead end or just a hiccup which I should overcome?<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; If your app depends on more libraries, you may need to use an mipsel<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; env, or use multiarch.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; <a href="https://wiki.debian.org/Multiarch/HOWTO" rel="noreferrer" target="_blank">https://wiki.debian.org/Multiarch/HOWTO</a><br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Thanks.<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Jun<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; --<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;&gt;&gt; YunQiang Su<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; --<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; &gt;&gt; YunQiang Su<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; --<br>
    &gt;&gt; &gt;&gt; &gt; &gt;&gt; YunQiang Su<br>
    &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt;<br>
    &gt;&gt; &gt;&gt; &gt; --<br>
    &gt;&gt; &gt;&gt; &gt; YunQiang Su<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt;<br>
    &gt;&gt; &gt;&gt; --<br>
    &gt;&gt; &gt;&gt; YunQiang Su<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt; --<br>
    &gt;&gt; YunQiang Su<br>



    -- <br>
    YunQiang Su<br>
    </blockquote></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Sat Mar 7 15:20:01 2020
    @Jun Sun FYI, the src:build-essential-mipsen package has been in Sid now.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jun Sun@21:1/5 to wzssyqa@gmail.com on Sun Mar 22 02:40:02 2020
    Great! I will check it out sometime soon.

    Is crossbuild tool something on the way as well? Not something I should
    hold my breath for?

    Thanks for your hard work, as always!

    Jun

    On Sat, Mar 7, 2020 at 6:14 AM YunQiang Su <wzssyqa@gmail.com> wrote:

    @Jun Sun FYI, the src:build-essential-mipsen package has been in Sid now.


    <div dir="ltr">Great! I will check it out sometime soon.<div><br></div><div>Is crossbuild tool something on the way as well?  Not something I should hold my breath for?</div><div><br></div><div>Thanks for your hard work, as always!</div><div><br></div><
    Jun</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 7, 2020 at 6:14 AM YunQiang Su &lt;<a href="mailto:wzssyqa@gmail.com">wzssyqa@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:
    0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">@Jun Sun FYI, the src:build-essential-mipsen package has been in Sid now.<br>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)