public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH,AIX] Changes for linking gotools on AIX.
@ 2017-07-26 16:41 REIX, Tony
  2017-07-26 16:58 ` David Edelsohn
  0 siblings, 1 reply; 5+ messages in thread
From: REIX, Tony @ 2017-07-26 16:41 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ian Lance Taylor, dje.gcc

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

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.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gcc-8.0.0-gotools.patch --]
[-- Type: text/x-patch; name="gcc-8.0.0-gotools.patch", Size: 1882 bytes --]

Index: gotools/ChangeLog
===================================================================
--- gotools/ChangeLog	(révision 250563)
+++ gotools/ChangeLog	(copie de travail)
@@ -1,3 +1,8 @@
+2017-07-26  Tony Reix  <tony.reix@atos.net>
+
+	* Makefile.am (AM_LDFLAGS & GOLINK): Changes for linking on AIX.
+	* Makefile.in: Rebuild.
+
 2017-07-15  Ian Lance Taylor  <iant@golang.org>
 
 	* Makefile.am (CHECK_ENV): Set GOROOT.
Index: gotools/Makefile.am
===================================================================
--- gotools/Makefile.am	(révision 250563)
+++ gotools/Makefile.am	(copie de travail)
@@ -40,7 +40,11 @@ GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS)
 
 AM_GOCFLAGS = -I $(libgodir)
 AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs
-GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
+ifeq ($(shell uname), AIX)
+    AM_LDFLAGS += -Wl,-blibpath:$(libdir):/usr/lib:/lib
+    GOLINK = LIBRARY_PATH=$(libgodir)/.libs
+endif
+GOLINK += $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
 
 libgosrcdir = $(srcdir)/../libgo/go
 cmdsrcdir = $(libgosrcdir)/cmd
Index: gotools/Makefile.in
===================================================================
--- gotools/Makefile.in	(révision 250563)
+++ gotools/Makefile.in	(copie de travail)
@@ -260,7 +260,11 @@ LIBGODEP = $(libgodir)/libgo.la
 GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS)
 AM_GOCFLAGS = -I $(libgodir)
 AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs
-GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
+ifeq ($(shell uname), AIX)
+    AM_LDFLAGS += -Wl,-blibpath:$(libdir):/usr/lib:/lib
+    GOLINK = LIBRARY_PATH=$(libgodir)/.libs
+endif
+GOLINK += $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
 libgosrcdir = $(srcdir)/../libgo/go
 cmdsrcdir = $(libgosrcdir)/cmd
 libgomiscdir = $(srcdir)/../libgo/misc

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH,AIX] Changes for linking gotools on AIX.
  2017-07-26 16:41 [PATCH,AIX] Changes for linking gotools on AIX REIX, Tony
@ 2017-07-26 16:58 ` David Edelsohn
  2017-07-26 18:06   ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: David Edelsohn @ 2017-07-26 16:58 UTC (permalink / raw)
  To: REIX, Tony; +Cc: gcc-patches, Ian Lance Taylor

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.

Thanks, David

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH,AIX] Changes for linking gotools on AIX.
  2017-07-26 16:58 ` David Edelsohn
@ 2017-07-26 18:06   ` Ian Lance Taylor
  2017-07-27 15:51     ` REIX, Tony
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2017-07-26 18:06 UTC (permalink / raw)
  To: David Edelsohn; +Cc: REIX, Tony, gcc-patches

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE:[PATCH,AIX] Changes for linking gotools on AIX.
  2017-07-26 18:06   ` Ian Lance Taylor
@ 2017-07-27 15:51     ` REIX, Tony
  2017-07-28 13:18       ` [PATCH,AIX] " David Edelsohn
  0 siblings, 1 reply; 5+ messages in thread
From: REIX, Tony @ 2017-07-27 15:51 UTC (permalink / raw)
  To: Ian Lance Taylor, David Edelsohn; +Cc: gcc-patches, BERGAMINI, DAMIEN

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH,AIX] Changes for linking gotools on AIX.
  2017-07-27 15:51     ` REIX, Tony
@ 2017-07-28 13:18       ` David Edelsohn
  0 siblings, 0 replies; 5+ messages in thread
From: David Edelsohn @ 2017-07-28 13:18 UTC (permalink / raw)
  To: REIX, Tony; +Cc: Ian Lance Taylor, gcc-patches, BERGAMINI, DAMIEN

On Thu, Jul 27, 2017 at 11:51 AM, REIX, Tony <tony.reix@atos.net> wrote:
> 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.

My concern is that the patch explicitly inserts the build directory
into the search path for the tools.  GCC already is fairly screwed up
with respect to the search path without explicitly making it worse.
Ideally, the libpath should be the install directory, not the build
directory.

If I understand your reply, this is a hack to allow the testsuite to
run in the build tree.

Thanks, David

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-28 13:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 16:41 [PATCH,AIX] Changes for linking gotools on AIX REIX, Tony
2017-07-26 16:58 ` David Edelsohn
2017-07-26 18:06   ` Ian Lance Taylor
2017-07-27 15:51     ` REIX, Tony
2017-07-28 13:18       ` [PATCH,AIX] " David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).