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]

Fix libcc1 bootstrap and linking issues


Hi

A few issues came to light this morning on some systems with
bootstrapping and libiberty linking issues.  We erroneously specified
-Werror in stage one builds.  This patch removes that flag.  We also
unconditionally linked with the PIC version of libiberty.  This patch
adds a conditional if to Makefile.am.

The conditional if I am not terribly sure of.  But it is the only way
I can think of to conditionally test for one version of libiberty over
another.  I pretty much just took the if code from the
lto_plugin/Makefile.am

What do you think?

Cheers

Phil

--

2014-10-28  Phil Muldoon <pmuldoon@redhat.com>

    * configure.ac: Remove -Werror.
    * configure: Regenerate.
    * Makefile.am: Remove -Werror. Link correct libiberty.
    * Makefile.in: Regenerate.

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)))
+
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: configure
===================================================================
--- configure    (revision 216776)
+++ configure    (working copy)
@@ -14342,7 +14342,7 @@
   done
 CFLAGS="$save_CFLAGS"
 
-WARN_FLAGS="$WARN_FLAGS -Werror"
+WARN_FLAGS="$WARN_FLAGS"
 
 
 libsuffix=
Index: configure.ac
===================================================================
--- configure.ac    (revision 216776)
+++ configure.ac    (working copy)
@@ -52,7 +52,7 @@
 AC_SUBST(gcc_version)
 
 ACX_PROG_CC_WARNING_OPTS([-W -Wall], [WARN_FLAGS])
-WARN_FLAGS="$WARN_FLAGS -Werror"
+WARN_FLAGS="$WARN_FLAGS"
 AC_SUBST(WARN_FLAGS)
 
 libsuffix=


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