-
Notifications
You must be signed in to change notification settings - Fork 15
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
excessive slowdown linking RISCV with --gc-sections #1881
Comments
I'm fine taking the |
FWIW, just logging what the "orphan sections" are: diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 777f1f2f85f9..958e926042fb 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -823,6 +823,7 @@ void LinkerScript::addOrphanSections() {
auto add = [&](InputSectionBase *s) {
if (s->isLive() && !s->parent) {
orphanSections.push_back(s);
+ llvm::errs() << "XXX: " << s->name << "\n";
StringRef name = getOutputSectionName(s);
if (config->unique) { produces a repeating spew of:
|
So we should be setting |
Thanks. I'm trying to sort out some other issue in my staging tree so it might take a bit to get to, but I'll be working this weekend either way so it shouldn't be too long. |
Linking allyesconfig with ld.lld-17 with CONFIG_DEAD_CODE_ELIMINATION=y takes hours. Assuming this is a performance regression that can be fixed, tentatively disable this for now so that allyesconfig builds don't start timing out. If and when there's a fix to ld.lld, this can be converted to a version check instead so that users of older but still supported versions of ld.lld don't hurt themselves by enabling CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y. Link: ClangBuiltLinux#1881 Link: https://lore.kernel.org/linux-riscv/ZJXTwqZIkXLxXaSi@google.com/ Reported-by: Palmer Dabbelt <palmer@dabbelt.com> Suggested-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
(This might be related to lld not discarding locals by default as bfd does; -Wl,-X) |
Reported-by: Palmer Dabbelt palmer@dabbelt.com
via: https://lore.kernel.org/linux-riscv/mhng-57559277-afaa-4a85-a3ad-b9be6dba737f@palmer-ri-x1c9/
If I apply that patchset to mainline, then build allyesconfig, it seems to take hours to link the RISCV kernel.
@nathanchance suggested adding a patch on top:
or:
cc @palmer-dabbelt @MaskRay @nathanchance
The text was updated successfully, but these errors were encountered: