RE: building gcc for mipsel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peter Münster <pmlists@xxxxxxx> writes:
> On Mon, Aug 22 2016, Kai Ruottu wrote:
> 
> > Are you this same "Peter" who targets to OpenWRT?
> 
> Hi Kai,
> 
> Yes.
> 
> 
> > Then maybe the discussion here helps :
> >
> > https://forum.openwrt.org/viewtopic.php?id=22968
> 
> Thanks. I've built an OpenWRT-SDK but I still get "opcode not supported"...

I assume this is referring to the error seen in:

https://dev.openwrt.org/ticket/23325?replyto=description&reply=%E2%86%B3+Reply

This looks to me like you are using binutils version 2.25 or later with GCC 4.8.

Can you confirm which version of binutils is being used? The issue you are hitting
is that we tightened the rules on ABIs to improve safety and support new
architectural features but there are a few things which break because of it too.

I did a backport of this change to gcc 4.9 which allows gcc 4.9 to build with
newer binutils but did not do gcc 4.8 as there was no demand for it. The commit
you need is below (svn r221000). I don't know if it applies cleanly to gcc 4.8
but you could try.

commit 57f5c0954f95cb37f995d60167ddde06c7d6e697
Author: mpf <mpf@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Feb 26 10:40:06 2015 +0000

    Support the use of binutils after o32 FPXX support was added

    Combined minimal backport of:
    r213870 Fix mips16.S for soft-float
    r213872 Pass -m(soft|hard|single|double)-float via ASM_SPEC
    r217446 Implement o32 FPXX (minimal backport)
    r217939 Update configure check for HAVE_AS_DOT_MODULE
    r219867 Only pass floating-point options when necessary

    gcc/
        * config.in [!USED_FOR_TARGET] (HAVE_AS_DOT_MODULE): Undefine.
        * config/mips/mips.h (FP_ASM_SPEC): New macro.
        (ASM_SPEC): Use FP_ASM_SPEC.
        * configure.ac (HAVE_AS_DOT_MODULE): Detect support for .module
        and FPXX extensions.
        * configure: Regenerate.

    libgcc/
        * config/mips/mips16.S: Do not build for soft-float.

    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@221000 138bc75d-0d04-0410-961f-82ee72b054a4

thanks,
Matthew

> 
> 
> > "everything from absolute scratch" propaganda stating that "only
> > sources are allowed" when the question is about crosstoolchains.
> 
> Before asking my question here, I've really tried hard to build with the
> OpenWRT toolchain, often it failed after about 30 minutes of
> compilation. It's not obvious then for me, who is to blame (gcc, the
> provided patches, the toolchain or me...) and where to ask questions.
> 
> 
> On Mon, Aug 22 2016, Kai Ruottu wrote:
> 
> >> That's why I try to build it from scratch, only by using the gcc source code.
> >>
> > Ok, here are the normal steps for a crosstoolchain :
> 
> Thanks you very much for your howto, I'll try it soon.
> 
> 
> On Mon, Aug 22 2016, Kai Ruottu wrote:
> 
> >> The use of stuff for 'mips16' could come from the '-elf' choice,
> >> Linux not using these 16-bit opcodes at all...
> >
> > Seemingly I was wrong... I checked from my 'mips64el-linux-gnu'
> > targeted crosstoolchain (gcc-4.8.3) and its libgcc had these objects
> > being produced. But of course produced with the just built GCC, not
> > with some earlier made GCC (your ' mipsel-openwrt-linux-musl-gcc').
> >
> > [...]
> >
> > Also in my gcc-5.1.0 based toolchain these things were in the same way, the
> > glibc
> > from Debian was only changed to glibc-2.13...
> >
> > [root@localhost 5.1.0]# mips64el-linux-gnu-gcc-5.1 -v
> 
> This is the output of the OpenWRT cross-gcc:
> ./mipsel-openwrt-linux-gcc -v
> Reading specs from /home/peter/soft/wl-500gp/no-backup/staging_dir/toolchain-
> mipsel_mips32_gcc-5.3.0_glibc-2.22/bin/../lib64/gcc/mipsel-openwrt-linux-gnu/5.3.0/specs
> COLLECT_GCC=./mipsel-openwrt-linux-gcc
> COLLECT_LTO_WRAPPER=/home/peter/soft/wl-500gp/no-backup/staging_dir/toolchain-
> mipsel_mips32_gcc-5.3.0_glibc-2.22/bin/../lib/gcc/mipsel-openwrt-linux-gnu/5.3.0/lto-
> wrapper
> Target: mipsel-openwrt-linux-gnu
> Configured with:
> /home/peter/soft/wl-500gp/build_dir/toolchain-mipsel_mips32_gcc-5.3.0_glibc-2.22/gcc-
> 5.3.0/configure
> --with-bugurl=https://dev.openwrt.org/ --with-pkgversion='OpenWrt GCC
> 5.3.0 49906'
> --prefix=/home/peter/soft/wl-500gp/staging_dir/toolchain-mipsel_mips32_gcc-5.3.0_glibc-
> 2.22
> --build=x86_64-suse-linux --host=x86_64-suse-linux
> --target=mipsel-openwrt-linux-gnu --with-gnu-ld --enable-target-optspace
> --disable-libgomp --disable-libmudflap --disable-multilib --disable-nls
> --without-isl --without-cloog --with-host-libstdcxx=-lstdc++
> --with-float=soft --with-gmp=/home/peter/soft/wl-500gp/staging_dir/host
> --with-mpfr=/home/peter/soft/wl-500gp/staging_dir/host
> --with-mpc=/home/peter/soft/wl-500gp/staging_dir/host
> --disable-decimal-float --with-mips-plt
> --with-diagnostics-color=auto-if-env --enable-libssp
> --enable-__cxa_atexit
> --with-headers=/home/peter/soft/wl-500gp/staging_dir/toolchain-mipsel_mips32_gcc-
> 5.3.0_glibc-2.22/include
> --disable-libsanitizer --enable-languages=c,c++ --enable-shared
> --enable-threads
> --with-slibdir=/home/peter/soft/wl-500gp/staging_dir/toolchain-mipsel_mips32_gcc-
> 5.3.0_glibc-2.22/lib
> --enable-lto --with-libelf=/home/peter/soft/wl-500gp/staging_dir/host
> Thread model: posix
> gcc version 5.3.0 (OpenWrt GCC 5.3.0 49906)
> 
> What do you think: is this a problem of the toolchain or of the
> gcc-package? If this could be fixed, then it would be much easier to
> build gcc for mipsel, than compiling everything from source.
> 
> Thanks for your efforts,
> --
>            Peter





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux