This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE:[PATCH,AIX] Changes for linking gotools on AIX.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]