From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>, Fam Zheng <famz@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC PATCH] docker: Add fedora-xtensa-cross image
Date: Fri, 22 Jun 2018 22:55:32 +0100 [thread overview]
Message-ID: <87602av63v.fsf@linaro.org> (raw)
In-Reply-To: <c721aacc-6ee9-28e3-a8f9-c3c836d42355@amsat.org>
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
> On 06/22/2018 03:45 PM, Max Filippov wrote:
>> On Fri, Jun 22, 2018 at 9:27 AM, Alex Bennée <alex.bennee@linaro.org> wrote:
>>> Max Filippov <jcmvbkbc@gmail.com> writes:
>>>> On Fri, Jun 22, 2018 at 7:02 AM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>>>> As of this commit:
>>>>>
>>>>> $ xtensa-linux-gnu-as -v
>>>>> GNU assembler version 2.29.1 (xtensa-linux-gnu) using BFD version version 2.29.1-1.fc27
>>>>>
>>>>> $ xtensa-linux-gnu-gcc -v
>>>>> Target: xtensa-linux-gnu
>>>>> gcc version 7.2.1 20170915 (Red Hat Cross 7.2.1-1) (GCC)
>>>>>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>>>> ---
>>>>> tests/docker/dockerfiles/fedora-xtensa-cross.docker | 7 +++++++
>>>>> 1 file changed, 7 insertions(+)
>>>>> create mode 100644 tests/docker/dockerfiles/fedora-xtensa-cross.docker
>>>>>
>>>>> diff --git a/tests/docker/dockerfiles/fedora-xtensa-cross.docker b/tests/docker/dockerfiles/fedora-xtensa-cross.docker
>>>>> new file mode 100644
>>>>> index 0000000000..6f9521520c
>>>>> --- /dev/null
>>>>> +++ b/tests/docker/dockerfiles/fedora-xtensa-cross.docker
>>>>> @@ -0,0 +1,7 @@
>>>>> +FROM fedora:latest
>>>>> +ENV PACKAGES \
>>>>> + binutils-xtensa-linux-gnu \
>>>>> + gcc-xtensa-linux-gnu
>>>>
>>>> Generic binutils and gcc for xtensa only (partially) make sense for
>>>> build testing.
>>>
>>> OK
>>>
>>>> Built binaries will not work.
>>>
>>> Why?
>>
>> The default toolchain does not generate code for any real xtensa CPU
>> configuration or for any configuration supported by the QEMU.
>> The xtensa configuration overlay for a specific CPU must be applied
>> to the toolchain source in order to build a toolchain capable of
>> producing code that would work on that CPU.
>> There's FSF xtensa CPU configuration in QEMU that is compatible with
>> very old (older than 2.19 IIRC) binutils.
>
> While the Fedora binutils supports dual endianness, the compiler only
> works for big-endian:
>
> $ docker run --rm -it qemu:fedora-xtensa-cross xtensa-linux-gnu-objcopy
> xtensa-linux-gnu-objcopy: supported targets: elf32-xtensa-le
> elf32-xtensa-be elf32-little elf32-big
>
> $ docker run --rm -it qemu:fedora-xtensa-cross bash -c \
> 'echo -e "__XTENSA_EL__\n__XTENSA_EB__" | \
> xtensa-linux-gnu-gcc -E - | grep -v "\#"'
> __XTENSA_EL__
> 1
>
>> xtensa TCG tests (at least
>> some of them) are written for the dc232b xtensa CPU. The configuration
>
> I learned that the hard way :(
>
> I took the only big-endian CPU available: FSF, however
>
> - the linkscript expect the unavailable XTENSA_HAVE_BE definition,
> - core-isa.h misses the following definitions:
>
> #define XCHAL_KERNEL_VECOFS 0x00000200 /* XXX ??? */
> #define XCHAL_INTLEVEL2_VECOFS 0x00000180 /* XXX ??? */
> #define XCHAL_INTLEVEL3_VECOFS 0x00000240 /* XXX ??? */
> #define XCHAL_INTLEVEL4_VECOFS 0x00000520 /* XXX ??? */
>
> So this is a dead-end.
>
>> overlay for that CPU is available here:
>>
>> https://github.com/jcmvbkbc/xtensa-toolchain-build/blob/master/overlays/xtensa_dc232b.tar.gz
>>
>> The following toolchain may be used to build working tests for xtensa:
>>
>> https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-xtensa-dc232b-elf.tar.gz
>
> Thanks for the links, I'll continue with DC232B next week.
>
> Alex: Can you dequeue this patch please?
OK poor first choice for getting the system emulation patches working. I
wonder if the other fedora compilers will be useful for us?
> gcc-nios2-linux-gnu-7.1.1-3.fc27.i686.rpm
> gcc-microblaze-linux-gnu-7.1.1-3.fc27.i686.rpm
> gcc-tile-linux-gnu-7.1.1-3.fc27.i686.rpm
> gcc-cris-linux-gnu-7.1.1-3.fc27.i686.rpm
--
Alex Bennée
prev parent reply other threads:[~2018-06-22 21:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-22 14:02 [Qemu-devel] [RFC PATCH] docker: Add fedora-xtensa-cross image Philippe Mathieu-Daudé
2018-06-22 14:23 ` Daniel P. Berrangé
2018-06-22 14:33 ` Philippe Mathieu-Daudé
2018-06-22 15:06 ` Alex Bennée
2018-06-22 15:54 ` Max Filippov
2018-06-22 16:27 ` Alex Bennée
2018-06-22 18:45 ` Max Filippov
2018-06-22 20:33 ` Philippe Mathieu-Daudé
2018-06-22 21:55 ` Alex Bennée [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87602av63v.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=f4bug@amsat.org \
--cc=famz@redhat.com \
--cc=jcmvbkbc@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).