Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2015 10:55:06 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        sbruno@freebsd.org
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: -current static linking or overlinking ...
Message-ID:  <20150217085506.GQ34251@kib.kiev.ua>
In-Reply-To: <54E2A75C.9060404@ignoranthack.me>
References:  <54E25342.9060308@ignoranthack.me> <20150216235032.GP34251@kib.kiev.ua> <54E2A75C.9060404@ignoranthack.me>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 16, 2015 at 06:28:44PM -0800, Sean Bruno wrote:
> -----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
> 
I really do not see how is this possible except inconsistent buildworld or
installworld.

The patch is committed as r278889.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150217085506.GQ34251>