diff mbox

[5/5] add libcc1

Message ID 544F8253.4040906@redhat.com
State New
Headers show

Commit Message

Phil Muldoon Oct. 28, 2014, 11:47 a.m. UTC
On 28/10/14 10:51, Uros Bizjak wrote:
> On Tue, Oct 28, 2014 at 11:35 AM, Phil Muldoon <pmuldoon@redhat.com> wrote:
>
>>>>>> This patch has now been committed.
>>>>>
>>>>> Also breaks bootstap on x86_64-linux-gnu, CentOS 5.11:
>>>>
>>>> For -Werror, I'd think that should fix that, WARN_FLAGS should
>>>> already contain -Werror during stage2/stage3 unless --disable-werror.
>>>> Untested though.
>>>
>>> No, it still fails, although with one -Werror less in the compile flags:
>>
>> Does removing it from configure.ac and regenerating configure work?
>>
>> I don't have access to a system compiler of the version you have, so I
>> am unable to test.
>
> Yes, this patch allows bootstrap to pass stage1, although with a new warning:
>
> *** Warning: Linking the shared library libcc1.la against the
> *** static library ../libiberty/pic/libiberty.a is not portable!
>
> Thanks,
> Uros.

I think I have a solution.  Though my automake fu is very weak.  Does
this patch work for you?  I'm really not sure how to deal with the
three possible versions of libiberty any other way.

Cheers

Phil

--
diff mbox

Patch

Index: Makefile.in
===================================================================
--- Makefile.in    (revision 216776)
+++ Makefile.in    (working copy)
@@ -81,7 +81,8 @@ 
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = "$(DESTDIR)$(cc1libdir)" "$(DESTDIR)$(plugindir)"
 LTLIBRARIES = $(cc1lib_LTLIBRARIES) $(plugin_LTLIBRARIES)
-libcc1_la_DEPENDENCIES = $(libiberty)
+libcc1_la_DEPENDENCIES = $(if $(wildcard $(libiberty_noasan)),, $(if \
+    $(wildcard $(libiberty_pic)),,$(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)
@@ -89,7 +90,8 @@ 
     $(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)
+libcc1plugin_la_DEPENDENCIES = $(if $(wildcard $(libiberty_noasan)),, \
+    $(if $(wildcard $(libiberty_pic)),,$(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) \
@@ -257,9 +259,10 @@ 
     -I $(srcdir)/../gcc/c -I $(srcdir)/../gcc/c-family \
     -I $(srcdir)/../libcpp/include
 
-WERROR_FLAG = -Werror
-AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR_FLAG) $(visibility)
-libiberty = ../libiberty/pic/libiberty.a
+AM_CXXFLAGS = $(WARN_FLAGS) $(visibility)
+libiberty = ../libiberty/libiberty.a
+libiberty_noasan = ../libiberty/noasan/libiberty.a
+libiberty_pic = ../libiberty/pic/libiberty.a
 plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
 cc1libdir = $(libdir)/$(libsuffix)
 @ENABLE_PLUGIN_TRUE@plugin_LTLIBRARIES = libcc1plugin.la
@@ -270,10 +273,16 @@ 
 
 libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
 libcc1plugin_la_SOURCES = plugin.cc $(shared_source)
-libcc1plugin_la_LIBADD = $(libiberty)
+libcc1plugin_la_LIBADD = \
+    $(if $(wildcard $(libiberty_noasan)),, \
+    $(if $(wildcard $(libiberty_pic)),,$(libiberty)))
+
 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_LIBADD = \
+    $(if $(wildcard $(libiberty_noasan)),, \
+    $(if $(wildcard $(libiberty_pic)),,$(libiberty)))
+
 all: $(BUILT_SOURCES) cc1plugin-config.h
     $(MAKE) $(AM_MAKEFLAGS) all-am
 
Index: Makefile.am
===================================================================
--- Makefile.am    (revision 216776)
+++ Makefile.am    (working copy)
@@ -22,10 +22,11 @@ 
     -I $(gcc_build_dir) -I$(srcdir)/../gcc \
     -I $(srcdir)/../gcc/c -I $(srcdir)/../gcc/c-family \
     -I $(srcdir)/../libcpp/include
-WERROR_FLAG = -Werror
-AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR_FLAG) $(visibility)
-libiberty = ../libiberty/pic/libiberty.a
+AM_CXXFLAGS = $(WARN_FLAGS) $(visibility)
 
+libiberty = ../libiberty/libiberty.a
+libiberty_noasan = ../libiberty/noasan/libiberty.a
+libiberty_pic = ../libiberty/pic/libiberty.a
 
 plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
 cc1libdir = $(libdir)/$(libsuffix)
@@ -48,8 +49,13 @@ 
 
 libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
 libcc1plugin_la_SOURCES = plugin.cc $(shared_source)
-libcc1plugin_la_LIBADD = $(libiberty)
+libcc1plugin_la_LIBADD = \
+    $(if $(wildcard $(libiberty_noasan)),, \
+    $(if $(wildcard $(libiberty_pic)),,$(libiberty)))
 
 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_LIBADD = \
+    $(if $(wildcard $(libiberty_noasan)),, \
+    $(if $(wildcard $(libiberty_pic)),,$(libiberty)))
+