From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65914 invoked by alias); 25 May 2017 18:24:40 -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 65240 invoked by uid 89); 25 May 2017 18:24:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=reusable X-HELO: mail-wm0-f66.google.com Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 May 2017 18:24:17 +0000 Received: by mail-wm0-f66.google.com with SMTP id d127so54911902wmf.1 for ; Thu, 25 May 2017 11:24:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Cvcvq8cVJFwSVikhDKN/gHbvVvdE4ZfzmI8NPCU/448=; b=Yb3iUXL6EuayflLjaB/Cg3YO+fOoNRZgJhsrzzH7V2lCoRIGPtvVcDoK8PxKSHckR0 sRUDGwRzIa2bUnyX/ZEglBaAT6x9LZORxJIX2lwoDyS4HwsnzcCB5rQOZTjayblYChjA e+9QEkEr7gR4/7/4lPCIXU5Er6u64pbh4NQ2Nc9bsNeXhc5Gc0kT9VSiuVBZcko3pnKS rQeQy9vJ5ftTWDCMSDALgAZoGGehfAzIyU8KiOlhzgzTKffokdXHu6Ny1wn7Hr4coQN7 6hBWiKQH3pXdWKFETGv4ECj+8kVXNpmrAKVKt7CuTYYbSjaTvXq79hoEWOVAIMsbkeSn jy7w== X-Gm-Message-State: AODbwcC9SgKDpe16B4D+gf/4gGcQXr/YJHXnIDOrXG8NzkBz/dyqRdq1 Ax7RtxXMgI5wMvyIHa+JrboPS0IOmQ== X-Received: by 10.223.161.70 with SMTP id r6mr23727104wrr.65.1495736658571; Thu, 25 May 2017 11:24:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.159.139 with HTTP; Thu, 25 May 2017 11:24:18 -0700 (PDT) In-Reply-To: <1495487362-18969-3-git-send-email-jcmvbkbc@gmail.com> References: <1495487362-18969-1-git-send-email-jcmvbkbc@gmail.com> <1495487362-18969-3-git-send-email-jcmvbkbc@gmail.com> From: "augustine.sterling@gmail.com" Date: Thu, 25 May 2017 18:25:00 -0000 Message-ID: Subject: Re: [RFC 2/5] gcc: xtensa: make configuration dynamic To: Max Filippov Cc: "gcc-patches@gcc.gnu.org" , "linux-xtensa@linux-xtensa.org" Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2017-05/txt/msg01979.txt.bz2 On Mon, May 22, 2017 at 2:09 PM, Max Filippov wrote: > Now that XCHAL_* macros don't have to be preprocessor constants add > include/xtensa-dynconfig.h that defines them as fields of a structure > returned from the xtensa_get_config function. > Define that structure and fill it with default parameter values > specified in the include/xtensa-config.h. > Define reusable function xtensa_load_config that tries to load > configuration and return an address of an exported object from it. > Define the function xtensa_get_config that uses xtensa_load_config to > get structure xtensa_config, either dynamically configured or the > default. > > 2017-05-22 Max Filippov > gcc/ > * Makefile.in (PLUGIN_HEADERS): Add include/xtensa-dynconfig.h. > * config.gcc (xtensa*-*-*): Add xtensa-config.o to extra_objs. > * gcc/config/xtensa/t-xtensa (xtensa-config.o): New rule. > * gcc/config/xtensa/xtensa-config.c: New file. > * gcc/config/xtensa/xtensa.h (xtensa-config.h): Replace #include > with xtensa-dynconfig.h > (XCHAL_HAVE_MUL32_HIGH, XCHAL_HAVE_RELEASE_SYNC, > XCHAL_HAVE_S32C1I, XCHAL_HAVE_THREADPTR, > XCHAL_HAVE_FP_POSTINC): Drop definitions. This almost certainly should go through the normal gcc plugin mechanism instead of the hand-rolled one you have here. https://gcc.gnu.org/onlinedocs/gccint/Plugins.html#Plugins If there is a reason it can't (and I'm not sufficiently familiar with the issues here), then you need to ensure that the various protections enforced by the normal plugin mechanism is used--and someone more knowledgeable than me needs to review it. Please note that by using a plugin mechanism, there are licensing issues that come into play, that are different from the usual licensing issues. I would be absolutely sure that you all are OK with how the runtime exception applies to this new situation.