-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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/common: add disableGdbPlugin option #216237
Conversation
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.
LGTM. Can you add a single sentence for commit description where it could be useful?
Sorry about that, fixed now. |
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.
Apart from one flag inversion the change looks good.
Can you add a 1-sentence Why
motivation description as well? A few reasons I could make up are:
- cut down on build times (does it save a lot?)
- does the default value cause some other problems during bootstrap? (which? extra depends? something probes it? some c++-specific failures?)
- just a handy switch to flip to debug some gcc aspect?
- something else?
Squashed, with a more detailed commmit message explaining the motivation. This raises the question of whether or not the behavior which causes us to need Also, since libcc1 is considered unmaintained there would have to be a decision about whether the benefit of a fix upstream is worth the risk of breaking things that nobody is particularly motivated to fix. |
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.
Ah, early linking of libstdc++
makes sense. Yeah, disabling it early if needed is the simplest.
Generally, I saw the --with-stage1-libs=
flag that might allow a similar kind of tweaking. But it's probably more fragile as it needs an exhaustive (AFAIU) list of libraries upfront.
@@ -26,6 +27,7 @@ | |||
, disableBootstrap ? stdenv.targetPlatform != stdenv.hostPlatform | |||
}: | |||
|
|||
assert disableGdbPlugin -> enablePlugin; |
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.
Worth removing added assert? It should be fine to disable both.
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.
Dammit, that should be !enablePlugin
. Thank you for noticing.
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.
Dammit, that should be !enablePlugin
. Thank you for noticing.
This commit adds an option `disableGdbPlugin` which controls whether or not the plugin *for* GDB will be built. This plugin contains a copy of `gcc`. The configure flag that this option controls is called `--disable-libcc1`. This flag name is slightly confusing: it is used only by GDB (and apparently unmaintained), yet the flag name does not mention GDB. This is why the option name is different from the configure flag name. The primary motivation for this commit is to allow the following PR (which is not yet merged) to pass `--disable-libcc1` when building the final native (build=host=target) compiler as part of the stdenv bootstrap: #209870 We need to `--disable-libcc1` in this scenario because gcc's build machinery links `libcc1` against the `libstdc++` that is part of the *compiler used to compile gcc*, rather than against the `libstdc++` that is built *by* gcc. In an FHS distribution this distinction is not terribly important because dynamically linked libraries are late-bound (ld.so resolution). However in nixpkgs this causes a reference back to the bootstrapFiles to leak all the way through to the final stdenv. More details can be found in the comment in `pkgs/stdenv/linux/default.nix` of the PR linked above. Co-authored-by: Sandro <[email protected]>
Dammit, I messed this up again: |
Caused #342904 |
Description of changes
gcc/common: add disableGdbPlugin option
This commit adds an option
disableGdbPlugin
which controls whetheror not the plugin for GDB, which contains a copy of
gcc
, will bebuilt.
The configure flag that this option controls is called
--disable-libcc1
. This is slightly confusing, because its is usedonly by GDB (and apparently unmaintained), yet its name does not
mention GDB. This is why the option name is different from the
configure flag name.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)