[Bug go/89227] gotools test cmd/go fails with link error "call lacks nop, can't restore toc; recompile with -fPIC"

ian at airs dot com gcc-bugzilla@gcc.gnu.org
Wed Feb 6 20:21:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89227

--- Comment #1 from Ian Lance Taylor <ian at airs dot com> ---
Same as https://golang.org/issue/29046?

I would bet that this has something to do with the fact that testenv.HasLink is
inlinable.  Something is wrong with the way that the frontend is passing the
inlinable function to the backend.  The specific code in gcc/go/go-gcc.cc is in
Gcc_backend::function:

  if ((flags & function_only_inline) != 0)
    {
      DECL_EXTERNAL(decl) = 1;
      DECL_DECLARED_INLINE_P(decl) = 1;
    }

This is intended to tell the backend to treat the function the way it treats a
C gnu89 extern inline function.  This seems to work fine on x86 but perhaps I
am missing something on ppc64le.


More information about the Gcc-bugs mailing list