diff mbox

Fix libcc1 bootstrap and linking issues

Message ID 544F8B07.1000904@redhat.com
State New
Headers show

Commit Message

Phil Muldoon Oct. 28, 2014, 12:24 p.m. UTC
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.

Comments

Jakub Jelinek Oct. 28, 2014, 12:34 p.m. UTC | #1
On Tue, Oct 28, 2014 at 12:24:39PM +0000, Phil Muldoon wrote:
> 2014-10-28  Phil Muldoon <pmuldoon@redhat.com>
> 
>     * configure.ac: Remove -Werror.
>     * configure: Regenerate.
>     * Makefile.am: Remove -Werror. Link correct libiberty.
>     * Makefile.in: Regenerate.

As for -Werror, doesn't your patch completely remove -Werror from the flags?
Looking around, we have config/warnings.m4 which contains
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
macro used by several libraries, which supposedly enables -Werror when
requested.

	Jakub
Phil Muldoon Oct. 28, 2014, 12:35 p.m. UTC | #2
On 28/10/14 12:24, Phil Muldoon wrote:
> 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.
>
>
Turns out Jakub had a patch out already, and it is a better patch than my attempt.  So withdrawing this one.

Cheers

Phil
Phil Muldoon Oct. 28, 2014, 12:42 p.m. UTC | #3
On 28/10/14 12:34, Jakub Jelinek wrote:
> On Tue, Oct 28, 2014 at 12:24:39PM +0000, Phil Muldoon wrote:
>> 2014-10-28  Phil Muldoon <pmuldoon@redhat.com>
>>
>>     * configure.ac: Remove -Werror.
>>     * configure: Regenerate.
>>     * Makefile.am: Remove -Werror. Link correct libiberty.
>>     * Makefile.in: Regenerate.
>
> As for -Werror, doesn't your patch completely remove -Werror from the flags?
> Looking around, we have config/warnings.m4 which contains
> ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
> macro used by several libraries, which supposedly enables -Werror when
> requested.
>
>     Jakub

Yeah Uros was reporting that the -Werror flag in configure.ac was also
conflicting. auto-* tools are definetly not my strong point, and I did
not write these build configurations.  Anyway, this is somewhat moot
as your patch is earlier and better than mine, so we'll go with that.
Thanks for taking a look at the issue and coming up with a fix.

Cheers

Phil
diff mbox

Patch

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=