3

I'm trying to use 'ar' included in Debian Wheezy armel version of binutils and it doesn't seem to operate like on other systems I've encountered.

Some sample output from the command-line:

$ ar
Usage: ar [options] archive
 Generate an index to speed access to archives
 The options are:
  @<file>                      Read options from <file>
  --plugin <name>              Load the specified plugin
  -t                           Update the archive's symbol map timestamp
  -h --help                    Print this help message
  -v --version                 Print version information
ar: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex

$ ar -crs something.a file1.o file2.o
ar: invalid option -- 'c'
ar: invalid option -- 'r'
ar: invalid option -- 's'

What am I missing here? Why do I always get the invalid option message?

Anthon
  • 78,313
  • 42
  • 165
  • 222
cachance7
  • 163
  • 4
  • 1
    What version is the man page and the ar command? Of the man page can be found at the left end, the command using `-v` – Braiam May 16 '14 at 17:37
  • 3
    None of the options you are using are included in the help that you show. What makes you think they're valid options? – terdon May 16 '14 at 17:56
  • 3
    In `binutils`, `ar` and `ranlib` are the same program; it looks at a compiled-in variable or at the name it's invoked with to decide which one to be. Here it's choosing to be `ranlib`. Are `ar` and `ranlib`the same inode? Maybe something copied the compiled-in `ranlib` on top of it. – Mark Plotnick May 16 '14 at 18:18
  • Under Arch Linux, `/usr/bin/ar` and `/usr/bin/ranlib` have different inode numbers, and hence, are different files. However, @MarkPlotnick is correct: the usage message you get is from `ranlib`, somehow. Do `ls -li /usr/bin/ranlib /usr/bin/ar` to see if the inode numbers differ. On my x86_64 machine, inodes differ, but file sizes are identical. `cksum` does show differeent checksums, so they're two different filees. –  May 17 '14 at 02:50
  • @MarkPlotnick was right -- some(thing/one) mangled the installed files. Reinstalling binutils (which I *thought* I had already tried...) cleared things up. – cachance7 May 18 '14 at 05:07

1 Answers1

1

For starters, "-c" is an invalid keyletter. Looks to me like you'd have to use 'd', 'm', 'p', 'q', 'r' or 'x' as the first keyletter. You can get a decent explanation from ar --help.

I'm guessing, but I think you meant ar -rcs instead of arc -crs.

  • You're right, I mixed up the intended order, but either way I get the same 'invalid option' error messages... – cachance7 May 16 '14 at 21:00