public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: Ian Lance Taylor <ian@airs.com>, Max Filippov <jcmvbkbc@gmail.com>
Subject: [PATCH v2 0/2] gcc: xtensa: allow dynamic configuration
Date: Mon, 28 Nov 2022 16:45:49 -0800	[thread overview]
Message-ID: <20221129004551.2213723-1-jcmvbkbc@gmail.com> (raw)

Hello,

this series addresses the long standing issue with xtensa configuration
support by adding a way to configure toolchain for a specific xtensa
core at runtime using the xtensa-dynconfig [1] library as a plugin.
On a platform with shared library support single toolchain binary
becomes capable of building code for arbitrary xtensa configuration.
At the same time it fully preserves the traditional way of configuring
the toolchain using the xtensa configuration overlay.

Currently xtensa toolchain needs to be patched and rebuilt for every
new xtensa processor configuration. This has a number of downsides:
- toolchain builders need to change the toolchain source code, and
  because xtensa configuration overlay is not a patch, this change is
  special, embedding it into the toolchain build process gets
  backpressure.
- toolchain built for one configuration is usually not usable for any
  other configuration. It's not possible for a distribution to provide
  reusable prebuilt xtensa toolchain.

This series allows building the toolchain (including target libraries)
without its source code modification. Built toolchain takes configuration
parameters from the shared object specified in the environment variable.
That shared object may be built by the xtensa-dynconfig project [1].

The same shared object is used for gcc, all binutils and for gdb.
Xtensa core specific information needed to build that shared object is
taken from the configuration overlay.

Both gcc and binutils-gdb get new shared header file
include/xtensa-dynconfig.h that provides definition of configuration
data structure, initialization macros, redefines XCHAL_* macros to
access this structure and declares function for loading configuration
dynamically.

This is not the first submission of this series, it was first
submitted in 2017 [2]. This version has improved configuration
versioning and GPL-compatibility check that was suggested in comments
for the v1.

[1] https://github.com/jcmvbkbc/xtensa-dynconfig
[2] https://gcc.gnu.org/pipermail/gcc-patches/2017-May/475109.html

Max Filippov (2):
  gcc: xtensa: allow dynamic configuration
  libgcc: xtensa: use built-in configuration

 gcc/config.gcc                               |   1 +
 gcc/config/xtensa/t-xtensa                   |   8 +-
 gcc/config/xtensa/xtensa-dynconfig.c         | 170 +++++++
 gcc/config/xtensa/xtensa-protos.h            |   1 +
 gcc/config/xtensa/xtensa.h                   |  22 +-
 include/xtensa-dynconfig.h                   | 442 +++++++++++++++++++
 libgcc/config/xtensa/crti.S                  |   2 +-
 libgcc/config/xtensa/crtn.S                  |   2 +-
 libgcc/config/xtensa/lib1funcs.S             |   2 +-
 libgcc/config/xtensa/lib2funcs.S             |   2 +-
 libgcc/config/xtensa/xtensa-config-builtin.h | 198 +++++++++
 11 files changed, 828 insertions(+), 22 deletions(-)
 create mode 100644 gcc/config/xtensa/xtensa-dynconfig.c
 create mode 100644 include/xtensa-dynconfig.h
 create mode 100644 libgcc/config/xtensa/xtensa-config-builtin.h

-- 
2.30.2


             reply	other threads:[~2022-11-29  0:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29  0:45 Max Filippov [this message]
2022-11-29  0:45 ` [PATCH v2 1/2] " Max Filippov
2022-11-29  0:45 ` [PATCH v2 2/2] libgcc: xtensa: use built-in configuration Max Filippov
2022-12-07 18:03 ` [PATCH v2 0/2] gcc: xtensa: allow dynamic configuration Max Filippov

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=20221129004551.2213723-1-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ian@airs.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).