diff --git a/llvm/tools/llvm-go/llvm-go.go b/llvm/tools/llvm-go/llvm-go.go --- a/llvm/tools/llvm-go/llvm-go.go +++ b/llvm/tools/llvm-go/llvm-go.go @@ -96,7 +96,11 @@ // needed to resolve dependent symbols stdLibOption = "-stdlib=libc++" } - if runtime.GOOS != "darwin" { + if runtime.GOOS == "aix" { + // AIX linker does not honour `-rpath`, the closest substitution + // is `-blibpath` + ldflags = "-Wl,-blibpath:" + llvmConfig("--libdir") + " " + ldflags + } else if runtime.GOOS != "darwin" { // OS X doesn't like -rpath with cgo. See: // https://github.com/golang/go/issues/7293 ldflags = "-Wl,-rpath," + llvmConfig("--libdir") + " " + ldflags