On Fri, Nov 29, 2013 at 11:22:00AM -0800, H.J. Lu wrote: > On Mon, Nov 18, 2013 at 6:44 AM, Marek Polacek <pola...@redhat.com> wrote: > > On Mon, Nov 18, 2013 at 02:51:41PM +0100, Jakub Jelinek wrote: > >> On Wed, Nov 13, 2013 at 12:13:48AM +0100, Marek Polacek wrote: > >> > --- gcc/config/bootstrap-ubsan.mk.mp 2013-11-12 > >> > 13:46:13.345182065 +0100 > >> > +++ gcc/config/bootstrap-ubsan.mk 2013-11-12 13:46:49.812314016 +0100 > >> > @@ -2,6 +2,6 @@ > >> > > >> > STAGE2_CFLAGS += -fsanitize=undefined > >> > STAGE3_CFLAGS += -fsanitize=undefined > >> > -POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan -lpthread \ > >> > +POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan -lpthread > >> > -ldl \ > >> > >> Hopefully with my pending patch you can remove the -lpthread -ldl again, > >> but > >> ok for now. > > > > You shouldn't use -ldl directly. Not all OSes have libdl. You > should extract the libdl check from gcc/configure.ac and > set LIBDL instead by changing gcc/Makefile.in
-static-libubsan should add all the libraries needed of libubsan.a by now, so -lpthread -ldl should be just removed from POSTSTAGE1_LDFLAGS. Jakub