<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Object/ArchiveWriter.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[Object][Archive] Recompute headers and symbol map when switching from COFF to GNU64 (#160606)</title>
<updated>2025-09-28T18:17:01+00:00</updated>
<author>
<name>Jacek Caban</name>
<email>jacek@codeweavers.com</email>
</author>
<published>2025-09-28T18:17:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=48a6f2f85c8269d8326c185016801a4eb8d5dfd6'/>
<id>48a6f2f85c8269d8326c185016801a4eb8d5dfd6</id>
<content type='text'>
COFF format has no 64-bit version, so we use GNU64 instead. Since this
changes the headers, we need to recalculate everything.

Fixes #160112.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
COFF format has no 64-bit version, so we use GNU64 instead. Since this
changes the headers, we need to recalculate everything.

Fixes #160112.</pre>
</div>
</content>
</entry>
<entry>
<title>Triple: Forward declare Twine and remove include (#145685)</title>
<updated>2025-06-26T06:26:04+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2025-06-26T06:26:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fff720d6419b92be068ac4f3ac7e8333a781ee20'/>
<id>fff720d6419b92be068ac4f3ac7e8333a781ee20</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Object] Avoid repeated map lookups (NFC) (#110201)</title>
<updated>2024-09-28T17:03:23+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-09-28T17:03:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=60a6e6fa54b79d0771f36b4f9565cb6b465b7501'/>
<id>60a6e6fa54b79d0771f36b4f9565cb6b465b7501</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Object: Don't error out on malformed bitcode files.</title>
<updated>2024-07-18T23:05:53+00:00</updated>
<author>
<name>pcc</name>
<email>peter@pcc.me.uk</email>
</author>
<published>2024-07-18T23:05:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c675a9be63b67682477e5cbdc01c450f66bbc59a'/>
<id>c675a9be63b67682477e5cbdc01c450f66bbc59a</id>
<content type='text'>
An error reading a bitcode file most likely indicates that the file
was created by a compiler from the future. Normally we don't try to
implement forwards compatibility for bitcode files, but when creating
an archive we can implement best-effort forwards compatibility by
treating the file as a blob and not creating symbol index entries for
it. lld and mold ignore the archive symbol index, so provided that
you use one of these linkers, LTO will work as long as lld or the
gold plugin is newer than the compiler. We only ignore errors if the
archive format is one that is supported by a linker that is known to
ignore the index, otherwise there's no chance of this working so we
may as well error out. We print a warning on read failure so that
users of linkers that rely on the symbol index can diagnose the issue.

This is the same behavior as GNU ar when the linker plugin returns
an error when reading the input file. If the bitcode file is actually
malformed, it will be diagnosed at link time.

Reviewers: MaskRay, dwblaikie, jh7370

Reviewed By: MaskRay, dwblaikie, jh7370

Pull Request: https://github.com/llvm/llvm-project/pull/96848
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An error reading a bitcode file most likely indicates that the file
was created by a compiler from the future. Normally we don't try to
implement forwards compatibility for bitcode files, but when creating
an archive we can implement best-effort forwards compatibility by
treating the file as a blob and not creating symbol index entries for
it. lld and mold ignore the archive symbol index, so provided that
you use one of these linkers, LTO will work as long as lld or the
gold plugin is newer than the compiler. We only ignore errors if the
archive format is one that is supported by a linker that is known to
ignore the index, otherwise there's no chance of this working so we
may as well error out. We print a warning on read failure so that
users of linkers that rely on the symbol index can diagnose the issue.

This is the same behavior as GNU ar when the linker plugin returns
an error when reading the input file. If the bitcode file is actually
malformed, it will be diagnosed at link time.

Reviewers: MaskRay, dwblaikie, jh7370

Reviewed By: MaskRay, dwblaikie, jh7370

Pull Request: https://github.com/llvm/llvm-project/pull/96848
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][object] Expose `writeArchiveToStream` (#98254)</title>
<updated>2024-07-10T04:44:37+00:00</updated>
<author>
<name>Jeff Niu</name>
<email>jeff@modular.com</email>
</author>
<published>2024-07-10T04:44:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5523a473ef3bcb611f2efc6d18f1ca7d9d023591'/>
<id>5523a473ef3bcb611f2efc6d18f1ca7d9d023591</id>
<content type='text'>
This internal helper is a useful API to have, when one wants to write an
archive directly to some other preallocated stream.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This internal helper is a useful API to have, when one wants to write an
archive directly to some other preallocated stream.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-ar][Object][COFF] Add support for EC symbols to llvm-ar. (#85230)</title>
<updated>2024-03-20T12:39:23+00:00</updated>
<author>
<name>Jacek Caban</name>
<email>jacek@codeweavers.com</email>
</author>
<published>2024-03-20T12:39:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=254bfe955ac3deba08dbbe490ef3cf5004a3bd6e'/>
<id>254bfe955ac3deba08dbbe490ef3cf5004a3bd6e</id>
<content type='text'>
Make writeArchive IsEC argument optional and use EC symbol map when indicated by input object files.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make writeArchive IsEC argument optional and use EC symbol map when indicated by input object files.</pre>
</div>
</content>
</entry>
<entry>
<title>[Object][Archive][NFC] Create all symbolic files objects before calculating offsets. (#85229)</title>
<updated>2024-03-15T11:38:41+00:00</updated>
<author>
<name>Jacek Caban</name>
<email>jacek@codeweavers.com</email>
</author>
<published>2024-03-15T11:38:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c7fc95baae8e662506c22511b29e1ad86b910248'/>
<id>c7fc95baae8e662506c22511b29e1ad86b910248</id>
<content type='text'>
This is refactoring preparing to move UseECMap computation to the
archive writer. We currently require writeArchive caller to pass that.
This is not practical for llvm-ar, which currently interprets at most
one passed object. For a reliable UseECMap, we need to interpret all
symbolic objects: we may have, for example, a list of x86_64 files
followed by aarch64 file, which indicates that we should use EC map for
x86_64 objects.

This commit interprets symbolic files in a separated pass, which will be
a convenient place to implement UseECMap computation in the follow up.
It also makes accessing the next member for AIX big archive offset
computation a bit easier.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is refactoring preparing to move UseECMap computation to the
archive writer. We currently require writeArchive caller to pass that.
This is not practical for llvm-ar, which currently interprets at most
one passed object. For a reliable UseECMap, we need to interpret all
symbolic objects: we may have, for example, a list of x86_64 files
followed by aarch64 file, which indicates that we should use EC map for
x86_64 objects.

This commit interprets symbolic files in a separated pass, which will be
a convenient place to implement UseECMap computation in the follow up.
It also makes accessing the next member for AIX big archive offset
computation a bit easier.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-ar] Use COFF archive format for COFF targets. (#82898)</title>
<updated>2024-03-13T12:27:20+00:00</updated>
<author>
<name>Jacek Caban</name>
<email>jacek@codeweavers.com</email>
</author>
<published>2024-03-13T12:27:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=203757776826cfd164c537048ec90f5ada50cae2'/>
<id>203757776826cfd164c537048ec90f5ada50cae2</id>
<content type='text'>
Detect COFF files by default and allow specifying it with --format
argument.

This is important for ARM64EC, which uses a separated symbol map for EC
symbols. Since K_COFF is mostly compatible with K_GNU, this shouldn't
really make a difference for other targets.

This originally landed as #82642, but was reverted due to test failures
in tests using no symbol table. Since COFF symbol can't express it,
fallback to GNU format in that case.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Detect COFF files by default and allow specifying it with --format
argument.

This is important for ARM64EC, which uses a separated symbol map for EC
symbols. Since K_COFF is mostly compatible with K_GNU, this shouldn't
really make a difference for other targets.

This originally landed as #82642, but was reverted due to test failures
in tests using no symbol table. Since COFF symbol can't express it,
fallback to GNU format in that case.</pre>
</div>
</content>
</entry>
<entry>
<title>[Arm64EC] Copy import descriptors to the EC Map (#84834)</title>
<updated>2024-03-12T21:10:49+00:00</updated>
<author>
<name>Daniel Paoliello</name>
<email>danpao@microsoft.com</email>
</author>
<published>2024-03-12T21:10:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1a6ec906fb3781c2fc98979ec37a2a76479b0b08'/>
<id>1a6ec906fb3781c2fc98979ec37a2a76479b0b08</id>
<content type='text'>
As noted in &lt;https://github.com/llvm/llvm-project/pull/78537&gt;, MSVC
places import descriptors in both the EC and regular map - that PR moved
the descriptors to ONLY the regular map, however this causes linking
errors when linking as Arm64EC:

```
bcryptprimitives.lib(bcryptprimitives.dll) : error LNK2001: unresolved external symbol __IMPORT_DESCRIPTOR_bcryptprimitives (EC Symbol)
```

This change copies import descriptors from the regular map to the EC
map, which fixes this linking error.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As noted in &lt;https://github.com/llvm/llvm-project/pull/78537&gt;, MSVC
places import descriptors in both the EC and regular map - that PR moved
the descriptors to ONLY the regular map, however this causes linking
errors when linking as Arm64EC:

```
bcryptprimitives.lib(bcryptprimitives.dll) : error LNK2001: unresolved external symbol __IMPORT_DESCRIPTOR_bcryptprimitives (EC Symbol)
```

This change copies import descriptors from the regular map to the EC
map, which fixes this linking error.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][Support] Add and use errnoAsErrorCode (#84423)</title>
<updated>2024-03-09T07:30:33+00:00</updated>
<author>
<name>Michael Spencer</name>
<email>bigcheesegs@gmail.com</email>
</author>
<published>2024-03-09T07:30:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ba13fa2a5d57581bff1a7e9322234af30f4882f6'/>
<id>ba13fa2a5d57581bff1a7e9322234af30f4882f6</id>
<content type='text'>
LLVM is inconsistent about how it converts `errno` to `std::error_code`.
This can cause problems because values outside of `std::errc` compare
differently if one is system and one is generic on POSIX systems.

This is even more of a problem on Windows where use of the system
category is just wrong, as that is for Windows errors, which have a
completely different mapping than POSIX/generic errors. This patch fixes
one instance of this mistake in `JSONTransport.cpp`.

This patch adds `errnoAsErrorCode()` which makes it so people do not
need to think about this issue in the future. It also cleans up a lot of
usage of `errno` in LLVM and Clang.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LLVM is inconsistent about how it converts `errno` to `std::error_code`.
This can cause problems because values outside of `std::errc` compare
differently if one is system and one is generic on POSIX systems.

This is even more of a problem on Windows where use of the system
category is just wrong, as that is for Windows errors, which have a
completely different mapping than POSIX/generic errors. This patch fixes
one instance of this mistake in `JSONTransport.cpp`.

This patch adds `errnoAsErrorCode()` which makes it so people do not
need to think about this issue in the future. It also cleans up a lot of
usage of `errno` in LLVM and Clang.</pre>
</div>
</content>
</entry>
</feed>
