cmd/cgo: use explicit flag to emit dynamic linker path

Using -import_runtime_cgo would have worked great except
that it doesn't get passed to the second invocation of cgo,
and that's the one that writes the relevant file.

Fixes ARM build on systems with a different dynamic linker
than the one 5l assumes (like Gentoo).

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7432048
This commit is contained in:
Russ Cox 2013-03-04 11:23:17 -05:00
parent 7903e3600c
commit 6dc3c9cfdd
3 changed files with 8 additions and 3 deletions

View file

@ -163,8 +163,8 @@ func dynimport(obj string) {
}
if f, err := elf.Open(obj); err == nil {
if !*importRuntimeCgo {
// We are runtime/cgo, so emit the cgo_dynamic_linker line.
if *dynlinker {
// Emit the cgo_dynamic_linker line.
if sec := f.Section(".interp"); sec != nil {
if data, err := sec.Data(); err == nil && len(data) > 1 {
// skip trailing \0 in data