From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120079 invoked by alias); 22 May 2017 21:09:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 120052 invoked by uid 89); 22 May 2017 21:09:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,GIT_PATCH_3,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=sterling, Sterling, reusable X-HELO: mail-lf0-f67.google.com Received: from mail-lf0-f67.google.com (HELO mail-lf0-f67.google.com) (209.85.215.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 May 2017 21:09:33 +0000 Received: by mail-lf0-f67.google.com with SMTP id h4so6437849lfj.3 for ; Mon, 22 May 2017 14:09:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ykx18J+AGx/nTbtdlt/YTo0uVptVaThTIOkAqC9xnXk=; b=NFZtuM8u2U1XDN2YR4o4dGIoId8sx176YLKVHrcBGZzIanlAVY1v5eefrYtwOgebtF SEzMzVbDh7f2WtVKTangJbdBNZUzpMx+Kzb38hdSyKc17F3AsWuLSVnNyfbec+4lFklK dACco4L6LYQrDP/lP5xLkUvLeh9aB3reddIpXWtTSzD6cu7/c3iVN8JFPGbyyhZIlSjd SqIcwB3K7RaBdy1js558D9dQCgffYDnp/05rnKhbqVhu5/wpLWhB2sCXJdqknK8TUFDU UeOanMHWvl4Fs0onEgrtT+U7Ptyer5mMQfJD5+dxsYJsPL2qd+x4OBE9jvGCxpOTNHqk DHUQ== X-Gm-Message-State: AODbwcAMv80pVoFwygT1bT48RM7Rh/+nMuyM8xmQm+y9C5BA7RgfjfCi nB68Eat3oom8qQ== X-Received: by 10.25.31.9 with SMTP id f9mr5876911lff.160.1495487375048; Mon, 22 May 2017 14:09:35 -0700 (PDT) Received: from octofox.metropolis ([5.19.183.212]) by smtp.gmail.com with ESMTPSA id 95sm3447374lja.49.2017.05.22.14.09.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 May 2017 14:09:34 -0700 (PDT) From: Max Filippov To: gcc-patches@gcc.gnu.org Cc: linux-xtensa@linux-xtensa.org, Sterling Augustine , Max Filippov Subject: [RFC 0/5] xtensa: support dynamic configuration Date: Mon, 22 May 2017 21:09:00 -0000 Message-Id: <1495487362-18969-1-git-send-email-jcmvbkbc@gmail.com> X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg01710.txt.bz2 Hi Sterling, this is an RFC series that makes xtensa gcc dynamically configurable, i.e. 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 using 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 following project: https://github.com/jcmvbkbc/xtensa-dynconfig 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. Max Filippov (5): gcc: xtensa: allow XCHAL_* macros to be non-constant gcc: xtensa: make configuration dynamic gcc: xtensa: support dynconfig on windows gcc: xtensa: add __XCHAL_* builtins libgcc: xtensa: use built-in configuration gcc/Makefile.in | 2 +- gcc/config.gcc | 1 + gcc/config/xtensa/t-xtensa | 5 + gcc/config/xtensa/xtensa-config.c | 139 ++++++++++++++ gcc/config/xtensa/xtensa-protos.h | 1 + gcc/config/xtensa/xtensa.c | 18 +- gcc/config/xtensa/xtensa.h | 31 ++-- include/xtensa-config-builtin.h | 191 +++++++++++++++++++ include/xtensa-dynconfig.h | 373 ++++++++++++++++++++++++++++++++++++++ libgcc/config/xtensa/crti.S | 2 +- libgcc/config/xtensa/crtn.S | 2 +- libgcc/config/xtensa/lib1funcs.S | 2 +- libgcc/config/xtensa/lib2funcs.S | 2 +- 13 files changed, 736 insertions(+), 33 deletions(-) create mode 100644 gcc/config/xtensa/xtensa-config.c create mode 100644 include/xtensa-config-builtin.h create mode 100644 include/xtensa-dynconfig.h -- 2.1.4