This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/5] add libcc1


On Tue, Oct 28, 2014 at 01:05:00AM +0100, Dominique Dhumieres wrote:
> > This patch has now been committed.
> 
> It breaks bootstap on x86_64-apple-darwin14:
> 
> ...
> make[3]: Entering directory `/opt/gcc/p_build/libcc1'
> make  all-am
> make[4]: Entering directory `/opt/gcc/p_build/libcc1'
> make[4]: *** No rule to make target `../libiberty/pic/libiberty.a', needed by `libcc1.la'.  Stop.
> make[4]: Leaving directory `/opt/gcc/p_build/libcc1'
> make[3]: *** [all] Error 2
> make[3]: Leaving directory `/opt/gcc/p_build/libcc1'
> make[2]: *** [all-stage1-libcc1] Error 2
> make[2]: Leaving directory `/opt/gcc/p_build'
> make[1]: *** [stage1-bubble] Error 2
> make[1]: Leaving directory `/opt/gcc/p_build'
> make: *** [all] Error 2

There are other issues related to --with-build-config=bootstrap-{a,ub}san
in there too, my current WIP patch is but didn't get to test it yet.

--- libcc1/Makefile.am.jj	2014-10-27 19:41:13.000000000 +0100
+++ libcc1/Makefile.am	2014-10-28 09:07:57.443711725 +0100
@@ -24,8 +24,17 @@ AM_CPPFLAGS = -I $(srcdir)/../include -I
 	-I $(srcdir)/../libcpp/include
 WERROR_FLAG = -Werror
 AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR_FLAG) $(visibility)
-libiberty = ../libiberty/pic/libiberty.a
-
+override CXXFLAGS := $(filter-out -fsanitize=address,$(CXXFLAGS))
+override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
+# Can be simplified when libiberty becomes a normal convenience library.
+libiberty_normal = ../libiberty/libiberty.a
+libiberty_noasan = ../libiberty/noasan/libiberty.a
+libiberty_pic = ../libiberty/pic/libiberty.a
+Wc=-Wc,
+libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
+	    $(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic), \
+	    $(Wc)$(libiberty_normal)))
+libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
 
 plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
 cc1libdir = $(libdir)/$(libsuffix)
@@ -49,7 +58,16 @@ shared_source = callbacks.cc callbacks.h
 libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
 libcc1plugin_la_SOURCES = plugin.cc $(shared_source)
 libcc1plugin_la_LIBADD = $(libiberty)
+libcc1plugin_la_DEPENDENCIES = $(libiberty_dep)
+libcc1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
 
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym
 libcc1_la_SOURCES = findcomp.cc libcc1.cc names.cc names.hh $(shared_source)
 libcc1_la_LIBADD = $(libiberty)
+libcc1_la_DEPENDENCIES = $(libiberty_dep)
+libcc1_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(libcc1_la_LDFLAGS) $(LTLDFLAGS) -o $@
--- libcc1/Makefile.in.jj	2014-10-27 19:41:13.000000000 +0100
+++ libcc1/Makefile.in	2014-10-28 09:08:01.689922599 +0100
@@ -81,20 +81,12 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = "$(DESTDIR)$(cc1libdir)" "$(DESTDIR)$(plugindir)"
 LTLIBRARIES = $(cc1lib_LTLIBRARIES) $(plugin_LTLIBRARIES)
-libcc1_la_DEPENDENCIES = $(libiberty)
 am__objects_1 = callbacks.lo connection.lo marshall.lo
 am_libcc1_la_OBJECTS = findcomp.lo libcc1.lo names.lo $(am__objects_1)
 libcc1_la_OBJECTS = $(am_libcc1_la_OBJECTS)
-libcc1_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
-	$(CXXFLAGS) $(libcc1_la_LDFLAGS) $(LDFLAGS) -o $@
 @ENABLE_PLUGIN_TRUE@am_libcc1_la_rpath = -rpath $(cc1libdir)
-libcc1plugin_la_DEPENDENCIES = $(libiberty)
 am_libcc1plugin_la_OBJECTS = plugin.lo $(am__objects_1)
 libcc1plugin_la_OBJECTS = $(am_libcc1plugin_la_OBJECTS)
-libcc1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
-	$(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(LDFLAGS) -o $@
 @ENABLE_PLUGIN_TRUE@am_libcc1plugin_la_rpath = -rpath $(plugindir)
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/../depcomp
@@ -259,7 +251,16 @@ AM_CPPFLAGS = -I $(srcdir)/../include -I
 
 WERROR_FLAG = -Werror
 AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR_FLAG) $(visibility)
-libiberty = ../libiberty/pic/libiberty.a
+# Can be simplified when libiberty becomes a normal convenience library.
+libiberty_normal = ../libiberty/libiberty.a
+libiberty_noasan = ../libiberty/noasan/libiberty.a
+libiberty_pic = ../libiberty/pic/libiberty.a
+Wc = -Wc,
+libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
+	    $(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic), \
+	    $(Wc)$(libiberty_normal)))
+
+libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
 plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
 cc1libdir = $(libdir)/$(libsuffix)
 @ENABLE_PLUGIN_TRUE@plugin_LTLIBRARIES = libcc1plugin.la
@@ -271,9 +272,20 @@ shared_source = callbacks.cc callbacks.h
 libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
 libcc1plugin_la_SOURCES = plugin.cc $(shared_source)
 libcc1plugin_la_LIBADD = $(libiberty)
+libcc1plugin_la_DEPENDENCIES = $(libiberty_dep)
+libcc1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
+
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym
 libcc1_la_SOURCES = findcomp.cc libcc1.cc names.cc names.hh $(shared_source)
 libcc1_la_LIBADD = $(libiberty)
+libcc1_la_DEPENDENCIES = $(libiberty_dep)
+libcc1_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(libcc1_la_LDFLAGS) $(LTLDFLAGS) -o $@
+
 all: $(BUILT_SOURCES) cc1plugin-config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -619,6 +631,8 @@ uninstall-am: uninstall-cc1libLTLIBRARIE
 	pdf pdf-am ps ps-am tags uninstall uninstall-am \
 	uninstall-cc1libLTLIBRARIES uninstall-pluginLTLIBRARIES
 
+override CXXFLAGS := $(filter-out -fsanitize=address,$(CXXFLAGS))
+override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
 
 # Put this in a header so we don't run sed for each compilation.  This
 # is also simpler to debug as one can easily see the constant.


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]