From: Clément Chigot Date: Wed, 3 Apr 2019 12:58:05 +0000 (+0200) Subject: cmd/go: add a note in help buildmode for c-archive on AIX X-Git-Tag: go1.13beta1~814 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b0bcd7aeb0060361fc8ff04cc4b6764aa146b086;p=gostls13.git 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 --- 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. `, }