[PATCH] D113704: [AIX][llvm-go] AIX linker does not recognize `-rpath`

Steven Wan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 10:10:40 PST 2021


stevewan updated this revision to Diff 387313.
stevewan added a comment.

Fix formatting


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113704/new/

https://reviews.llvm.org/D113704

Files:
  llvm/tools/llvm-go/llvm-go.go


Index: llvm/tools/llvm-go/llvm-go.go
===================================================================
--- llvm/tools/llvm-go/llvm-go.go
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113704.387313.patch
Type: text/x-patch
Size: 694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211115/9a1cfe74/attachment.bin>


More information about the llvm-commits mailing list