gopack grc? What is the "c" and "r" for?

28 views
Skip to first unread message

Alexander Orlov

unread,
Oct 11, 2010, 9:10:58 AM10/11/10
to golang-nuts
When I execute "make"
gopack grc _obj/solox.a _go_.6
is executed.

Ok, the g option is documented here http://golang.org/cmd/gopack/, the
r option is at least mentioned (usage: gopack [uvnbailoS][mrxtdpq]
archive files ...) but not documented(?). But what's about c?

peterGo

unread,
Oct 11, 2010, 10:05:46 AM10/11/10
to golang-nuts
Alexander,

gopack: Gopack is a variant of the Plan 9 ar tool.
http://golang.org/cmd/gopack/

9c(1) - Plan 9 from User Space
http://swtch.com/plan9port/man/man1/9c.html

9ar maintains object file archives called libraries. The exact set of
valid command keys varies from system to system, but 9ar always
provides the following key characters:
d Delete files from the archive file.
r Replace files in the archive file, or add them if missing.
t List a table of contents of the archive. If names are given,
only those files are listed.
x Extract the named files. If no names are given, all files in the
archive are extracted. In neither case does x alter the archive file.
v Verbose. Give a file-by-file description of the making of a new
archive file from the old archive and the constituent files. With t,
give a long listing of all information about the files, somewhat like
a listing by ls(1), showing

mode uid/gid size date name

c Create. Normally 9ar will create a new archive when afile does
not exist, and give a warning. Option c discards any old contents and
suppresses the warning.
When a d, r, or m key is specified, 9ar inserts a table of contents,
required by the linker, at the front of the library. The table of
contents is rebuilt whenever the archive is modified.

Peter

On Oct 11, 9:10 am, Alexander Orlov <loxal....@googlemail.com> wrote:
> When I execute "make"
> gopack grc _obj/solox.a _go_.6
> is executed.
>
> Ok, the g option is documented herehttp://golang.org/cmd/gopack/, the

peterGo

unread,
Oct 11, 2010, 10:18:02 AM10/11/10
to golang-nuts
Alexander,

Gopack is a variant of the Plan 9 ar tool. The original is documented
at: http://plan9.bell-labs.com/magic/man2html/1/ar.
http://code.google.com/p/go/source/browse/src/cmd/gopack/doc.go

Plan 9 /sys/man/1/ar
http://plan9.bell-labs.com/magic/man2html/1/ar

Peter

On Oct 11, 9:10 am, Alexander Orlov <loxal....@googlemail.com> wrote:
> When I execute "make"
> gopack grc _obj/solox.a _go_.6
> is executed.
>
> Ok, the g option is documented herehttp://golang.org/cmd/gopack/, the

peterGo

unread,
Oct 11, 2010, 10:21:19 AM10/11/10
to golang-nuts
Alexander,

If you understand the C programming language:

ar.c - go - Project Hosting on Google Code
http://code.google.com/p/go/source/browse/src/cmd/gopack/ar.c

Peter

On Oct 11, 9:10 am, Alexander Orlov <loxal....@googlemail.com> wrote:
> When I execute "make"
> gopack grc _obj/solox.a _go_.6
> is executed.
>
> Ok, the g option is documented herehttp://golang.org/cmd/gopack/, the

Alexander Orlov

unread,
Oct 11, 2010, 10:49:42 AM10/11/10
to golang-nuts
On Oct 11, 4:05 pm, peterGo <go.peter...@gmail.com> wrote:
> r     Replace files in the archive file, or add them if missing.

> c     Create. Normally 9ar will create a new archive when afile does
> not exist, and give a warning. Option c discards any old contents and
> suppresses the warning.

Question answered, thx!
Reply all
Reply to author
Forward
0 new messages