<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54891>54891</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[llvm-ar question] file too small to be an archive
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
0x7cc
</td>
</tr>
</table>
<pre>
my test code:
```cpp
#include <stdint.h>
#include <stddef.h>
#if defined(__clang__) || defined(__GNUC__)
size_t
vmcs_set_field(size_t field, size_t value)
{
size_t eflags;
__asm__ __volatile__("vmwrite %[value], %[field]" : : [field] "r"(field), [value] "r"(value));
__asm__("\n pushf"
"\n pop %[to]"
: [to] "=r"(eflags));
return eflags & (size_t)0b1000001; // zf and cf
}
#endif
```
compile:
```shell
clang -c -target x86_64-pc-linux-gnu vmx.cxx -ffreestanding -fno-cxx-exceptions -fno-exceptions -fno-rtti -fno-unwind-tables -nogpulib -nostdlib -nostdlibinc -o vmx.o -std=c++17 -O3
```
generate static library:
```shell
llvm-ar rcs --format=gnu vmx.o
```
```
C:\msys64\clang64\bin/llvm-ar.exe: error: unable to load 'x86_64-pc-linux-gnu/vmx.o': file too small to be an archive
```
I tried to write more code, but still getting this error.
I don't know what size it needs to be to qualify.
llvm-ar version in msys2:
```shell
$ llvm-ar --version
LLVM (http://llvm.org/):
LLVM version 13.0.1
Optimized build.
Default target: x86_64-w64-windows-gnu
Host CPU: znver1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFVEmTmzgU_jX48goKhDH2wYduO1tVZjKX5EoJIYwSIRFJeOlfP08sttud6XGJ7qe3fm9TqavLtr2A49YB0xUP0qcg3gfxU7CKx8O6buKQVCgm-4pDkO6sq4RyUROkH_5DXPH6XnxVqgElQvEqIOuiYJKqQ1EEZANBvsPzSvrp7--7QXjvxIoXXriRPrbMFpa7ohZceptRCNN1B9P9SGXPb37y55GAWc5rS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