From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38266 invoked by alias); 18 Jun 2015 09:41:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 38250 invoked by uid 89); 18 Jun 2015 09:41:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f49.google.com Received: from mail-oi0-f49.google.com (HELO mail-oi0-f49.google.com) (209.85.218.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 18 Jun 2015 09:41:33 +0000 Received: by oigx81 with SMTP id x81so53472676oig.1 for ; Thu, 18 Jun 2015 02:41:31 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.48.194 with SMTP id w185mr7865696oiw.95.1434620491312; Thu, 18 Jun 2015 02:41:31 -0700 (PDT) Received: by 10.60.147.170 with HTTP; Thu, 18 Jun 2015 02:41:31 -0700 (PDT) In-Reply-To: References: <20150618085943.GA13979@arm.com> Date: Thu, 18 Jun 2015 09:43:00 -0000 Message-ID: Subject: Re: [PATCH, testsuite]: Fix PR 65944, FAIL: g++.dg/lto/pr65276: undefined reference to std2::exception::~exception() From: Uros Bizjak To: James Greenhalgh Cc: "gcc-patches@gcc.gnu.org" , Jonathan Wakely Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-06/txt/msg01243.txt.bz2 On Thu, Jun 18, 2015 at 11:05 AM, Uros Bizjak wrote: >> This patch causes failures in arm-none-linux-gnueabihf testing: >> >> PASS->FAIL: g++.dg/lto/pr65276 cp_lto_pr65276_0.o-cp_lto_pr65276_1.o lin= k, -flto -O0 -std=3Dc++11 >> >> .../arm-none-linux-gnueabihf/obj/gcc4/gcc/testsuite/g++2/../../xg++ -B..= ./arm-none-linux-gnueabihf/obj/gcc4/gcc/testsuite/g++2/../../ cp_lto_pr6527= 6_0.o cp_lto_pr65276_1.o -fno-diagnostics-show-caret -fdiagnostics-color=3D= never -nostdinc++ -I.../arm-none-linux-gnueabihf/obj/gcc4/arm-none-linux-gn= ueabihf/libstdc++-v3/include/arm-none-linux-gnueabihf -I.../arm-none-linux-= gnueabihf/obj/gcc4/arm-none-linux-gnueabihf/libstdc++-v3/include -I.../gcc/= libstdc++-v3/libsupc++ -I.../gcc/libstdc++-v3/include/backward -I.../gcc/li= bstdc++-v3/testsuite/util -fmessage-length=3D0 -flto -O0 -std=3Dc++11 -L...= /arm-none-linux-gnueabihf/obj/gcc4/arm-none-linux-gnueabihf/./libstdc++-v3/= src/.libs -B.../arm-none-linux-gnueabihf/obj/gcc4/arm-none-linux-gnueabihf/= ./libstdc++-v3/src/.libs -L.../arm-none-linux-gnueabihf/obj/gcc4/arm-none-l= inux-gnueabihf/./libstdc++-v3/src/.libs -o g++-dg-lto-pr65276-01.exe >> cp_lto_pr65276_1.o (symbol from plugin): In function `typeinfo for std2:= :runtime_error': >> (.text+0x0): multiple definition of `typeinfo name for std2::exception' >> cp_lto_pr65276_0.o (symbol from plugin):(.text+0x0): first defined here >> cp_lto_pr65276_1.o (symbol from plugin): In function `typeinfo for std2:= :runtime_error': >> (.text+0x0): multiple definition of `typeinfo for std2::exception' >> cp_lto_pr65276_0.o (symbol from plugin):(.text+0x0): first defined here >> collect2: error: ld returned 1 exit status >> compiler exited with status 1 >> output is: >> cp_lto_pr65276_1.o (symbol from plugin): In function `typeinfo for std2:= :runtime_error': >> (.text+0x0): multiple definition of `typeinfo name for std2::exception' >> cp_lto_pr65276_0.o (symbol from plugin):(.text+0x0): first defined here >> cp_lto_pr65276_1.o (symbol from plugin): In function `typeinfo for std2:= :runtime_error': >> (.text+0x0): multiple definition of `typeinfo for std2::exception' >> cp_lto_pr65276_0.o (symbol from plugin):(.text+0x0): first defined here >> collect2: error: ld returned 1 exit status > > I discussed this patch privately with Jon, where he suggested that the > approach is OK. The patch also works for me on both, CentOS 5.11 and > Fedora 22. > > I'm out of ideas why this doesn't work on your system. Can you investigat= e it? FYI, patched testcase compiles to following assembly on CentOS 5.11: cp_lto_pr65276_0.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <_ZN4std29exceptionD1Ev>: 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: 48 83 ec 10 sub $0x10,%rsp 8: 48 89 7d f8 mov %rdi,0xfffffffffffffff8(%rbp) c: ba 00 00 00 00 mov $0x0,%edx d: R_X86_64_32 _ZTVN4std29exceptionE+0x10 11: 48 8b 45 f8 mov 0xfffffffffffffff8(%rbp),%rax 15: 48 89 10 mov %rdx,(%rax) 18: b8 00 00 00 00 mov $0x0,%eax 1d: 85 c0 test %eax,%eax 1f: 74 0c je 2d <_ZN4std29exceptionD1Ev+0x2d> 21: 48 8b 45 f8 mov 0xfffffffffffffff8(%rbp),%rax 25: 48 89 c7 mov %rax,%rdi 28: e8 00 00 00 00 callq 2d <_ZN4std29exceptionD1Ev+0x2d> 29: R_X86_64_PC32 _ZdlPv+0xfffffffffffffffc 2d: c9 leaveq 2e: c3 retq 2f: 90 nop 0000000000000030 <_ZN4std29exceptionD0Ev>: 30: 55 push %rbp 31: 48 89 e5 mov %rsp,%rbp 34: 48 83 ec 10 sub $0x10,%rsp 38: 48 89 7d f8 mov %rdi,0xfffffffffffffff8(%rbp) 3c: 48 8b 45 f8 mov 0xfffffffffffffff8(%rbp),%rax 40: 48 89 c7 mov %rax,%rdi 43: e8 00 00 00 00 callq 48 <_ZN4std29exceptionD0Ev+0x18> 44: R_X86_64_PC32 _ZN4std29exceptionD1Ev+0xfffffffffffffffc 48: 48 8b 45 f8 mov 0xfffffffffffffff8(%rbp),%rax 4c: 48 89 c7 mov %rax,%rdi 4f: e8 00 00 00 00 callq 54 <_ZN4std29exceptionD0Ev+0x24> 50: R_X86_64_PC32 _ZdlPv+0xfffffffffffffffc 54: c9 leaveq 55: c3 retq Unpatched testcase produces empty object file. Uros.