public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/64023] New: [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler.
@ 2014-11-22 10:19 dominiq at lps dot ens.fr
  2014-11-22 10:21 ` [Bug bootstrap/64023] " dominiq at lps dot ens.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-11-22 10:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64023

            Bug ID: 64023
           Summary: [5 Regression] r216964 breaks bootstrap on darwin when
                    using gcc as the bootstrap compiler.
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominiq at lps dot ens.fr
                CC: fxcoudert at gcc dot gnu.org, howarth at bromo dot med.uc.edu,
                    iains at gcc dot gnu.org, jakub at redhat dot com
              Host: x86_64-apple-darwin*
            Target: x86_64-apple-darwin*
             Build: x86_64-apple-darwin*

When using gcc as the bootstrap compiler, bootstrapping fails at stage 3 on
darwin after r216964:

libtool: link:  /opt/gcc/p_build/./gcc/xg++ -B/opt/gcc/p_build/./gcc/
-nostdinc++ -nostdinc++
-I/opt/gcc/p_build/x86_64-apple-darwin14.0.0/libstdc++-v3/include/x86_64-apple-darwin14.0.0
-I/opt/gcc/p_build/x86_64-apple-darwin14.0.0/libstdc++-v3/include
-I/opt/gcc/p_work/libstdc++-v3/libsupc++
-I/opt/gcc/p_work/libstdc++-v3/include/backward
-I/opt/gcc/p_work/libstdc++-v3/testsuite/util
-L/opt/gcc/p_build/x86_64-apple-darwin14.0.0/libstdc++-v3/src
-L/opt/gcc/p_build/x86_64-apple-darwin14.0.0/libstdc++-v3/src/.libs
-L/opt/gcc/p_build/x86_64-apple-darwin14.0.0/libstdc++-v3/libsupc++/.libs
-B/opt/gcc/gcc4.10p-217961/x86_64-apple-darwin14.0.0/bin/
-B/opt/gcc/gcc4.10p-217961/x86_64-apple-darwin14.0.0/lib/ -isystem
/opt/gcc/gcc4.10p-217961/x86_64-apple-darwin14.0.0/include -isystem
/opt/gcc/gcc4.10p-217961/x86_64-apple-darwin14.0.0/sys-include   
-Wl,-undefined -Wl,dynamic_lookup -o .libs/libcc1.0.so -bundle 
.libs/findcomp.o .libs/libcc1.o .libs/names.o .libs/callbacks.o
.libs/connection.o .libs/marshall.o  
-L/opt/gcc/p_build/x86_64-apple-darwin14.0.0/libstdc++-v3/src
-L/opt/gcc/p_build/x86_64-apple-darwin14.0.0/libstdc++-v3/src/.libs
-L/opt/gcc/p_build/x86_64-apple-darwin14.0.0/libstdc++-v3/libsupc++/.libs 
-static-libstdc++ -static-libgcc -Wl,-no_pie ../libiberty/pic/libiberty.a  
-Wl,-exported_symbols_list,.libs/libcc1-symbols.expsym
ld: file not found: libstdc++.a

see https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00001.html and analysis at
https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00731.html.

Note that bootstrap succeeds when using clang as the bootstrap compiler (no
support for Ada).

The following patch from Iain Sandoe restores bootstrap:

--- ../_clean/libcc1/Makefile.in    2014-11-07 17:38:40.000000000 +0100
+++ libcc1/Makefile.in    2014-11-08 19:39:34.000000000 +0100
@@ -98,6 +98,10 @@ LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM
     --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
     $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
 CXXLD = $(CXX)
+
+CXX_LFLAGS = \
+ -Xcompiler -B../$(target_noncanonical)/libstdc++-v3/src/.libs \
+ -Xcompiler -B../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs
 CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
     --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
     $(LDFLAGS) -o $@
@@ -276,7 +280,7 @@ 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 $@
+    $(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(CXX_LFLAGS) $(LTLDFLAGS) -o $@

 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym
@@ -285,7 +289,7 @@ 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 $@
+    $(CXXFLAGS) $(libcc1_la_LDFLAGS) $(CXX_LFLAGS) $(LTLDFLAGS) -o $@

 all: $(BUILT_SOURCES) cc1plugin-config.h
     $(MAKE) $(AM_MAKEFLAGS) all-am


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/64023] [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler.
  2014-11-22 10:19 [Bug bootstrap/64023] New: [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler dominiq at lps dot ens.fr
@ 2014-11-22 10:21 ` dominiq at lps dot ens.fr
  2014-11-22 10:52 ` iains at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-11-22 10:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64023

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-11-22
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/64023] [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler.
  2014-11-22 10:19 [Bug bootstrap/64023] New: [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler dominiq at lps dot ens.fr
  2014-11-22 10:21 ` [Bug bootstrap/64023] " dominiq at lps dot ens.fr
@ 2014-11-22 10:52 ` iains at gcc dot gnu.org
  2014-11-24  0:09 ` fxcoudert at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: iains at gcc dot gnu.org @ 2014-11-22 10:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64023

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
as commented in 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63773 c#14..17
this is caused by
$(HOST_EXPORTS) being used at stage#N>1 instead of $(POSTSTAGE1_HOST_EXPORTS)

Thus the config test for the bootstrap compiler is affecting the later build. 
In this case, GCC fails to build because it supports -static-libstdc++ (and
thus the option is passed to the build) but it then needs the -B options to
allow for spec substitution to work for libstdc++.  These are not present in
HOST_EXPORTS because, obviously, the host compiler is installed and doesn't
need them.

NOTE: (clang succeeds because it does not support -staticlibstdc++, so that
option is not passed to the stage#3 libs build.
However in that case the fault is potentially more subtle, because the library
is then being linked with a dependency on the *system* libstdc++.dylib and not
the current build.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/64023] [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler.
  2014-11-22 10:19 [Bug bootstrap/64023] New: [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler dominiq at lps dot ens.fr
  2014-11-22 10:21 ` [Bug bootstrap/64023] " dominiq at lps dot ens.fr
  2014-11-22 10:52 ` iains at gcc dot gnu.org
@ 2014-11-24  0:09 ` fxcoudert at gcc dot gnu.org
  2014-11-24  0:39 ` iains at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-24  0:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64023

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
   Last reconfirmed|2014-11-22 00:00:00         |2014-11-24
           Assignee|unassigned at gcc dot gnu.org      |fxcoudert at gcc dot gnu.org
   Target Milestone|---                         |5.0

--- Comment #3 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Partial patch submitted:
https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02955.html
It restores bootstrap with gcc as system compiler (and I think is more generic
that fixing the issue in libcc1/Makefile.in).

Even with that patch, there remains the "silent" issue of not linking
statically when clang is the system compiler.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/64023] [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler.
  2014-11-22 10:19 [Bug bootstrap/64023] New: [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler dominiq at lps dot ens.fr
                   ` (2 preceding siblings ...)
  2014-11-24  0:09 ` fxcoudert at gcc dot gnu.org
@ 2014-11-24  0:39 ` iains at gcc dot gnu.org
  2014-12-13 11:25 ` jakub at gcc dot gnu.org
  2014-12-14 22:56 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: iains at gcc dot gnu.org @ 2014-11-24  0:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64023

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Francois-Xavier Coudert from comment #3)

> Even with that patch, there remains the "silent" issue of not linking
> statically when clang is the system compiler.

The underlying issue is that ld64 will always pick a .dylib over a .a when both
are available.  So pointing at the libstdc++ .libs dir isn't enough - we'll
still link with the dylib.  

AFAIK the only solution available is to mention the full path to the static lib
on the command line.

Since clang does not do this for us (no -static-libstdc++) we'd have to cook up
our own and drive it from some config that determines we are bootstrapping with
clang.  [That might be a useful variable to have anyway]


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/64023] [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler.
  2014-11-22 10:19 [Bug bootstrap/64023] New: [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler dominiq at lps dot ens.fr
                   ` (3 preceding siblings ...)
  2014-11-24  0:39 ` iains at gcc dot gnu.org
@ 2014-12-13 11:25 ` jakub at gcc dot gnu.org
  2014-12-14 22:56 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-13 11:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64023

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sat Dec 13 11:24:37 2014
New Revision: 218705

URL: https://gcc.gnu.org/viewcvs?rev=218705&root=gcc&view=rev
Log:
    PR bootstrap/64023
    * Makefile.tpl (EXTRA_TARGET_FLAGS): Set STAGE1_LDFLAGS
    to POSTSTAGE1_LDFLAGS and STAGE1_LIBS to POSTSTAGE1_LIBS.
    Add -B to libstdc++-v3/src/.libs and libstdc++-v3/libsupc++/.libs
    to CXX.
    * Makefile.in: Regenerated.

Modified:
    trunk/ChangeLog
    trunk/Makefile.in
    trunk/Makefile.tpl


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/64023] [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler.
  2014-11-22 10:19 [Bug bootstrap/64023] New: [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler dominiq at lps dot ens.fr
                   ` (4 preceding siblings ...)
  2014-12-13 11:25 ` jakub at gcc dot gnu.org
@ 2014-12-14 22:56 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-12-14 22:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64023

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
This is the first time since two months that I am able to bootstrap a clean
tree.

Results are posted at

https://gcc.gnu.org/ml/gcc-testresults/2014-12/msg01763.html

Closing as FIXED. Thanks.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-14 22:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-22 10:19 [Bug bootstrap/64023] New: [5 Regression] r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler dominiq at lps dot ens.fr
2014-11-22 10:21 ` [Bug bootstrap/64023] " dominiq at lps dot ens.fr
2014-11-22 10:52 ` iains at gcc dot gnu.org
2014-11-24  0:09 ` fxcoudert at gcc dot gnu.org
2014-11-24  0:39 ` iains at gcc dot gnu.org
2014-12-13 11:25 ` jakub at gcc dot gnu.org
2014-12-14 22:56 ` dominiq at lps dot ens.fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).