-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcc: rename enablePlugin to enablePlugins #217978
Conversation
In 6812dd9 I mistakenly had the implication order reversed. This commit corrects that mistake. The original assertion (which is correct) was the following, which asserts that if you enable the GDB plugin, you must enable plugins generally (there is shared infrastructure): ``` assert enableGdbPlugin -> enablePlugin; ``` When the option name was changed to `disableGdbPlugin`, I incorrectly wrote: ``` assert disableGdbPlugin -> enablePlugin; ``` And then again incorrectly wrote: ``` assert disableGdbPlugin -> !enablePlugin; ``` This commit uses the correct equivalent for the first statement, which is the contrapositive: ``` assert !enablePlugin -> disableGdbPlugin; ```
This commit implements @SuperSandro2000's suggestion that `enablePlugins` is a better name for this option: #216237 (comment) This makes a lot of sense. The option does not enable one specific plugin, and in fact does not necessarily enable *all* plugins either. Rather, it enables the general infrastructure for gcc plugins. For example, you can combine `--enable-plugins` with `--disable-libcc1` (which is the GDB plugin).
@@ -174,7 +174,7 @@ let | |||
then ["--enable-multilib" "--disable-libquadmath"] | |||
else ["--disable-multilib"]) | |||
++ lib.optional (!enableShared) "--disable-shared" | |||
++ lib.singleton (lib.enableFeature enablePlugin "plugin") | |||
++ lib.singleton (lib.enableFeature enablePlugins "plugin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While gcc/gcc
has only --enable-plugin
m4
code contains both flags:
$ git grep plugin |& fgrep AC_ARG
config/gcc-plugin.m4: AC_ARG_ENABLE(plugin,
config/plugins.m4: AC_ARG_ENABLE([plugins],
It is really scary that enablePlugins
enable not the one you expect from the name.
I find enablePlugin
and enablePlugins
equally non-descriptive for what it does. But at least enablePlugin
matches the configure option. There are at least 3 things I know of that gcc
has to do with plugins:
liblto_plugin.so
:binutils
linker plugin- plugin API
libcc1plugin.so
I suggest picking something more distinctive across the 3. Maybe enablePluginApi
? Or not do the rename at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, I didn't know that there was an --enable-plugin
in there.
Includes (to prevent merge conflicts):
Description of changes
This commit implements @SuperSandro2000's suggestion that
enablePlugins
is a better name for this option:#216237 (comment)
This makes a lot of sense. The option does not enable one specific plugin, and in fact does not necessarily enable all plugins either. Rather, it enables the general infrastructure for gcc plugins.
For example, you can combine
--enable-plugins
with--disable-libcc1
(which is the GDB plugin).Cc: @trofi @SuperSandro2000
Things done
nix-instantiate -A stdenv
)