From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Khp1P-00037G-VW for qemu-devel@nongnu.org; Mon, 22 Sep 2008 13:16:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Khp1N-00036g-IG for qemu-devel@nongnu.org; Mon, 22 Sep 2008 13:16:27 -0400 Received: from [199.232.76.173] (port=59004 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Khp1N-00036c-8U for qemu-devel@nongnu.org; Mon, 22 Sep 2008 13:16:25 -0400 Received: from mail-gx0-f19.google.com ([209.85.217.19]:64069) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Khp1L-0002Pe-SD for qemu-devel@nongnu.org; Mon, 22 Sep 2008 13:16:24 -0400 Received: by gxk12 with SMTP id 12so3541286gxk.10 for ; Mon, 22 Sep 2008 10:16:21 -0700 (PDT) Message-ID: Date: Mon, 22 Sep 2008 20:16:21 +0300 From: "Blue Swirl" Subject: Re: [Qemu-devel] [PATCH, RFC] ld flag --warn-common In-Reply-To: <20080922163940.GA5402@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080919163730.GA5016@localhost.localdomain> <20080921211432.GA28684@localhost.localdomain> <20080922163940.GA5402@localhost.localdomain> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 9/22/08, Kirill A. Shutemov wrote: > On Mon, Sep 22, 2008 at 07:24:27PM +0300, Blue Swirl wrote: > > On 9/22/08, Kirill A. Shutemov wrote: > > > On Sat, Sep 20, 2008 at 10:49:36AM +0300, Blue Swirl wrote: > > > > On 9/19/08, Kirill A. Shutemov wrote: > > > > > On Sun, Sep 07, 2008 at 11:24:37AM +0300, Blue Swirl wrote: > > > > > > Hi, > > > > > > > > > > > > These trivial patches enable linker flag --warn-common and fix the > > > > > > warnings caused by enabling the flag. > > > > > > > > > > > > > > > This flag cause a lot of warning on my machine, even with trivial program. > > > > > > > > > > $ cat 1.c > > > > > #include > > > > > > > > > > int main() > > > > > { > > > > > printf("test\n"); > > > > > return 0; > > > > > } > > > > > $ gcc -Wl,--warn-common -static 1.c > > > > > /usr/lib64/gcc/x86_64-alt-linux/4.1.2/../../../../lib64/libc.a(strtoul.o): warning: multiple common of `_nl_category_name_idxs' > > > > > /usr/lib64/gcc/x86_64-alt-linux/4.1.2/../../../../lib64/libc.a(strtol.o): warning: previous common is here > > > > > /usr/lib64/gcc/x86_64-alt-linux/4.1.2/../../../../lib64/libc.a(strtol_l.o): warning: multiple common of `_nl_category_name_idxs' > > > > > /usr/lib64/gcc/x86_64-alt-linux/4.1.2/../../../../lib64/libc.a(strtol.o): warning: previous common is here > > > > > /usr/lib64/gcc/x86_64-alt-linux/4.1.2/../../../../lib64/libc.a(strtoul_l.o): warning: multiple common of `_nl_category_name_idxs' > > > > > /usr/lib64/gcc/x86_64-alt-linux/4.1.2/../../../../lib64/libc.a(strtol.o): warning: previous common is here > > > > > /usr/lib64/gcc/x86_64-alt-linux/4.1.2/../../../../lib64/libc.a(vfprintf.o): warning: multiple common of `_nl_category_name_idxs' > > > > > /usr/lib64/gcc/x86_64-alt-linux/4.1.2/../../../../lib64/libc.a(strtol.o): warning: previous common is here > > > > > > > > > > ...and so on. > > > > > > > > > > > > > > > Is it problem with my toolchain? What is your testing environment? > > > > > > > > I get no warnings for Qemu build on Debian i386, amd64 > > > > (stable/unstable), Sparc32, Sparc64 or on OpenBSD/Sparc64. Your > > > > program produces one warning on Debian stable (all hosts except no > > > > warnings on arm), no warnings on Debian amd64 unstable or OpenBSD. > > > > > > > > > I've got a lot of warnings on ALT Linux x86_64 and Ubuntu x86_64. Both > > > with gcc 4.1.2. Are you sure that you test static build? > > > > $ gcc -Wl,--warn-common -static main.c > > /usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64/libc.a(dl-open.o): > > warning: definition of `_dl_tls_static_size' overriding common > > /usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64/libc.a(libc-tls.o): > > warning: common is here > > $ cat main.c > > #include > > > > int main() > > { > > printf("test\n"); > > return 0; > > } > > > I think --warn-common shouldn't be added to LDFLAGS, when we build static > qemu. Another solution would be to add a configure time check if the system libraries suck or not. Though these are only warnings and you seem to be the only person complaining.