Bug 65522 - [5 Regression] Svn revision 221590 fails bootstrap - ../libiberty/libiberty.a(cplus-dem.o): In function `ada_demangle': cplus-dem.c:(.text+0xdb8): multiple definition of `ada_demangle' ada/adadecode.o:adadecode.c:(.text+0x863): first defined here
Summary: [5 Regression] Svn revision 221590 fails bootstrap - ../libiberty/libiberty.a...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 5.0
: P1 normal
Target Milestone: 5.0
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-23 10:31 UTC by David Kredba
Modified: 2015-03-23 15:50 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-03-23 00:00:00


Attachments
gcc5-pr65522.patch (995 bytes, patch)
2015-03-23 12:57 UTC, Jakub Jelinek
Details | Diff
gcc5-pr65522.patch (647 bytes, text/plain)
2015-03-23 14:30 UTC, Jakub Jelinek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Kredba 2015-03-23 10:31:22 UTC
../libiberty/libiberty.a(cplus-dem.o): In function `ada_demangle':
cplus-dem.c:(.text+0xdb8): multiple definition of `ada_demangle'
ada/adadecode.o:adadecode.c:(.text+0x863): first defined here
collect2: error: ld returned 1 exit status
/var/tmp/portage/sys-devel/gcc-4.10.0_pre20150322/work/gcc-4.10.0-20150322/gcc/ada/gcc-interface/Make-lang.in:600: návod pro cíl „gnat1“ selhal

Revision 221558 was OK.
Comment 1 Richard Biener 2015-03-23 11:56:41 UTC
Confirmed by Andreas.
Comment 2 Jakub Jelinek 2015-03-23 12:57:16 UTC
Created attachment 35109 [details]
gcc5-pr65522.patch

Seems the ada/adadecode.[ch] (ada_demangle) function is totally unused.
Comment 3 Jakub Jelinek 2015-03-23 13:13:07 UTC
Ah, except ada_demangle is also exported from libgnat*.so - wonder why the RTS is built with IN_GCC.
In that case, guess the Ada folks need to decide which one of the two to keep, and/or if one of them (either adadecode.[ch], or {include,libiberty}/* one shouldn't be renamed to something else.
I haven't found any uses of either of those, except the libiberty demangler that calls ada_demangle but it could very well call a static routine instead.
Comment 4 Eric Botcazou 2015-03-23 13:36:50 UTC
> Ah, except ada_demangle is also exported from libgnat*.so - wonder why the
> RTS is built with IN_GCC.

This is explained in gcc-interface/Makefile.in.

> In that case, guess the Ada folks need to decide which one of the two to
> keep, and/or if one of them (either adadecode.[ch], or {include,libiberty}/*
> one shouldn't be renamed to something else.

I think your patch is fine, but I'll let Arno approve it.
Comment 5 Jakub Jelinek 2015-03-23 14:30:48 UTC
Created attachment 35112 [details]
gcc5-pr65522.patch

I'm actually testing a slightly adjusted variant that keeps the compatibility ada_demangle in libgnat* for ABI reasons, but not in gnat1 which doesn't use it and thus can link against libiberty.
Comment 6 Jakub Jelinek 2015-03-23 15:49:34 UTC
Author: jakub
Date: Mon Mar 23 15:49:02 2015
New Revision: 221599

URL: https://gcc.gnu.org/viewcvs?rev=221599&root=gcc&view=rev
Log:
	PR bootstrap/65522
	* ipa-devirt.c: Remove duplicate demangle.h include.

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

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/adadecode.c
    trunk/gcc/ipa-devirt.c
Comment 7 Jakub Jelinek 2015-03-23 15:50:07 UTC
Fixed.