From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by sourceware.org (Postfix) with ESMTPS id 44B8338983AC for ; Wed, 7 Dec 2022 18:03:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 44B8338983AC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-3704852322fso194723937b3.8 for ; Wed, 07 Dec 2022 10:03:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PuEKwKd3eDXQurcJA+H5E5sEaoN9t3+SZLW8zIeJ6cI=; b=LWdQGAFmeGnSTuK7s4DxAsKEZNNJ236oO+Rl22i6mAzkJ4EIBRtrIgE4U8MqPuHNkk u4PS+LiOK75oR6PMEM1Yxf6C13frnHoSp1knU4CEbIO4Wd6eNNUL1uxa7u1yCiqBSv2K IrDozUtjbvpbUv4VcNzk977p6sZc3OiO3r1VZUD672tZBLygUa36rs0YOMZsIYlIlrc+ lxBDFyT0zG8kRATsbc9Mhi2tmk9zwzMv2+iIMK6T7OAgip12s/noG4EYDhJnpSlZup+n SmFr4GSjM6R+SQVfNfiwTYQ1zD3Ugn4l+HBhFHTMR1L4vCmS9q/+iJeCiq393UF6r5Lo jWow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PuEKwKd3eDXQurcJA+H5E5sEaoN9t3+SZLW8zIeJ6cI=; b=U75d+Gk9Eziv2MoNrbbFUdDjURBmguTiErycNu3hbgKGVm4pc50v+3Cv4tiGZ8xDiu ihnDJnH4gQabwsXbxZ+zOO169+Y0/J44lq14g+lVrzf4/rutfw/+cGTlYwWI1a0cMl/8 +fZGOugZyPh3/5i64mym962N5JHTN3UoRR1SohsjsS3JGyegsKbxnYz5IIm5CpEdwCW9 ElPvlasjdr/HUVJZWKWgVdrAIGgvTzWlQyeWKzmzy3TK5HA84tn0zvVDazcZaQQz1Mtr 7gNS1GpZmroxwrj1uaAnCpo48+haMN4Yh3eo+FegrN6Va4b0ZqQJlatOFJHnUpZBdfpF aD/w== X-Gm-Message-State: ANoB5pnILwue0gAh+omzgefwVl5gL36f9FNyYDVW3Q4qu2MASIr8fe44 93Qh8na+5vREW7k55EkGQ+8aC8WenOClLmm+95UJ9GvKcoM= X-Google-Smtp-Source: AA0mqf77LkWmDBAz1b0kjDc8eIRHdr8k3HMKw5b9xDJejifS+y+DhyMboedFQhil3kc6+dGS2IRJIpcpN6eiXtxkUyg= X-Received: by 2002:a81:94f:0:b0:3da:3a9a:ef5d with SMTP id 76-20020a81094f000000b003da3a9aef5dmr29243888ywj.504.1670436196274; Wed, 07 Dec 2022 10:03:16 -0800 (PST) MIME-Version: 1.0 References: <20221129004551.2213723-1-jcmvbkbc@gmail.com> In-Reply-To: <20221129004551.2213723-1-jcmvbkbc@gmail.com> From: Max Filippov Date: Wed, 7 Dec 2022 10:03:05 -0800 Message-ID: Subject: Re: [PATCH v2 0/2] gcc: xtensa: allow dynamic configuration To: gcc-patches@gcc.gnu.org Cc: Ian Lance Taylor , Alexey Lapshin Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Nov 28, 2022 at 4:46 PM Max Filippov wrote: > > 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 Series regtested for target=xtensa-linux-uclibc, no new regressions. Committed to master. -- Thanks. -- Max