From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19945 invoked by alias); 25 Oct 2011 07:53:26 -0000 Received: (qmail 19932 invoked by uid 22791); 25 Oct 2011 07:53:24 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_00,RDNS_DYNAMIC,TW_NX,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: sourceware.org Received: from host-82-135-62-35.customer.m-online.net (HELO mail.embedded-brains.de) (82.135.62.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Oct 2011 07:53:08 +0000 Received: by mail.embedded-brains.de (Postfix, from userid 65534) id C60446525B5; Tue, 25 Oct 2011 09:52:59 +0200 (CEST) Received: from [192.168.96.31] (eb0011.eb.z [192.168.96.31]) by mail.embedded-brains.de (Postfix) with ESMTP id F2C876525B2; Tue, 25 Oct 2011 09:52:56 +0200 (CEST) Message-ID: <4EA66AD8.3040506@embedded-brains.de> Date: Tue, 25 Oct 2011 07:53:00 -0000 From: Sebastian Huber User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110920 SUSE/3.1.15 Lightning/1.0b2 Thunderbird/3.1.15 MIME-Version: 1.0 To: Ian Lance Taylor CC: gcc-help@gcc.gnu.org Subject: Re: LTO with static libraries References: <4EA534F3.9050404@embedded-brains.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00212.txt.bz2 On 10/24/2011 07:06 PM, Ian Lance Taylor wrote: > Which version of the linker are you using? Can you try a newer version? I used GNU Binutils 2.21.1 (the latest release). I installed now 2.21.53.20110922 (2.22 release branch). This didn't work. Then I checked the Binutils configure options and added "--enable-lto". /home/sh/archive/binutils-2.21.53/configure --target=arm-rtemseabi4.11 --prefix=/opt/rtems-4.11 --disable-nls --disable-win32-registry --disable-werror --enable-lto With this I still get: /home/sh/b-arm-gcc/gcc/xgcc -B/home/sh/b-arm-gcc/gcc/ /home/sh/archive/gcc-4.6-20111021-work/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1.c /home/sh/archive/gcc-4.6-20111021-work/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1-lib.c /home/sh/archive/gcc-4.6-20111021-work/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c gcc_tg.o -w -O2 -flto -flto-partition=none -DSTACK_SIZE=2048 -isystem /home/sh/b-arm-gcc/arm-rtemseabi4.11/./newlib/targ-include -isystem /home/sh/archive/gcc-4.6-20111021-work/newlib/libc/include -mcpu=arm7tdmi -B/home/sh/install-4.6-20111021/arm-rtemseabi4.11/edb7312/lib/ -specs bsp_specs -qrtems -B/home/sh/b-arm-gcc/arm-rtemseabi4.11/./newlib/ -L/home/sh/b-arm-gcc/arm-rtemseabi4.11/./newlib /home/sh/b-arm-gcc/rtems_gcc_main.o -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm -o /home/sh/b-arm-gcc/gcc/testsuite/gcc/20010124-1.x6 /tmp/ccJbMxyE.lto.o: In function `memcpy': ccKyOGEO.o:(.text+0x4): multiple definition of `memcpy' /home/sh/b-arm-gcc/arm-rtemseabi4.11/./newlib/libc.a(lib_a-memcpy.o):/home/sh/archive/gcc-4.6-20111021-work/newlib/libc/string/memcpy.c:79: first defined here collect2: ld returned 1 exit status If I add "-Wl,--allow-multiple-definition" as suggested by Xunxun the link process succeeds. -- Sebastian Huber, embedded brains GmbH Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany Phone : +49 89 18 90 80 79-6 Fax : +49 89 18 90 80 79-9 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.