From b0bcd7aeb0060361fc8ff04cc4b6764aa146b086 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cl=C3=A9ment=20Chigot?= Date: Wed, 3 Apr 2019 14:58:05 +0200 Subject: [PATCH] cmd/go: add a note in help buildmode for c-archive on AIX As ld on AIX doesn't keep the same layout in .text section, -Wl,-bnoobjreoder must be passed to gcc when building a C program with a Go archive. Change-Id: I89b584cce43ab5792f315192b073923c10d5690e Reviewed-on: https://go-review.googlesource.com/c/go/+/170538 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/cmd/go/alldocs.go | 3 +++ src/cmd/go/internal/help/helpdoc.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index f02df514b7..de07d910d8 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1421,6 +1421,9 @@ // Build the listed main packages, plus all packages that they // import, into a Go plugin. Packages not named main are ignored. // +// On AIX, when linking a C program that uses a Go archive built with +// -buildmode=c-archive, you must pass -Wl,-bnoobjreorder to the C compiler. +// // // Calling between Go and C // diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go index 777bd511b1..eb663e99b6 100644 --- a/src/cmd/go/internal/help/helpdoc.go +++ b/src/cmd/go/internal/help/helpdoc.go @@ -689,6 +689,9 @@ are: -buildmode=plugin Build the listed main packages, plus all packages that they import, into a Go plugin. Packages not named main are ignored. + +On AIX, when linking a C program that uses a Go archive built with +-buildmode=c-archive, you must pass -Wl,-bnoobjreorder to the C compiler. `, } -- 2.50.0