public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix Ada bootstrap (PR bootstrap/65522)
@ 2015-03-23 15:14 Jakub Jelinek
  2015-03-23 15:44 ` Arnaud Charlet
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2015-03-23 15:14 UTC (permalink / raw)
  To: Jan Hubicka, Arnaud Charlet, Eric Botcazou; +Cc: gcc-patches

Hi!

Honza's recent change to use the libiberty demangler inside of gcc
broke Ada bootstrap.  The issue is that there is a symbol clash,
libiberty contains ada_demangle symbol (with one API), and ada/adadecode.c
(since around 3.3 time, claimed for compatibility) contains another one,
with incompatible API, guarded with IN_GCC.  IN_GCC for some strange reason
in Ada means that it is linked both into gnat1 and libgnat*.{a,so}.
This means that current trunk fails to bootstrap, because there are
two ada_demangle definitions being linked in.
gnat1 doesn't use ada_demangle for anything, libgnat*.{a,so} only exports it
but there are no direct users, and ada_demangle in libiberty is used froim
the same file, but not elsewhere from what I could find.

In any case, for compatibility, this patch just changes the guard so that
adadecode.c's ada_demangle is compiled only into libgnat*.{a,so} and not
into gnat1, which can then successfully link against libiberty cplus-dem.o.

The ipa-devirt.c change is obvious IMHO, the same header is included a few
lines above this.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2015-03-23  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/65522
	* ipa-devirt.c: Remove duplicate demangle.h include.

	* adadecode.c (ada_demangle): Guard with IN_RTS instead of IN_GCC.

--- gcc/ipa-devirt.c.jj	2015-03-23 08:47:53.000000000 +0100
+++ gcc/ipa-devirt.c	2015-03-23 13:52:49.937174740 +0100
@@ -166,7 +166,6 @@ along with GCC; see the file COPYING3.
 #include "gimple-pretty-print.h"
 #include "stor-layout.h"
 #include "intl.h"
-#include "demangle.h"
 
 /* Hash based set of pairs of types.  */
 typedef struct
--- gcc/ada/adadecode.c.jj	2012-01-23 18:23:54.000000000 +0100
+++ gcc/ada/adadecode.c	2015-03-23 13:53:35.869429888 +0100
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *           Copyright (C) 2001-2012, Free Software Foundation, Inc.        *
+ *           Copyright (C) 2001-2015, Free Software Foundation, Inc.        *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -368,7 +368,7 @@ __gnat_decode (const char *coded_name, c
 extern "C" {
 #endif
 
-#ifdef IN_GCC
+#ifdef IN_RTS
 char *
 ada_demangle (const char *coded_name)
 {

	Jakub

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

* Re: [PATCH] Fix Ada bootstrap (PR bootstrap/65522)
  2015-03-23 15:14 [PATCH] Fix Ada bootstrap (PR bootstrap/65522) Jakub Jelinek
@ 2015-03-23 15:44 ` Arnaud Charlet
  2015-03-23 17:16   ` Jan Hubicka
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaud Charlet @ 2015-03-23 15:44 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Jan Hubicka, Eric Botcazou, gcc-patches

> In any case, for compatibility, this patch just changes the guard so that
> adadecode.c's ada_demangle is compiled only into libgnat*.{a,so} and not
> into gnat1, which can then successfully link against libiberty
> cplus-dem.o.
> 
> The ipa-devirt.c change is obvious IMHO, the same header is included a few
> lines above this.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

The Ada part looks OK to me.

Arno

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

* Re: [PATCH] Fix Ada bootstrap (PR bootstrap/65522)
  2015-03-23 15:44 ` Arnaud Charlet
@ 2015-03-23 17:16   ` Jan Hubicka
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Hubicka @ 2015-03-23 17:16 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: Jakub Jelinek, Jan Hubicka, Eric Botcazou, gcc-patches

> > In any case, for compatibility, this patch just changes the guard so that
> > adadecode.c's ada_demangle is compiled only into libgnat*.{a,so} and not
> > into gnat1, which can then successfully link against libiberty
> > cplus-dem.o.
> > 
> > The ipa-devirt.c change is obvious IMHO, the same header is included a few
> > lines above this.
> > 
> > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> The Ada part looks OK to me.

.. and the ipa-devirt part is obvious - I just did not notice demangler is among
includs we drag in.  Thanks!

Honza
> 
> Arno

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

end of thread, other threads:[~2015-03-23 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23 15:14 [PATCH] Fix Ada bootstrap (PR bootstrap/65522) Jakub Jelinek
2015-03-23 15:44 ` Arnaud Charlet
2015-03-23 17:16   ` Jan Hubicka

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).