| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The COFF linker and the ELF linker have long had similar but separate
Error.h and Error.cpp files to implement error handling. This change
introduces new error handling code in Common/ErrorHandler.h, changes the
COFF and ELF linkers to use it, and removes the old, separate
implementations.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits
Differential Revision: https://reviews.llvm.org/D39259
llvm-svn: 316624
|
|
|
|
|
|
|
|
|
| |
link.exe supports this option to convert warnings into errors, and it's
useful to support in LLD as well.
Differential Revision: https://reviews.llvm.org/D39148
llvm-svn: 316502
|
|
|
|
|
|
|
|
|
| |
Now that we have our own implementation of cvtres, we can add resource
files directly to the linkrepro.
Differential Revision: https://reviews.llvm.org/D38974
llvm-svn: 315954
|
|
|
|
|
|
|
|
|
|
|
| |
Without this, /linkrepro would create an invalid tar file.
No tests because this requires Windows and the linkrepro tests
require not-Windows.
Differential Revision: https://reviews.llvm.org/D38973
llvm-svn: 315948
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previous would throw warning whenever libxml2 is not installed. Now
only give this warning if merging manifest fails.
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37240
llvm-svn: 312604
|
|
|
|
|
|
|
|
|
|
| |
This ports https://reviews.llvm.org/D19425 from clang /
https://reviews.llvm.org/D22015 from the ELF port to COFF lld. This can be
useful when linking COFF files on a posix host.
https://reviews.llvm.org/D37452
llvm-svn: 312594
|
|
|
|
|
|
|
|
|
|
|
| |
Looks like raw_string_ostream is buffered. If we do not call `flush`
nor `str`, it is not guaranteed that a result string has all characters
that were written to it.
It wasn't failing on buildbots, but I could reproduce the issue on my
Windows workstation.
llvm-svn: 312577
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
ArgParser created an instance of COFFOptTable on stack to use it to
parser command line arguments. Parsed arguments were then returned from
the function as InputArgList. This was safe because InputArgList referred
only statically-allocated InfoTable.
That is not a safe assumption after https://reviews.llvm.org/D36782,
which changes the type of its internal table from ArrayRef to std::vector.
To make lld work with that patch, we need to keep an instance of
COFFOptTable at least as long as an InputArgList is alive. This patch
does that.
Reviewers: yamaguchi
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37217
llvm-svn: 311930
|
|
|
|
| |
llvm-svn: 311518
|
|
|
|
|
|
| |
a std::move() isn't needed here as the object is a temporary.
llvm-svn: 311430
|
|
|
|
|
|
|
|
|
|
| |
Summary: Now that the llvm-mt manifest merging libraries are complete, we may use them to merge manifests instead of needing to shell out to mt.exe.
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D36255
llvm-svn: 311424
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are emitted for comm symbols in object files, when targeting
a GNU environment.
Alternatively, just ignore them since we already align CommonChunk
to the natural size of the content (up to 32 bytes). That would only
trade away the possibility to overalign small symbols, which doesn't
sound like something that might not need to be handled?
Differential Revision: https://reviews.llvm.org/D36304
llvm-svn: 310871
|
|
|
|
|
|
|
| |
Matches link.exe
https://reviews.llvm.org/D35872
llvm-svn: 309231
|
|
|
|
| |
llvm-svn: 308526
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
resource library.""""
This reverts commit 147f45ff24456aea59575fa4ac16c8fa554df46a.
Revert "Revert "Revert "Revert "Replace trivial use of external rc.exe by writing our own .res file.""""
This reverts commit 61a90a67ed54a1f0dfeab457b65abffa129569e4.
The patches were intially reverted because they were causing a failure
on CrWinClangLLD. Unfortunately, this was done haphazardly and didn't
compile, so the revert was reverted again quickly to fix this. One that
was done, the revert of the revert was itself reverted. This allowed me
to finally fix the actual bug in r307452. This patch re-enables the
code path that had originally been causing the bug, now that it (should)
be fixed.
llvm-svn: 307460
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
library."""
This reverts commit ae21ee0b6cacbc1efaf4d42502e71da2f0eb45c3.
The initial revert was done in order to prevent ongoing errors on
chromium bots such as CrWinClangLLD. However, this was done haphazardly
and I didn't realize there were test and compilation failures, so this
revert was reverted. Now that those have been fixed, we can revert the
revert of the revert.
llvm-svn: 307227
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
our own .res file."""
This reverts commit 5fecbbbe5049665d86834cf69d8f75db4f392308.
The initial revert was done in order to prevent ongoing errors on
chromium bots such as CrWinClangLLD. However, this was done haphazardly
and I didn't realize there were test and compilation failures, so this
revert was reverted. Now that those have been fixed, we can revert the
revert of the revert.
llvm-svn: 307226
|
|
|
|
|
|
|
|
| |
.res file.""
This reverts commit 8c8dce3b8f15d6ebaefc35ce88f15a85c8cdbd6e.
llvm-svn: 307191
|
|
|
|
|
|
|
|
| |
This reverts commit 165e578e47f1cd38191120aad23a9020fb5476dd.
Forgot to run tests on this.
llvm-svn: 307190
|
|
|
|
|
|
|
|
|
| |
This reverts commit 600d52c278e123dd08bee24c1f00932b55add8de.
This patch still seems to break CrWinClangLLD, reverting until I can
find root problem.
llvm-svn: 307189
|
|
|
|
|
|
|
|
|
| |
This patch still seems to break CrWinClangLLD, reverting this once more
until I can discover root problem.
This reverts commit 3dbbc8ce43be50ffde2b1c655c6d3a25796fe78b.
llvm-svn: 307188
|
|
|
|
|
|
|
|
|
| |
A plain empty entry point function that returns 0 seems to produce
a binary that loads and runs fine in wine.
Differential Revision: https://reviews.llvm.org/D34833
llvm-svn: 306963
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.res file.""
Summary:
This reverts commit 51931072a7c9a52540baf76fc30ef391d2529a2f.
This revert was originally done because the integrations of the new
WindowsResource library into LLD was causing error in chromium, due to
bugs in how resource sections were handled. These bugs were fixed,
meaning that the features may be reintegrated.
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D34922
llvm-svn: 306941
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit d4c7e9fc63c10dbab0c30186ef8575474a704496.
This is done in order to address the failure of CrWinClangLLD etc. bots.
These throw an error of "side-by-side configuration is incorrect" during
compilation, which sounds suspiciously related to these manifest
changes.
Revert "Switch external cvtres.exe for llvm's own resource library."
This reverts commit 71fe8ef283a9dab9a3f21432c98466cbc23990d1.
llvm-svn: 306618
|
|
|
|
| |
llvm-svn: 306323
|
|
|
|
|
|
|
|
|
| |
This patch removes the dependency on the external rc.exe tool by writing
a simple .res file using our own library. In this patch I also added an
explicit definition for the .res file magic. Furthermore, I added a
unittest for embeded manifests and fixed a bug exposed by the test.
llvm-svn: 306311
|
|
|
|
|
|
|
|
|
|
| |
The option numbers in the macro were off by one which
leads to some confusion. There are actually 12 arguments
to this macro.
Differential Revision: https://reviews.llvm.org/D34413
llvm-svn: 305823
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is patch for GSoC project, bash-completion for clang.
To use this on bash, please run `source clang/utils/bash-autocomplete.sh`.
bash-autocomplete.sh is code for bash-completion.
In this patch, Options.td was mainly changed in order to add value class
in Options.inc.
llvm-svn: 305805
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Have writeCOFFWriter return Expected<unique_ptr> instead of requiring being passed an uninitialized unique_ptr.
Reviewers: zturner, ruiu
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D34307
llvm-svn: 305730
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch, I flip the switch in DriverUtils from using the external
cvtres.exe tool to using the Windows Resource library in llvm.
I also fixed a bug where .rsrc sections were marked as discardable
memory and therefore were placed in the wrong order in the final PE.
Furthermore, I modified WindowsResource to write the coff directly to a
memory buffer instead of to file, also had it use the machine types
already declared in COFF.h instead creating my own enum.
Finally, I flipped the switch to allow all unit tests that had
previously run only on windows due to a winres dependency to run
cross-platform.
Reviewers: zturner, ruiu
Subscribers: llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D34265
llvm-svn: 305592
|
|
|
|
|
|
|
|
|
|
| |
When link is invoked with `/def:` and no input files, it behaves as if
`lib.exe` was invoked. Emulate this behaviour, generating the import
library from the def file that was passed. Because there is no input to
actually generate the dll, we simply process the def file early and exit
once we have created the import library.
llvm-svn: 305502
|
|
|
|
|
|
|
|
|
| |
We've been using make<> to allocate new objects in ELF. We have
the same function in COFF, but we didn't use it widely due to
negligence. This patch uses the function in COFF to close the gap
between ELF and COFF.
llvm-svn: 303357
|
|
|
|
|
|
|
|
|
| |
"_LINK_" environment varaible should be appended to the command line.
https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx
Fixes https://bugs.llvm.org/show_bug.cgi?id=32756
llvm-svn: 301264
|
|
|
|
|
|
|
|
| |
The CONSTANT export type is marked as obsolete, but link still supports
this. Furthermore, WinObjC uses this for certain exports. Add support
for this export type.
llvm-svn: 301013
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Fixes PR32689: /msvclto creates response files with lines
that are too long for msvc's linker (LNK1170).
Reviewers: hans, rnk, ruiu
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D32185
llvm-svn: 300612
|
|
|
|
|
|
|
| |
Previously, bitcode files in library paths were passed to the MSVC linker.
This patch strips them.
llvm-svn: 295913
|
|
|
|
|
|
|
|
| |
I added this log message to test the /msvclto option, but
this output might confuse FileCheck. This patch attempts to fix
it by removing it.
llvm-svn: 295793
|
|
|
|
|
|
|
|
|
| |
LLD is a multi-threaded program. errs() or outs() are not guaranteed
to be thread-safe (they are actually not).
LLD's message(), log() or error() are thread-safe. We should use them.
llvm-svn: 295787
|
|
|
|
|
|
|
|
|
|
|
| |
This patch defines a new command line option, /MSVCLTO, to LLD.
If that option is given, LLD invokes link.exe to link LTO-generated
object files. This is hacky but useful because link.exe can create
PDB files.
Differential Revision: https://reviews.llvm.org/D29526
llvm-svn: 294234
|
|
|
|
|
|
|
|
|
|
|
|
| |
I thought for a while about how to remove it, but it looks like we
can just copy the file for now. Of course I'm not happy about that,
but it's just less than 50 lines of code, and we already have
duplicate code in Error.h and some other places. I want to solve
them all at once later.
Differential Revision: https://reviews.llvm.org/D27819
llvm-svn: 290062
|
|
|
|
| |
llvm-svn: 289289
|
|
|
|
|
|
|
|
|
| |
This ports the ELF linker's symbol table design, introduced in r268178,
to the COFF linker.
Differential Revision: http://reviews.llvm.org/D21166
llvm-svn: 289280
|
|
|
|
| |
llvm-svn: 289104
|
|
|
|
| |
llvm-svn: 289102
|
|
|
|
| |
llvm-svn: 288112
|
|
|
|
| |
llvm-svn: 288111
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
createManifestRes was generating a MemoryBuffer from a TemporaryFile,
keeping the data but removing the file, before passing the file path
to CVTRES.exe, leading to the following error:
CVTRES : fatal error CVT1101: cannot open 'C:\Users\user\AppData\
Local\Temp\lld-output-resource-bfee19.res' for reading
With this, we instead create a new TemporaryFile before passing it to cvtres.
Patch from Rudy Pons!
llvm-svn: 287034
|
|
|
|
| |
llvm-svn: 283290
|
|
|
|
| |
llvm-svn: 282964
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we created temporary files using llvm::sys::fs::createTemporaryFile
and removed them using llvm::FileRemover. This is error-prone as it is easy to
forget creating FileRemover instances after creating temporary files.
There is actually a temporary file leak bug.
This patch introduces a new class, TemporaryFile, to manage temporary files
in the RAII style.
Differential Revision: https://reviews.llvm.org/D24176
llvm-svn: 280510
|