why do we need xtensa-config.h?

Thomas Schwinge thomas@codesourcery.com
Wed Sep 7 06:55:00 GMT 2016


Neither do I really know anything about Xtensa, nor do I have a lot of
experience in these parts of GCC back ends, but:

On Tue, 6 Sep 2016 20:42:53 +0200, Oleksij Rempel <linux@rempel-privat.de> wrote:
> i'm one of ath9k-htc-firmware developers. Currently i'm looking for the
> way to provide this firmware as opensource/free package for debian. Main
> problem seems to be the need to patch gcc xtensa-config.h to make it
> suitable for our CPU.
> I have fallowing questions:
> do we really need this patch?
> https://github.com/qca/open-ath9k-htc-firmware/blob/master/local/patches/gcc.patch

That I can't tell.  ;-)

> Is it possible or welcome to extend gcc to be configurable without
> patching it all the time?

Yes, I would think.  The macros modified in the above patch to GCC's
include/xtensa-config.h file look like these ought to be modifiable with
-m* options defined by the Xtensa back end, and you'd then assign
specific defaults to a specific CPU variant, and build GCC (or build a
multilib) for that configuration.

This file include/xtensa-config.h is #included in
gcc/config/xtensa/xtensa.h and libgcc/config/xtensa/crti.S,
libgcc/config/xtensa/crtn.S, libgcc/config/xtensa/lib1funcs.S,
libgcc/config/xtensa/lib2funcs.S, but I have not checked how the macro
definitions are actually used.

In gcc/doc/install.texi I read:

    @heading xtensa*-*-elf
    This target is intended for embedded Xtensa systems using the
    @samp{newlib} C library.  It uses ELF but does not support shared
    objects.  Designed-defined instructions specified via the
    Tensilica Instruction Extension (TIE) language are only supported
    through inline assembly.
    The Xtensa configuration information must be specified prior to
    building GCC@.  The @file{include/xtensa-config.h} header
    file contains the configuration information.  If you created your
    own Xtensa configuration with the Xtensa Processor Generator, the
    downloaded files include a customized copy of this header file,
    which you can use to replace the default header file.
    <hr />
    @end html
    @heading xtensa*-*-linux*

Hmm.  CCing Sterling Augustine who is listed as the Xtensa CPU Port

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20160907/b7efe70e/attachment.sig>

More information about the Gcc mailing list