This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE:[PATCH,AIX] Changes for linking gotools on AIX.
- From: "REIX, Tony" <tony dot reix at atos dot net>
- To: Ian Lance Taylor <iant at golang dot org>, David Edelsohn <dje dot gcc at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "BERGAMINI, DAMIEN" <damien dot bergamini at atos dot net>
- Date: Thu, 27 Jul 2017 15:51:20 +0000
- Subject: RE:[PATCH,AIX] Changes for linking gotools on AIX.
- Authentication-results: sourceware.org; auth=none
- References: <B37989F2852398498001550C29155BE51789E965@FRCRPVV9EX4MSX.ww931.my-it-solutions.net> <CAGWvnynX=BnQvVAZRWWmkPfbLeSazkewatw_NJ3xkErjMg_ukg@mail.gmail.com>,<CAOyqgcWWk7XX=cT7LEVkGPJPDyzFE-vCEeyZL3egh7Ck8+iXbw@mail.gmail.com>
Hi Ian, David,
On AIX, that is more complicated...
We have to use -static-libgo when building the libgo tests. Because AIX does not work like Linux does and because the Go libgo tests are done by duplicating several .go files of libgo packages that already appear in the libgo.a (libgo.so) library.
On AIX, without -static-libgo, when building/running the libgo tests, we have Go variables defined somewhere and used elsewhere, BUT with different memory addresses... leading to bad issues...
However, when building/linking real Go application code outside of Gcc Go compiler, and thus with NO 2-times compiled libgo internal code, we have another issue and we need to load libgo.a at first, otherwise we have other issues.
In short, this patch is the first step of a global fix we have found for AIX for covering the 2 cases: build/run libgo internal tests, and build real NO-libgo internal customer code. And it works fine.
I'll provide the second step later.
Cordialement,
Tony Reix
Bull - ATOS
IBM Coop Architect & Technical Leader
Office : +33 (0) 4 76 29 72 67
1 rue de Provence - 38432 Échirolles - France
www.atos.net
________________________________________
De : Ian Lance Taylor [iant@golang.org]
Envoyé : mercredi 26 juillet 2017 20:06
À : David Edelsohn
Cc : REIX, Tony; gcc-patches@gcc.gnu.org
Objet : Re: [PATCH,AIX] Changes for linking gotools on AIX.
On Wed, Jul 26, 2017 at 9:58 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> On Wed, Jul 26, 2017 at 12:41 PM, REIX, Tony <tony.reix@atos.net> wrote:
>> Description:
>> * This patch adds linker options for gotools for AIX.
>>
>> Tests:
>> * Fedora25/x86_64 + GCC trunk : Configure/Build: SUCCESS
>> - build remade by means of gmake.
>> - some test redone in libgo (gmake check)
>> * AIX + GCC 7.1.0 :
>> - build remade by means of gmake.
>> - some test redone in libgo (gmake check)
>>
>> ChangeLog:
>> * Makefile.am (AM_LDFLAGS & GOLINK): Changes for linking on AIX.
>> * Makefile.in: Rebuild.
>
> If this is trying to fix AIX search paths, a better solution would
> seem to be the equivalent of -static-libstdc++ -static-libgcc. The Go
> tools should be linked statically and not depend on Go shared
> libraries.
On GNU/Linux I used to use -static-libgo, but I changed it because of
https://gcc.gnu.org/PR64738. Of course on AIX we can do as you
prefer.
Ian