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 PLUGINLIBS = @pluginlibs@ to LIBDL = @libdl@ PLUGINLIBS = @pluginlibs@ $(LIBD) Then you can use POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan -lpthread $(LIBDL) \ -- H.J.