This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to build and test uClinux toolchains


On Fri, 26 Oct 2018 at 19:54, Max Filippov <jcmvbkbc@gmail.com> wrote:
>
> On Fri, Oct 26, 2018 at 6:51 AM Christophe Lyon
> <christophe.lyon@linaro.org> wrote:
> > On Sun, 21 Oct 2018 at 04:06, Max Filippov <jcmvbkbc@gmail.com> wrote:
> > > Probably the easiest way to get all xtensa toolchain parts correctly it
> > > by using existing buildroot configuration. E.g. the following configuration
> > > may be used to build uclinux xtensa toolchain for the dc233c core:
> > > https://git.buildroot.net/buildroot/tree/configs/qemu_xtensa_lx60_nommu_defconfig
> > >
> > OK, thanks for your suggestion. I think I managed to build it.
> > Now, how/where can I run 'make check' for gcc?
> > I do not see the GCC build tree.
>
> The gcc build tree is usually in the build/host-gcc-final in the buildroot
> build tree. But that's gcc version selected in the buildroot, you probably
> want a different version. Usually after the buildroot toolchain is ready I
> build gcc separately using binutils and sysroot produced by the buildroot.
> I have a few examples here:
>
>   http://wiki.osll.ru/doku.php/etc:users:jcmvbkbc:gcc-xtensa-call0
>
> Please note that you'd need to apply gcc part of the xtensa overlay to
> your gcc source for it to correctly generate code for that configuration.
>
> I've run the tests with the current gcc trunk and a lot of execution
> tests related to TLS (which is expected) and exceptions (which I
> didn't expect) are failing. I'm looking at it.
>

I'm not sure if I followed the instructions correctly:
make qemu_xtensa_lx60_nommu_defconfig
make all
which built:
./output/host/bin/xtensa-buildroot-uclinux-uclibc-gcc (which is 7.3)
then I tried to follow the wiki above:
export TOOLCHAIN=$PWD/output
PATH=$TOOLCHAIN/host/bin:$PATH ..../gcc/configure [...]

I also built qemu from the branch you mentioned,
and used the "run it on linux-user QEMU" section in the wiki

I see many execution errors, now realizing that I didn't
do what you said above: "apply gcc part of the xtensa overlay".
But what is this? Do you mean the patches in buildroot/packages/gcc/8.2.0 ?
I tried to apply 0004-gcc-xtensa-fix-NAND-code-in-xtensa_expand_atomic.patch
but patch says it's already applied (I'm using GCC trunk)

And while writing this reply, I'm just realizing that buildroot builds
for uclinux-uclibc-gcc, while the wiki uses linux-uclibc :(
Does the wiki need an update wrt target name?

> > > Also bFLT executable format is currently not supported for linux-user
> > > xtensa QEMU. The following branch adds that support:
> > > https://github.com/OSLL/qemu-xtensa/commits/xtensa-bflt
> > >
> > > qemu-xtensa built from this QEMU then may be registered as a binfmt
> > > handler for bFLT executable images allowing to run gcc tests that want
> > > to run target binaries.
> > Do you have the magic commands for this?
>
> If you build QEMU from the link above you can use the following command
> to register binfmt handler for bFLT binaries assuming that you've installed
> it into $QEMU_PREFIX:
>
>   sudo scripts/qemu-binfmt-conf.sh --qemu-path=$QEMU_PREFIX/bin --flat 'xtensa'
>
> The --flat switch is not final, it will likely change before it's accepted to
> the QEMU mainline.
> --
> Thanks.
> -- Max


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]