LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 30 - [llvm-ar] Command line arguments have funny syntax
Summary: [llvm-ar] Command line arguments have funny syntax
Status: RESOLVED FIXED
Alias: None
Product: tools
Classification: Unclassified
Component: llvm-ar (show other bugs)
Version: 1.0
Hardware: All All
: P normal
Assignee: Tanya Lattner
URL:
Keywords: missing-feature
Depends on:
Blocks:
 
Reported: 2003-10-10 13:27 PDT by Brian R. Gaeke
Modified: 2010-03-06 14:06 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments
Partial patch (1.87 KB, patch)
2003-11-11 19:08 PST, Brian R. Gaeke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian R. Gaeke 2003-10-10 13:27:40 PDT
The syntax of llvm-ar's command line arguments is strange
to someone who is used to using plain old ar or GNU ar.

For instance, you don't get to specify which action it
will take; it always creates ('c') archives. See the ar(1)
man page for an example of what I am getting at.

It would be really nice if llvm-ar took either the same
kinds of command line options as other versions of ar,
or a subset thereof.

Sorry this is so vague; I don't have
time to explicitly specify all the things that real ar(1)
can do, and the documentation is widely available.
Comment 1 Chris Lattner 2003-10-10 13:32:02 PDT
You're certainly right, llvm-ar should be a drop in replacement for the system
ar, which happens to do nice things for LLVM bytecode files (generates a symbol
table).

At this point, llvm-ar is not finished and should not be used, so this is not a
high-priority problem.
Comment 2 Brian R. Gaeke 2003-11-11 19:08:56 PST
Created attachment 19 [details]
Partial patch

Here is a patch which makes llvm-ar accept many common ar options, though
the only variable which actually does anything is still SymbolTableOption.

I have labeled it as a "partial patch" for the following other reason: ar(1) as
described in the Single Unix Specification and in the GNU manual has a syntax
for command-line arguments which is, as far as I can tell, unique. It
superficially resembles the command-line syntax of dump(8)/restore(8) and
tar(1), but it is different in that the argument to the [abi] options must
always precede the name of the archive. So although I appreciate the tasty
goodness of Chris's CommandLine library, and I briefly considered extending it
to support ar(1) argument syntax, I think the right thing to do is *not* to use
cl::ParseCommandLineOptions() in this tool, and instead to write a custom
command-line argument parser.

I'm probably not going to work on this at all for at least another week. Anyone
else have any comments?
Comment 3 Tanya Lattner 2003-12-06 19:36:25 PST
llvm-ar should now have the proper syntax. Note: llvm-ar is not complete.