On Mon, May 22, 2017 at 2:09 PM, Max Filippov <jcmvb...@gmail.com> 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  <jcmvb...@gmail.com>
> 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.

Reply via email to