mirror of
https://github.com/golang/go
synced 2024-11-07 13:46:19 -07:00
cmd/link: convert -I foo to -Wl,--dynamic-linker,foo when externally linking
Fixes #22446 Change-Id: Id5b3fbc9cd3a7d6c4bf4e28428b8cb6d45a9ca92 Reviewed-on: https://go-review.googlesource.com/c/go/+/310349 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
88655480f3
commit
7252e1e5b6
@ -1431,6 +1431,14 @@ func (ctxt *Link) hostlink() {
|
|||||||
argv = append(argv, fmt.Sprintf("-Wl,-rpath,%s", rpath.val))
|
argv = append(argv, fmt.Sprintf("-Wl,-rpath,%s", rpath.val))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *flagInterpreter != "" {
|
||||||
|
// Many linkers support both -I and the --dynamic-linker flags
|
||||||
|
// to set the ELF interpreter, but lld only supports
|
||||||
|
// --dynamic-linker so prefer that (ld on very old Solaris only
|
||||||
|
// supports -I but that seems less important).
|
||||||
|
argv = append(argv, fmt.Sprintf("-Wl,--dynamic-linker,%s", *flagInterpreter))
|
||||||
|
}
|
||||||
|
|
||||||
// Force global symbols to be exported for dlopen, etc.
|
// Force global symbols to be exported for dlopen, etc.
|
||||||
if ctxt.IsELF {
|
if ctxt.IsELF {
|
||||||
argv = append(argv, "-rdynamic")
|
argv = append(argv, "-rdynamic")
|
||||||
|
Loading…
Reference in New Issue
Block a user