mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: add -extar option to set ar program for c-archive
People who want to use -buildmode=c-archive in unusual cross-compilation setups will need something like this. It could also be done via (yet another) environment variable but I use -extar by analogy with the existing -extld. Change-Id: I354cfabc4c470603affd13cd946997b3a24c0e6c Reviewed-on: https://go-review.googlesource.com/18913 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
c2b40809c1
commit
1aab7b9626
4 changed files with 28 additions and 1 deletions
|
|
@ -207,6 +207,7 @@ var (
|
|||
tmpdir string
|
||||
extld string
|
||||
extldflags string
|
||||
extar string
|
||||
libgccfile string
|
||||
debug_s int // backup old value of debug['s']
|
||||
Ctxt *Link
|
||||
|
|
@ -1015,8 +1016,12 @@ func archive() {
|
|||
return
|
||||
}
|
||||
|
||||
if extar == "" {
|
||||
extar = "ar"
|
||||
}
|
||||
|
||||
mayberemoveoutfile()
|
||||
argv := []string{"ar", "-q", "-c", "-s", outfile}
|
||||
argv := []string{extar, "-q", "-c", "-s", outfile}
|
||||
argv = append(argv, fmt.Sprintf("%s/go.o", tmpdir))
|
||||
argv = append(argv, hostobjCopy()...)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue