1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>llvm-ar - LLVM archiver — LLVM 13 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="llvm-cxxfilt - LLVM symbol name demangler" href="llvm-cxxfilt.html" />
<link rel="prev" title="llvm-addr2line - a drop-in replacement for addr2line" href="llvm-addr2line.html" />
<style type="text/css">
table.right { float: right; margin-left: 20px; }
table.right td { border: 1px solid #ccc; }
</style>
</head><body>
<div class="logo">
<a href="../index.html">
<img src="../_static/logo.png"
alt="LLVM Logo" width="250" height="88"/></a>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="llvm-cxxfilt.html" title="llvm-cxxfilt - LLVM symbol name demangler"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="llvm-addr2line.html" title="llvm-addr2line - a drop-in replacement for addr2line"
accesskey="P">previous</a> |</li>
<li><a href="https://llvm.org/">LLVM Home</a> | </li>
<li><a href="../index.html">Documentation</a>»</li>
<li class="nav-item nav-item-1"><a href="../Reference.html" >Reference</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">LLVM Command Guide</a> »</li>
<li class="nav-item nav-item-this"><a href="">llvm-ar - LLVM archiver</a></li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3>Documentation</h3>
<ul class="want-points">
<li><a href="https://llvm.org/docs/GettingStartedTutorials.html">Getting Started/Tutorials</a></li>
<li><a href="https://llvm.org/docs/UserGuides.html">User Guides</a></li>
<li><a href="https://llvm.org/docs/Reference.html">Reference</a></li>
</ul>
<h3>Getting Involved</h3>
<ul class="want-points">
<li><a href="https://llvm.org/docs/Contributing.html">Contributing to LLVM</a></li>
<li><a href="https://llvm.org/docs/HowToSubmitABug.html">Submitting Bug Reports</a></li>
<li><a href="https://llvm.org/docs/GettingInvolved.html#mailing-lists">Mailing Lists</a></li>
<li><a href="https://llvm.org/docs/GettingInvolved.html#irc">IRC</a></li>
<li><a href="https://llvm.org/docs/GettingInvolved.html#meetups-and-social-events">Meetups and Social Events</a></li>
</ul>
<h3>Additional Links</h3>
<ul class="want-points">
<li><a href="https://llvm.org/docs/FAQ.html">FAQ</a></li>
<li><a href="https://llvm.org/docs/Lexicon.html">Glossary</a></li>
<li><a href="https://llvm.org/pubs">Publications</a></li>
<li><a href="https://github.com/llvm/llvm-project//">Github Repository</a></li>
</ul>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/CommandGuide/llvm-ar.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="llvm-ar-llvm-archiver">
<h1>llvm-ar - LLVM archiver<a class="headerlink" href="#llvm-ar-llvm-archiver" title="Permalink to this headline">¶</a></h1>
<div class="section" id="synopsis">
<h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">llvm-ar</strong> [-]{dmpqrstx}[abcDilLNoOPsSTuUvV] [relpos] [count] archive [files…]</p>
</div>
<div class="section" id="description">
<h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>The <strong class="program">llvm-ar</strong> command is similar to the common Unix utility,
<strong class="program">ar</strong>. It archives several files, such as objects and LLVM bitcode
files into a single archive library that can be linked into a program. However,
the archive can contain any kind of file. By default, <strong class="program">llvm-ar</strong>
generates a symbol table that makes linking faster because only the symbol
table needs to be consulted, not each individual file member of the archive.</p>
<p>The <strong class="program">llvm-ar</strong> command can be used to <em>read</em> archive files in SVR4,
GNU, BSD and Darwin format, and <em>write</em> in the GNU, BSD, and Darwin style
archive files. If an SVR4 format archive is used with the <a class="reference internal" href="#cmdoption-llvm-ar-arg-r"><code class="xref std std-option docutils literal notranslate"><span class="pre">r</span></code></a>
(replace), <a class="reference internal" href="#cmdoption-llvm-ar-arg-d"><code class="xref std std-option docutils literal notranslate"><span class="pre">d</span></code></a> (delete), <a class="reference internal" href="#cmdoption-llvm-ar-arg-m"><code class="xref std std-option docutils literal notranslate"><span class="pre">m</span></code></a> (move) or <a class="reference internal" href="#cmdoption-llvm-ar-arg-q"><code class="xref std std-option docutils literal notranslate"><span class="pre">q</span></code></a>
(quick update) operations, the archive will be reconstructed in the format
defined by <a class="reference internal" href="#cmdoption-llvm-ar-format"><code class="xref std std-option docutils literal notranslate"><span class="pre">--format</span></code></a>.</p>
<p>Here’s where <strong class="program">llvm-ar</strong> departs from previous <strong class="program">ar</strong>
implementations:</p>
<p><em>The following option is not supported</em></p>
<blockquote>
<div><p>[f] - truncate inserted filenames</p>
</div></blockquote>
<p><em>The following options are ignored for compatibility</em></p>
<blockquote>
<div><p>–plugin=<string> - load a plugin which adds support for other file formats</p>
<p>[l] - ignored in <strong class="program">ar</strong></p>
</div></blockquote>
<p><em>Symbol Table</em></p>
<blockquote>
<div><p>Since <strong class="program">llvm-ar</strong> supports bitcode files, the symbol table it creates
includes both native and bitcode symbols.</p>
</div></blockquote>
<p><em>Deterministic Archives</em></p>
<blockquote>
<div><p>By default, <strong class="program">llvm-ar</strong> always uses zero for timestamps and UIDs/GIDs
to write archives in a deterministic mode. This is equivalent to the
<a class="reference internal" href="#cmdoption-llvm-ar-arg-D"><code class="xref std std-option docutils literal notranslate"><span class="pre">D</span></code></a> modifier being enabled by default. If you wish to maintain
compatibility with other <strong class="program">ar</strong> implementations, you can pass the
<a class="reference internal" href="#cmdoption-llvm-ar-arg-U"><code class="xref std std-option docutils literal notranslate"><span class="pre">U</span></code></a> modifier to write actual timestamps and UIDs/GIDs.</p>
</div></blockquote>
<p><em>Windows Paths</em></p>
<blockquote>
<div><p>When on Windows <strong class="program">llvm-ar</strong> treats the names of archived <em>files</em> in the same
case sensitive manner as the operating system. When on a non-Windows machine
<strong class="program">llvm-ar</strong> does not consider character case.</p>
</div></blockquote>
</div>
<div class="section" id="options">
<h2>OPTIONS<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">llvm-ar</strong> operations are compatible with other <strong class="program">ar</strong>
implementations. However, there are a few modifiers (<a class="reference internal" href="#cmdoption-llvm-ar-arg-L"><code class="xref std std-option docutils literal notranslate"><span class="pre">L</span></code></a>) that are not
found in other <strong class="program">ar</strong> implementations. The options for
<strong class="program">llvm-ar</strong> specify a single basic Operation to perform on the archive,
a variety of Modifiers for that Operation, the name of the archive file, and an
optional list of file names. If the <em>files</em> option is not specified, it
generally means either “none” or “all” members, depending on the operation. The
Options, Operations and Modifiers are explained in the sections below.</p>
<p>The minimal set of options is at least one operator and the name of the
archive.</p>
<div class="section" id="operations">
<h3>Operations<a class="headerlink" href="#operations" title="Permalink to this headline">¶</a></h3>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-d">
<code class="sig-name descname"><span class="pre">d</span></code><code class="sig-prename descclassname"> <span class="pre">[NT]</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-d" title="Permalink to this definition">¶</a></dt>
<dd><p>Delete files from the <code class="docutils literal notranslate"><span class="pre">archive</span></code>. The <a class="reference internal" href="#cmdoption-llvm-ar-arg-N"><code class="xref std std-option docutils literal notranslate"><span class="pre">N</span></code></a> and <a class="reference internal" href="#cmdoption-llvm-ar-arg-T"><code class="xref std std-option docutils literal notranslate"><span class="pre">T</span></code></a> modifiers
apply to this operation. The <em>files</em> options specify which members should be
removed from the archive. It is not an error if a specified file does not
appear in the archive. If no <em>files</em> are specified, the archive is not
modified.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-m">
<code class="sig-name descname"><span class="pre">m</span></code><code class="sig-prename descclassname"> <span class="pre">[abi]</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-m" title="Permalink to this definition">¶</a></dt>
<dd><p>Move files from one location in the <code class="docutils literal notranslate"><span class="pre">archive</span></code> to another. The <a class="reference internal" href="#cmdoption-llvm-ar-arg-a"><code class="xref std std-option docutils literal notranslate"><span class="pre">a</span></code></a>,
<a class="reference internal" href="#cmdoption-llvm-ar-arg-b"><code class="xref std std-option docutils literal notranslate"><span class="pre">b</span></code></a>, and <a class="reference internal" href="#cmdoption-llvm-ar-arg-i"><code class="xref std std-option docutils literal notranslate"><span class="pre">i</span></code></a> modifiers apply to this operation. The <em>files</em>
will all be moved to the location given by the modifiers. If no modifiers are
used, the files will be moved to the end of the archive. If no <em>files</em> are
specified, the archive is not modified.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-p">
<code class="sig-name descname"><span class="pre">p</span></code><code class="sig-prename descclassname"> <span class="pre">[v]</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-p" title="Permalink to this definition">¶</a></dt>
<dd><p>Print <em>files</em> to the standard output stream. If no <em>files</em> are specified, the
entire <code class="docutils literal notranslate"><span class="pre">archive</span></code> is printed. With the <a class="reference internal" href="#cmdoption-llvm-ar-arg-0"><code class="xref std std-option docutils literal notranslate"><span class="pre">v</span></code></a> modifier,
<strong class="program">llvm-ar</strong> also prints out the name of the file being output. Printing
binary files is ill-advised as they might confuse your terminal settings. The
<a class="reference internal" href="#cmdoption-llvm-ar-arg-p"><code class="xref std std-option docutils literal notranslate"><span class="pre">p</span></code></a> operation never modifies the archive.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-q">
<code class="sig-name descname"><span class="pre">q</span></code><code class="sig-prename descclassname"> <span class="pre">[LT]</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-q" title="Permalink to this definition">¶</a></dt>
<dd><p>Quickly append files to the end of the <code class="docutils literal notranslate"><span class="pre">archive</span></code> without removing
duplicates. If no <em>files</em> are specified, the archive is not modified. The
behavior when appending one archive to another depends upon whether the
<a class="reference internal" href="#cmdoption-llvm-ar-arg-L"><code class="xref std std-option docutils literal notranslate"><span class="pre">L</span></code></a> and <a class="reference internal" href="#cmdoption-llvm-ar-arg-T"><code class="xref std std-option docutils literal notranslate"><span class="pre">T</span></code></a> modifiers are used:</p>
<ul class="simple">
<li><p>Appending a regular archive to a regular archive will append the archive
file. If the <a class="reference internal" href="#cmdoption-llvm-ar-arg-L"><code class="xref std std-option docutils literal notranslate"><span class="pre">L</span></code></a> modifier is specified the members will be appended
instead.</p></li>
<li><p>Appending a regular archive to a thin archive requires the <a class="reference internal" href="#cmdoption-llvm-ar-arg-T"><code class="xref std std-option docutils literal notranslate"><span class="pre">T</span></code></a>
modifier and will append the archive file. The <a class="reference internal" href="#cmdoption-llvm-ar-arg-L"><code class="xref std std-option docutils literal notranslate"><span class="pre">L</span></code></a> modifier is not
supported.</p></li>
<li><p>Appending a thin archive to a regular archive will append the archive file.
If the <a class="reference internal" href="#cmdoption-llvm-ar-arg-L"><code class="xref std std-option docutils literal notranslate"><span class="pre">L</span></code></a> modifier is specified the members will be appended
instead.</p></li>
<li><p>Appending a thin archive to a thin archive will always quick append its
members.</p></li>
</ul>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-r">
<code class="sig-name descname"><span class="pre">r</span></code><code class="sig-prename descclassname"> <span class="pre">[abTu]</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-r" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace existing <em>files</em> or insert them at the end of the <code class="docutils literal notranslate"><span class="pre">archive</span></code> if
they do not exist. The <a class="reference internal" href="#cmdoption-llvm-ar-arg-a"><code class="xref std std-option docutils literal notranslate"><span class="pre">a</span></code></a>, <a class="reference internal" href="#cmdoption-llvm-ar-arg-b"><code class="xref std std-option docutils literal notranslate"><span class="pre">b</span></code></a>, <a class="reference internal" href="#cmdoption-llvm-ar-arg-T"><code class="xref std std-option docutils literal notranslate"><span class="pre">T</span></code></a> and <a class="reference internal" href="#cmdoption-llvm-ar-arg-u"><code class="xref std std-option docutils literal notranslate"><span class="pre">u</span></code></a>
modifiers apply to this operation. If no <em>files</em> are specified, the archive
is not modified.</p>
</dd></dl>
<p>t[v]
.. option:: t [vO]</p>
<blockquote>
<div><p>Print the table of contents. Without any modifiers, this operation just prints
the names of the members to the standard output stream. With the <a class="reference internal" href="#cmdoption-llvm-ar-arg-0"><code class="xref std std-option docutils literal notranslate"><span class="pre">v</span></code></a>
modifier, <strong class="program">llvm-ar</strong> also prints out the file type (B=bitcode,
S=symbol table, blank=regular file), the permission mode, the owner and group,
are ignored when extracting <em>files</em> and set to placeholder values when adding
size, and the date. With the <a class="reference internal" href="#cmdoption-llvm-ar-arg-O"><code class="xref std std-option docutils literal notranslate"><span class="pre">O</span></code></a> modifier, display member offsets. If
any <em>files</em> are specified, the listing is only for those files. If no <em>files</em>
are specified, the table of contents for the whole archive is printed.</p>
</div></blockquote>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-V">
<span id="cmdoption-llvm-ar-arg-v"></span><code class="sig-name descname"><span class="pre">V</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-V" title="Permalink to this definition">¶</a></dt>
<dd><p>A synonym for the <a class="reference internal" href="#cmdoption-llvm-ar-version"><code class="xref std std-option docutils literal notranslate"><span class="pre">--version</span></code></a> option.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-x">
<code class="sig-name descname"><span class="pre">x</span></code><code class="sig-prename descclassname"> <span class="pre">[oP]</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-x" title="Permalink to this definition">¶</a></dt>
<dd><p>Extract <code class="docutils literal notranslate"><span class="pre">archive</span></code> members back to files. The <a class="reference internal" href="#cmdoption-llvm-ar-arg-o"><code class="xref std std-option docutils literal notranslate"><span class="pre">o</span></code></a> modifier applies
to this operation. This operation retrieves the indicated <em>files</em> from the
archive and writes them back to the operating system’s file system. If no
<em>files</em> are specified, the entire archive is extracted.</p>
</dd></dl>
</div>
<div class="section" id="modifiers-operation-specific">
<h3>Modifiers (operation specific)<a class="headerlink" href="#modifiers-operation-specific" title="Permalink to this headline">¶</a></h3>
<p>The modifiers below are specific to certain operations. See the Operations
section to determine which modifiers are applicable to which operations.</p>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-a">
<code class="sig-name descname"><span class="pre">a</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-a" title="Permalink to this definition">¶</a></dt>
<dd><p>When inserting or moving member files, this option specifies the destination
of the new files as being after the <em>relpos</em> member. If <em>relpos</em> is not found,
the files are placed at the end of the <code class="docutils literal notranslate"><span class="pre">archive</span></code>. <em>relpos</em> cannot be
consumed without either <a class="reference internal" href="#cmdoption-llvm-ar-arg-a"><code class="xref std std-option docutils literal notranslate"><span class="pre">a</span></code></a>, <a class="reference internal" href="#cmdoption-llvm-ar-arg-b"><code class="xref std std-option docutils literal notranslate"><span class="pre">b</span></code></a> or <a class="reference internal" href="#cmdoption-llvm-ar-arg-i"><code class="xref std std-option docutils literal notranslate"><span class="pre">i</span></code></a>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-b">
<code class="sig-name descname"><span class="pre">b</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-b" title="Permalink to this definition">¶</a></dt>
<dd><p>When inserting or moving member files, this option specifies the destination
of the new files as being before the <em>relpos</em> member. If <em>relpos</em> is not
found, the files are placed at the end of the <code class="docutils literal notranslate"><span class="pre">archive</span></code>. <em>relpos</em> cannot
be consumed without either <a class="reference internal" href="#cmdoption-llvm-ar-arg-a"><code class="xref std std-option docutils literal notranslate"><span class="pre">a</span></code></a>, <a class="reference internal" href="#cmdoption-llvm-ar-arg-b"><code class="xref std std-option docutils literal notranslate"><span class="pre">b</span></code></a> or <a class="reference internal" href="#cmdoption-llvm-ar-arg-i"><code class="xref std std-option docutils literal notranslate"><span class="pre">i</span></code></a>. This
modifier is identical to the <a class="reference internal" href="#cmdoption-llvm-ar-arg-i"><code class="xref std std-option docutils literal notranslate"><span class="pre">i</span></code></a> modifier.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-i">
<code class="sig-name descname"><span class="pre">i</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-i" title="Permalink to this definition">¶</a></dt>
<dd><p>A synonym for the <a class="reference internal" href="#cmdoption-llvm-ar-arg-b"><code class="xref std std-option docutils literal notranslate"><span class="pre">b</span></code></a> option.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-L">
<span id="cmdoption-llvm-ar-arg-l"></span><code class="sig-name descname"><span class="pre">L</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-L" title="Permalink to this definition">¶</a></dt>
<dd><p>When quick appending an <code class="docutils literal notranslate"><span class="pre">archive</span></code>, instead quick append its members. This
is a feature for <strong class="program">llvm-ar</strong> that is not found in gnu-ar.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-N">
<span id="cmdoption-llvm-ar-arg-n"></span><code class="sig-name descname"><span class="pre">N</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-N" title="Permalink to this definition">¶</a></dt>
<dd><p>When extracting or deleting a member that shares its name with another member,
the <em>count</em> parameter allows you to supply a positive whole number that
selects the instance of the given name, with “1” indicating the first
instance. If <a class="reference internal" href="#cmdoption-llvm-ar-arg-N"><code class="xref std std-option docutils literal notranslate"><span class="pre">N</span></code></a> is not specified the first member of that name will
be selected. If <em>count</em> is not supplied, the operation fails.*count* cannot be</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-o">
<code class="sig-name descname"><span class="pre">o</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-o" title="Permalink to this definition">¶</a></dt>
<dd><p>When extracting files, use the modification times of any <em>files</em> as they
appear in the <code class="docutils literal notranslate"><span class="pre">archive</span></code>. By default <em>files</em> extracted from the archive
use the time of extraction.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-O">
<code class="sig-name descname"><span class="pre">O</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-O" title="Permalink to this definition">¶</a></dt>
<dd><p>Display member offsets inside the archive.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-T">
<span id="cmdoption-llvm-ar-arg-t"></span><code class="sig-name descname"><span class="pre">T</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-T" title="Permalink to this definition">¶</a></dt>
<dd><p>When creating or modifying an archive, this option specifies that the
<code class="docutils literal notranslate"><span class="pre">archive</span></code> will be thin. By default, archives are not created as thin
archives and when modifying a thin archive, it will be converted to a regular
archive.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-0">
<code class="sig-name descname"><span class="pre">v</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-0" title="Permalink to this definition">¶</a></dt>
<dd><p>When printing <em>files</em> or the <code class="docutils literal notranslate"><span class="pre">archive</span></code> table of contents, this modifier
instructs <strong class="program">llvm-ar</strong> to include additional information in the output.</p>
</dd></dl>
</div>
<div class="section" id="modifiers-generic">
<h3>Modifiers (generic)<a class="headerlink" href="#modifiers-generic" title="Permalink to this headline">¶</a></h3>
<p>The modifiers below may be applied to any operation.</p>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-c">
<code class="sig-name descname"><span class="pre">c</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-c" title="Permalink to this definition">¶</a></dt>
<dd><p>For the <a class="reference internal" href="#cmdoption-llvm-ar-arg-r"><code class="xref std std-option docutils literal notranslate"><span class="pre">r</span></code></a> (replace)and <a class="reference internal" href="#cmdoption-llvm-ar-arg-q"><code class="xref std std-option docutils literal notranslate"><span class="pre">q</span></code></a> (quick update) operations,
<strong class="program">llvm-ar</strong> will always create the archive if it doesn’t exist.
Normally, <strong class="program">llvm-ar</strong> will print a warning message indicating that the
<code class="docutils literal notranslate"><span class="pre">archive</span></code> is being created. Using this modifier turns off
that warning.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-D">
<code class="sig-name descname"><span class="pre">D</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-D" title="Permalink to this definition">¶</a></dt>
<dd><p>Use zero for timestamps and UIDs/GIDs. This is set by default.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-P">
<code class="sig-name descname"><span class="pre">P</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-P" title="Permalink to this definition">¶</a></dt>
<dd><p>Use full paths when matching member names rather than just the file name.
This can be useful when manipulating an <code class="docutils literal notranslate"><span class="pre">archive</span></code> generated by another
archiver, as some allow paths as member names. This is the default behavior
for thin archives.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-s">
<code class="sig-name descname"><span class="pre">s</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-s" title="Permalink to this definition">¶</a></dt>
<dd><p>This modifier requests that an archive index (or symbol table) be added to the
<code class="docutils literal notranslate"><span class="pre">archive</span></code>, as if using ranlib. The symbol table will contain all the
externally visible functions and global variables defined by all the bitcode
files in the archive. By default <strong class="program">llvm-ar</strong> generates symbol tables in
archives. This can also be used as an operation.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-S">
<code class="sig-name descname"><span class="pre">S</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-S" title="Permalink to this definition">¶</a></dt>
<dd><p>This modifier is the opposite of the <a class="reference internal" href="#cmdoption-llvm-ar-arg-s"><code class="xref std std-option docutils literal notranslate"><span class="pre">s</span></code></a> modifier. It instructs
<strong class="program">llvm-ar</strong> to not build the symbol table. If both <a class="reference internal" href="#cmdoption-llvm-ar-arg-s"><code class="xref std std-option docutils literal notranslate"><span class="pre">s</span></code></a> and
<a class="reference internal" href="#cmdoption-llvm-ar-arg-S"><code class="xref std std-option docutils literal notranslate"><span class="pre">S</span></code></a> are used, the last modifier to occur in the options will prevail.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-u">
<code class="sig-name descname"><span class="pre">u</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-u" title="Permalink to this definition">¶</a></dt>
<dd><p>Only update <code class="docutils literal notranslate"><span class="pre">archive</span></code> members with <em>files</em> that have more recent
timestamps.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-U">
<code class="sig-name descname"><span class="pre">U</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-U" title="Permalink to this definition">¶</a></dt>
<dd><p>Use actual timestamps and UIDs/GIDs.</p>
</dd></dl>
</div>
<div class="section" id="other">
<h3>Other<a class="headerlink" href="#other" title="Permalink to this headline">¶</a></h3>
<dl class="std option">
<dt id="cmdoption-llvm-ar-format">
<code class="sig-name descname"><span class="pre">--format</span></code><code class="sig-prename descclassname"><span class="pre">=<type></span></code><a class="headerlink" href="#cmdoption-llvm-ar-format" title="Permalink to this definition">¶</a></dt>
<dd><p>This option allows for default, gnu, darwin or bsd <code class="docutils literal notranslate"><span class="pre"><type></span></code> to be selected.
When creating an <code class="docutils literal notranslate"><span class="pre">archive</span></code>, <code class="docutils literal notranslate"><span class="pre"><type></span></code> will default to that of the host
machine.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-h">
<span id="cmdoption-llvm-ar-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-h" title="Permalink to this definition">¶</a></dt>
<dd><p>Print a summary of command-line options and their meanings.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-M">
<span id="cmdoption-llvm-ar-m"></span><code class="sig-name descname"><span class="pre">-M</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-M" title="Permalink to this definition">¶</a></dt>
<dd><p>This option allows for MRI scripts to be read through the standard input
stream. No other options are compatible with this option.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-rsp-quoting">
<code class="sig-name descname"><span class="pre">--rsp-quoting</span></code><code class="sig-prename descclassname"><span class="pre">=<type></span></code><a class="headerlink" href="#cmdoption-llvm-ar-rsp-quoting" title="Permalink to this definition">¶</a></dt>
<dt id="cmdoption-llvm-ar-arg-This">
<span id="cmdoption-llvm-ar-arg-this"></span><span id="cmdoption-llvm-ar-arg-either"></span><code class="sig-name descname"><span class="pre">This</span></code><code class="sig-prename descclassname"> <span class="pre">option</span> <span class="pre">selects</span> <span class="pre">the</span> <span class="pre">quoting</span> <span class="pre">style</span> <span class="pre">``<type>``</span> <span class="pre">for</span> <span class="pre">response</span> <span class="pre">files</span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">either</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-This" title="Permalink to this definition">¶</a></dt>
<dt id="cmdoption-llvm-ar-arg-posix">
<span id="cmdoption-llvm-ar-arg-otherwise"></span><code class="sig-name descname"><span class="pre">``posix``</span></code><code class="sig-prename descclassname"> <span class="pre">or</span> <span class="pre">``windows``.</span> <span class="pre">The</span> <span class="pre">default</span> <span class="pre">when</span> <span class="pre">on</span> <span class="pre">Windows</span> <span class="pre">is</span> <span class="pre">``windows``</span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">otherwise</span></code><code class="sig-prename descclassname"> <span class="pre">the</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-posix" title="Permalink to this definition">¶</a></dt>
<dt id="cmdoption-llvm-ar-arg-default">
<code class="sig-name descname"><span class="pre">default</span></code><code class="sig-prename descclassname"> <span class="pre">is</span> <span class="pre">``posix``.</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-default" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-version">
<code class="sig-name descname"><span class="pre">--version</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-version" title="Permalink to this definition">¶</a></dt>
<dd><p>Display the version of the <strong class="program">llvm-ar</strong> executable.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-FILE">
<span id="cmdoption-llvm-ar-arg-file"></span><code class="sig-name descname"><span class="pre">@<FILE></span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-FILE" title="Permalink to this definition">¶</a></dt>
<dd><p>Read command-line options and commands from response file <code class="docutils literal notranslate"><span class="pre"><FILE></span></code>.</p>
</dd></dl>
</div>
</div>
<div class="section" id="mri-scripts">
<h2>MRI SCRIPTS<a class="headerlink" href="#mri-scripts" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">llvm-ar</strong> understands a subset of the MRI scripting interface commonly
supported by archivers following in the ar tradition. An MRI script contains a
sequence of commands to be executed by the archiver. The <a class="reference internal" href="#cmdoption-llvm-ar-M"><code class="xref std std-option docutils literal notranslate"><span class="pre">-M</span></code></a> option
allows for an MRI script to be passed to <strong class="program">llvm-ar</strong> through the
standard input stream.</p>
<p>Note that <strong class="program">llvm-ar</strong> has known limitations regarding the use of MRI
scripts:</p>
<ul class="simple">
<li><p>Each script can only create one archive.</p></li>
<li><p>Existing archives can not be modified.</p></li>
</ul>
<div class="section" id="mri-script-commands">
<h3>MRI Script Commands<a class="headerlink" href="#mri-script-commands" title="Permalink to this headline">¶</a></h3>
<p>Each command begins with the command’s name and must appear on its own line.
Some commands have arguments, which must be separated from the name by
whitespace. An MRI script should begin with either a <a class="reference internal" href="#cmdoption-llvm-ar-arg-CREATE"><code class="xref std std-option docutils literal notranslate"><span class="pre">CREATE</span></code></a> or
<a class="reference internal" href="#cmdoption-llvm-ar-arg-CREATETHIN"><code class="xref std std-option docutils literal notranslate"><span class="pre">CREATETHIN</span></code></a> command and will typically end with a <a class="reference internal" href="#cmdoption-llvm-ar-arg-SAVE"><code class="xref std std-option docutils literal notranslate"><span class="pre">SAVE</span></code></a>
command. Any text after either ‘*’ or ‘;’ is treated as a comment.</p>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-CREATE">
<span id="cmdoption-llvm-ar-arg-create"></span><code class="sig-name descname"><span class="pre">CREATE</span></code><code class="sig-prename descclassname"> <span class="pre">archive</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-CREATE" title="Permalink to this definition">¶</a></dt>
<dd><p>Begin creation of a regular archive with the specified name. Subsequent
commands act upon this <code class="docutils literal notranslate"><span class="pre">archive</span></code>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-CREATETHIN">
<span id="cmdoption-llvm-ar-arg-createthin"></span><code class="sig-name descname"><span class="pre">CREATETHIN</span></code><code class="sig-prename descclassname"> <span class="pre">archive</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-CREATETHIN" title="Permalink to this definition">¶</a></dt>
<dd><p>Begin creation of a thin archive with the specified name. Subsequent
commands act upon this <code class="docutils literal notranslate"><span class="pre">archive</span></code>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-ADDLIB">
<span id="cmdoption-llvm-ar-arg-addlib"></span><code class="sig-name descname"><span class="pre">ADDLIB</span></code><code class="sig-prename descclassname"> <span class="pre">archive</span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-ADDLIB" title="Permalink to this definition">¶</a></dt>
<dd><p>Append the contents of <code class="docutils literal notranslate"><span class="pre">archive</span></code> to the current archive.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-ADDMOD">
<span id="cmdoption-llvm-ar-arg-addmod"></span><code class="sig-name descname"><span class="pre">ADDMOD</span></code><code class="sig-prename descclassname"> <span class="pre"><file></span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-ADDMOD" title="Permalink to this definition">¶</a></dt>
<dd><p>Append <code class="docutils literal notranslate"><span class="pre"><file></span></code> to the current archive.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-DELETE">
<span id="cmdoption-llvm-ar-arg-delete"></span><code class="sig-name descname"><span class="pre">DELETE</span></code><code class="sig-prename descclassname"> <span class="pre"><file></span></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-DELETE" title="Permalink to this definition">¶</a></dt>
<dd><p>Delete the member of the current archive whose file name, excluding directory
components, matches <code class="docutils literal notranslate"><span class="pre"><file></span></code>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-SAVE">
<span id="cmdoption-llvm-ar-arg-save"></span><code class="sig-name descname"><span class="pre">SAVE</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-SAVE" title="Permalink to this definition">¶</a></dt>
<dd><p>Write the current archive to the path specified in the previous
<a class="reference internal" href="#cmdoption-llvm-ar-arg-CREATE"><code class="xref std std-option docutils literal notranslate"><span class="pre">CREATE</span></code></a>/<a class="reference internal" href="#cmdoption-llvm-ar-arg-CREATETHIN"><code class="xref std std-option docutils literal notranslate"><span class="pre">CREATETHIN</span></code></a> command.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-ar-arg-END">
<span id="cmdoption-llvm-ar-arg-end"></span><code class="sig-name descname"><span class="pre">END</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-ar-arg-END" title="Permalink to this definition">¶</a></dt>
<dd><p>Ends the MRI script (optional).</p>
</dd></dl>
</div>
</div>
<div class="section" id="exit-status">
<h2>EXIT STATUS<a class="headerlink" href="#exit-status" title="Permalink to this headline">¶</a></h2>
<p>If <strong class="program">llvm-ar</strong> succeeds, it will exit with 0. Otherwise, if an error occurs, it
will exit with a non-zero value.</p>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="llvm-cxxfilt.html" title="llvm-cxxfilt - LLVM symbol name demangler"
>next</a> |</li>
<li class="right" >
<a href="llvm-addr2line.html" title="llvm-addr2line - a drop-in replacement for addr2line"
>previous</a> |</li>
<li><a href="https://llvm.org/">LLVM Home</a> | </li>
<li><a href="../index.html">Documentation</a>»</li>
<li class="nav-item nav-item-1"><a href="../Reference.html" >Reference</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" >LLVM Command Guide</a> »</li>
<li class="nav-item nav-item-this"><a href="">llvm-ar - LLVM archiver</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2003-2021, LLVM Project.
Last updated on 2021-09-18.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.4.
</div>
</body>
</html>
|