From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 17 02:28:47 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57DB053F for ; Tue, 17 Feb 2015 02:28:47 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34512800 for ; Tue, 17 Feb 2015 02:28:46 +0000 (UTC) Received: from [192.168.200.212] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 62755192A3B; Tue, 17 Feb 2015 02:28:45 +0000 (UTC) Message-ID: <54E2A75C.9060404@ignoranthack.me> Date: Mon, 16 Feb 2015 18:28:44 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: -current static linking or overlinking ... References: <54E25342.9060308@ignoranthack.me> <20150216235032.GP34251@kib.kiev.ua> In-Reply-To: <20150216235032.GP34251@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2015 02:28:47 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 02/16/15 15:50, Konstantin Belousov wrote: > On Mon, Feb 16, 2015 at 12:29:54PM -0800, Sean Bruno wrote: >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 >> >> Building the qemu bsd-user static targets on head seem to be >> "overlinking" or something that is pulling in multiple copies of >> symbols. I'm not confident in my terminology here so I could be >> using the wrong terms. >> >> This is a recent regression (last couple of months). >> >> e.g. checkout qemu source, configure with: ./configure >> --target-list="i386-bsd-user" --static >> >> and build with gmake, You'll see a bunch of this at random >> places where things are linked statically. I assume "something" >> has changed in the toolchain that requires a change to the QEMU >> build? >> >> CC stubs/vm-stop.o CC stubs/vmstate.o CC stubs/cpus.o CC >> stubs/kvm.o CC stubs/qmp_pc_dimm_device_list.o AR >> libqemustub.a LINK qemu-ga /usr/lib/libpthread.a(thr_spec.o): >> warning: multiple common of `__cleanup' /usr/lib/crt1.o: warning: >> previous common is here /usr/lib/libpthread.a(thr_sig.o): >> warning: multiple common of `__cleanup' /usr/lib/crt1.o: warning: >> previous common is here /usr/lib/libpthread.a(thr_init.o): >> warning: multiple common of `__cleanup' /usr/lib/crt1.o: warning: >> previous common is here /usr/lib/libpthread.a(thr_rtld.o): >> warning: multiple common of `__cleanup' /usr/lib/crt1.o: warning: >> previous common is here /usr/lib/libpthread.a(thr_fork.o): >> warning: multiple common of `__cleanup' /usr/lib/crt1.o: warning: >> previous common is here /usr/lib/libpthread.a(thr_create.o): >> warning: multiple common of `__cleanup' /usr/lib/crt1.o: warning: >> previous common is here /usr/lib/libpthread.a(thr_exit.o): >> warning: multiple common of `__cleanup' /usr/lib/crt1.o: warning: >> previous common is here /usr/lib/libpthread.a(thr_error.o): >> warning: multiple common of `__cleanup' /usr/lib/crt1.o: warning: >> previous common is here > > This should fix it. You must rebuild the world to test. > > diff --git a/lib/libc/include/libc_private.h > b/lib/libc/include/libc_private.h index 71fc8df..e4bf4a6 100644 --- > a/lib/libc/include/libc_private.h +++ > b/lib/libc/include/libc_private.h @@ -271,7 +271,7 @@ void > _malloc_first_thread(void); /* * Function to clean up streams, > called from abort() and exit(). */ -void (*__cleanup)(void) > __hidden; +extern void (*__cleanup)(void) __hidden; > > /* * Get kern.osreldate to detect ABI revisions. Explicitly > This patch eliminates the libpthread.a warnings, which is the majority of the warnings. I believe I am now dealing with the previously existing warning messages now. There are still a few left from libc.a/crt1.o when building static. GEN trace/generated-helpers.c CC arm-bsd-user/trace/generated-helpers.o LINK arm-bsd-user/qemu-arm /usr/lib/libc.a(exit.o): warning: multiple common of `__cleanup' /usr/lib/crt1.o: warning: previous common is here GEN aarch64-bsd-user/config-target.h CC aarch64-bsd-user/exec.o sean -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJU4qdZXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kgKIIAKJw+J7rF+IpoUru3ULSGxMd AylcKISTNjkj6irCI7agZxyQV+/nxlIRa5t/WbZb74oAE4WBI2PRou4PUpWimk5C bpk4I+TbH0dT6LUDAVaL48qTIy9QUsHmlUZ4ANphyengW8Mgk5rCPbXG61fH4eMi 8MeT79iDoEPTxzCAC0gyw3IjQ+5rx6jQ/TXwX4Ao4mlXsbGdYJSJDIzs9gXVwa+6 vMPB1GPjyB8hOfX7/CU8Isjw+oFZiqVETevck4spxqNQS90GEUuURufSE5HCQE7Z 65S5Y8tbXoOBP4GToqMC2YpwwvcOLz30wtVuJLjN55obVm6qrOokL+ulhQvTY/0= =8/tU -----END PGP SIGNATURE-----