[all-commits] [llvm/llvm-project] 34a44b: [lld/COFF] Handle -start-lib / -end-lib better in ...

Nico Weber via All-commits all-commits at lists.llvm.org
Tue Dec 17 08:30:36 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34a44b20888479cf934014e3aa85c563725df69a
      https://github.com/llvm/llvm-project/commit/34a44b20888479cf934014e3aa85c563725df69a
  Author: Nico Weber <thakis at chromium.org>
  Date:   2024-12-17 (Tue, 17 Dec 2024)

  Changed paths:
    M lld/COFF/Driver.cpp
    M lld/COFF/Driver.h
    M lld/test/COFF/linkrepro.test

  Log Message:
  -----------
  [lld/COFF] Handle -start-lib / -end-lib better in /reproduce: output (#119752)

Previously, we'd collect all input files in Driver::filePaths, and then
write filePaths after all other flags in
createResponseFile(). This meant that `-start-lib foo.obj -end-lib`
would be written as `-start-lib -end-lib foo.obj`, changing semantics.

Instead, remove Driver::filePaths, and handle things that fed into it
directly:

* OPT_INPUT is now handled in the same way as other flags, so that we
now get `-start-lib foo.obj -end-lib` in response.txt as desired. Add a
test for -start-lib / -end-lib and /reproduce:.

* OPT_wholearchive_file needs explicit handling now -- but before, this
was buggy as well: We'd put the flag without a rewritten path in
response.txt, but also the rewritten input file without wholearchive
semantics via filePaths. So this commit makes --whole-archive work with
/reproduce: too, and adds test coverage.

* /defaultlib:foo is now written as /defaultlib:foo into response.txt,
instead of writing the resolved path previously. While response.txt
looks slightly differently, both should have the same semantics, and
this should be mostly a no-op. (It does require updating a test.)

* /defaultlib: from .drectve sections are no longer recorded in
response.txt. This seems like a progression -- in the non-repro case
they come from .obj files, so they should come (only) from there in the
repro case too. This adds test coverage for this case.

Makes createResponseFile() look more like the versions in the ELF and
MachO ports too.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list