If this change is not included, in the gcc go testsuite, the recover.go testcase fails with this error:

panic: reflect.makeMethodValue not implemented for ppc64le

when running this test:

func test9reflect1() {
        f := reflect.ValueOf(&T1{}).Method(0).Interface().(func())
        defer f()
        panic(9)
}

Also as was noted below, some level of reflection support is needed to build Docker. I was given this patch by someone in IBM trying to build Docker on Power who told me it was needed (but didn't really know the details). There is interest in trying to get Docker to build with gcc 4.9 because 5.0 won't be available in distros for a while yet. I was told that the minimal reflection support provided by this patch was enough to get it to build. But if a simple workaround in the Docker source will make it work that might be sufficient. I'll find out. Thanks.

On 01/07/2015 07:20 PM, Ian Lance Taylor wrote:
On Wed, Jan 7, 2015 at 4:39 PM, Michael Hudson-Doyle
<michael.hud...@canonical.com> wrote:
Ian Lance Taylor <i...@golang.org> writes:

On Wed, Jan 7, 2015 at 9:26 AM, Lynn A. Boger
<labo...@linux.vnet.ibm.com> wrote:
In libgo/go/reflect/makefunc.go, calls to MakeFunc, makeMethodValue and
makeValueMethod will panic if called when GOARCH is ppc64 or ppc64le.
Right, I'm just saying that almost no code actually does that.  I just
tried a web search and found no uses other than examples of how to use
it.  I'm sure there are a few, but not many.
There is a somewhat hidden one in Docker:

     https://github.com/docker/docker/blob/master/api/client/cli.go#L64

(it is also possible to patch docker to do this differently, of course).
Ah, so that is why it matters.

Perhaps you could talk Docker into replace the return statement with

return func(a ...string) error {
        return 
method.CallSlice([]reflect.Value{reflect.ValueOf(a)})[0].Interface().(error)
}, true

It would probably be just as efficient.

Ian



Reply via email to