public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw
@ 2004-03-12  8:56 rolf dot ebert dot gcc at gmx dot de
  2004-03-12 16:22 ` [Bug bootstrap/14548] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: rolf dot ebert dot gcc at gmx dot de @ 2004-03-12  8:56 UTC (permalink / raw)
  To: gcc-bugs

configure ... --enable-languages=c,ada   # no C++

After bootstrapping when compiling the Ada library (via make -C gcc 
gnatlib_and_tools) the make step fails building collect2.  Collect2 is not 
needed for the Ada library and should not be attempted to build.

I suppose the failure is due to
> 
> 2004-02-04 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
> 
> * Makefile.in: Move target, host overrides after per-language
> fragments.

As a workaround I commented out USE_COLLECT2 in Makefile.in.

-- 
           Summary: building Ada library incorrectly requires collect2 on
                    mingw
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rolf dot ebert dot gcc at gmx dot de
                CC: gcc-bugs at gcc dot gnu dot org,ro at techfak dot uni-
                    bielefeld dot de
  GCC host triplet: i686-pc-mingw32
GCC target triplet: mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug bootstrap/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
@ 2004-03-12 16:22 ` pinskia at gcc dot gnu dot org
  2004-03-12 16:32 ` rolf dot ebert dot gcc at gmx dot de
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-12 16:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-12 16:22 -------
I do not think this is a bug as collect2 is not based on the language but based on the target.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug bootstrap/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
  2004-03-12 16:22 ` [Bug bootstrap/14548] " pinskia at gcc dot gnu dot org
@ 2004-03-12 16:32 ` rolf dot ebert dot gcc at gmx dot de
  2004-03-12 16:44 ` [Bug target/14548] " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rolf dot ebert dot gcc at gmx dot de @ 2004-03-12 16:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rolf dot ebert dot gcc at gmx dot de  2004-03-12 16:32 -------
(In reply to comment #1)
> I do not think this is a bug as collect2 is not based on the language but
> based on the target.

But for target mingw32 USE_COLLECT2 is unset too late.  gnattools depends on 
GCC_PARTS which includes collect2.  Only later this is unset in 
gcc/config/i386/t-mingw3.  

Analysis was done by Rainer Orth. He supposes that the target powerpc-*-beos*: 
gcc/config/rs6000/t-beos has the same problem.




-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug target/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
  2004-03-12 16:22 ` [Bug bootstrap/14548] " pinskia at gcc dot gnu dot org
  2004-03-12 16:32 ` rolf dot ebert dot gcc at gmx dot de
@ 2004-03-12 16:44 ` pinskia at gcc dot gnu dot org
  2004-03-12 22:19 ` ro at techfak dot uni-bielefeld dot de
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-12 16:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-12 16:44 -------
Really USE-COLLECT2 should be moved into config.gcc to make this a non-issue.
Actually it is already in config.gcc:
        use_collect2=yes

So mygwin should follow this instead of doing more work.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|bootstrap                   |target
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-12 16:44:51
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug target/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
                   ` (2 preceding siblings ...)
  2004-03-12 16:44 ` [Bug target/14548] " pinskia at gcc dot gnu dot org
@ 2004-03-12 22:19 ` ro at techfak dot uni-bielefeld dot de
  2004-03-19  1:54 ` ian at wasabisystems dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ro at techfak dot uni-bielefeld dot de @ 2004-03-12 22:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ro at techfak dot uni-bielefeld dot de  2004-03-12 22:19 -------
Subject: Re:  building Ada library incorrectly requires collect2 on mingw

pinskia at gcc dot gnu dot org writes:

> Really USE-COLLECT2 should be moved into config.gcc to make this a non-issue.
> Actually it is already in config.gcc:
>         use_collect2=yes
> 
> So mygwin should follow this instead of doing more work.

Unfortunately, this is not enough: use_collect2=yes in config.gcc only
causes the USE_COLLECT2 macro to be defined, which changes the way collect2
works.

collect2 is built because gcc/Makefile.in has

USE_COLLECT2 = collect2$(exeext)

config/i386/t-mingw32 clears that make variable to avoid building collect2
(which doesn't link as described).  This is enough to avoid building
collect2 during make bootstrap.

During make gnatlib_and_tools, collect2 is built nonetheless because the
gnattools target in ada/Make-lang.in depends on $(GCC_PARTS), which
includes $(USE_COLLECT2).  Since ada/Make-lang.in is now included before
the target makefile fragments (i.e. t-mingw32), the default value of
USE_COLLECT2 from Makefile.in is used, leading to the failing attempt to
build collect2.

I agree this is a mess, but don't have a good idea how to avoid this.  It
seems that handling this in config.gcc is better than overriding the make
variable, tough.

	Rainer


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug target/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
                   ` (3 preceding siblings ...)
  2004-03-12 22:19 ` ro at techfak dot uni-bielefeld dot de
@ 2004-03-19  1:54 ` ian at wasabisystems dot com
  2004-03-19  5:20 ` ian at wasabisystems dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ian at wasabisystems dot com @ 2004-03-19  1:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ian at wasabisystems dot com  2004-03-19 01:54 -------
The current situation with USE_COLLECT2 is rather confusing.  USE_COLLECT2 is
used both as a macro define in config.h and tconfig.h and as a Makefile variable.

The macro definition is set based on use_collect2 in config.gcc: if use_collect2
is set to yes, then USE_COLLECT2 is defined in config.h and tconfig.h.  The
macro affects how constructors are output.  It is also checked in collect2.c,
and controls whether collect2 scans the object files for constructor names and
generates a static constructor table.

The Makefile variable USE_COLLECT2 is normally defined as collect2$(exeext),
which causes the collect2 binary to be built.  A few Makefile fragments override
the Makefile variable USE_COLLECT2 to be empty, which causes collect2 to not be
built.  Specifically, this is currently done in these Makefile fragments:
alpha/x-vms, i386/t-mingw32, rs6000/t-beos.

So we can see that USE_COLLECT2 means two different things.  In one case it
controls how constructors are handled.  In the other case it controls whether
the collect2 binary is built at all.

In general, the collect2 binary should always be built these days.  That is
because it handles the C++ -frepo option.  So in general the use of the Makefile
variable USE_COLLECT2 should be discouraged.

However, there are some hosts on which collect2 can not presently be built.  For
those hosts, it might make sense to disable building collect2, and to accept
that it will not be possible to use -frepo, and to accept that certain targets,
those which set use_collect2 to yes in config.gcc, will not support global
constructors and destructors.

Based on this, it is clearly incorrect to set the Makefile variable USE_COLLECT2
in a target makefile fragment.  That would prevent building collect2 when
building a cross-compiler to that target, but there is no reason to prevent
that.  Therefore, the Makefile variable USE_COLLECT2 which is set in
i386/t-mingw32 and rs6000/t-beos should be moved to i386/x-mingw32 and
rs6000/x-beos.  Further, we should add a check somewhere to give an error if the
Makefile variable USE_COLLECT2 is empty and the macro define USE_COLLECT2 is
set, since that scenario can not work.  (Of course, it would be even better to
make collect2 actually build and work on these hosts, if only so that -frepo
will work correctly).

Anyhow, using the host makefile fragment, while correct, won't fix the
particular problem described in this PR.  The problem here is that when a
variable is used as a dependency, GNU make uses the current value in the
dependency calculation, even if the variable is later set to a different value.
 Since the host and target makefile fragments are now included after the
language makefile fragments, the fact that the host or target makefile fragment
overrides USE_COLLECT2 does not affect it's appearance in a dependency in
ada/Make-lang.in.

This problem can be fixed either by changing the Makefile variable USE_COLLECT2
to be an autoconf substitution based on a value set in config.host, much as
host_exeext is today, or by changing ada/Make-lang.in to use a stamp instead of
$(GCC_PARTS), and to make that stamp depend upon $(GCC_PARTS).

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug target/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
                   ` (4 preceding siblings ...)
  2004-03-19  1:54 ` ian at wasabisystems dot com
@ 2004-03-19  5:20 ` ian at wasabisystems dot com
  2004-03-20  1:06 ` dannysmith at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ian at wasabisystems dot com @ 2004-03-19  5:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ian at wasabisystems dot com  2004-03-19 05:20 -------
Here is a possible patch:
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01576.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug target/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
                   ` (5 preceding siblings ...)
  2004-03-19  5:20 ` ian at wasabisystems dot com
@ 2004-03-20  1:06 ` dannysmith at gcc dot gnu dot org
  2004-04-05  3:44 ` neroden at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dannysmith at gcc dot gnu dot org @ 2004-03-20  1:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dannysmith at gcc dot gnu dot org  2004-03-20 01:06 -------
The revised patch at 
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01585.html
fixes this on mingw32 on trunk.

Thank you Ian

Danny

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug target/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
                   ` (6 preceding siblings ...)
  2004-03-20  1:06 ` dannysmith at gcc dot gnu dot org
@ 2004-04-05  3:44 ` neroden at gcc dot gnu dot org
  2004-04-05  3:58 ` cvs-commit at gcc dot gnu dot org
  2004-05-05 17:20 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: neroden at gcc dot gnu dot org @ 2004-04-05  3:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From neroden at gcc dot gnu dot org  2004-04-05 03:44 -------
Fixed with patch on mainline today. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |3.5.0
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug target/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
                   ` (7 preceding siblings ...)
  2004-04-05  3:44 ` neroden at gcc dot gnu dot org
@ 2004-04-05  3:58 ` cvs-commit at gcc dot gnu dot org
  2004-05-05 17:20 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-05  3:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-05 03:58 -------
Subject: Bug 14548

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	neroden@gcc.gnu.org	2004-04-05 03:58:46

Modified files:
	gcc            : ChangeLog Makefile.in config.host configure 
	                 configure.ac 
	gcc/config/alpha: x-vms 
	gcc/config/i386: t-mingw32 
	gcc/config/pa  : t-pa64 
	gcc/config/rs6000: t-beos 

Log message:
	PR target/14548
	* config.host: Set the shell variable host_can_use_collect2.
	Set it to yes by default, and to no for alpha*-dec-*vms*,
	i[34567]86-*-mingw32*, and powerpc-*-beos*.
	* configure.ac: Set and substitute the shell variable collect2.
	Give an error if use_collect2 is yes and host_can_use_collect2 is
	no.
	* Makefile.in (COLLECT2): Rename from USE_COLLECT2.  Change all
	uses.  Initialize to @collect2@.
	(STAGESTUFF): Remove $(USE_COLLECT2).
	* config/alpha/x-vms (USE_COLLECT2): Don't set.
	* config/i386/t-mingw32 (USE_COLLECT2): Likewise.
	* config/rs6000/t-beos (USE_COLLECT2): Likewise.
	* config/pa/t-pa64: Remove commented out USE_COLLECT2.
	* configure: Regenerate.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3342&r2=2.3343
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/Makefile.in.diff?cvsroot=gcc&r1=1.1268&r2=1.1269
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config.host.diff?cvsroot=gcc&r1=2.8&r2=2.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/configure.diff?cvsroot=gcc&r1=1.816&r2=1.817
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/configure.ac.diff?cvsroot=gcc&r1=2.28&r2=2.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/alpha/x-vms.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/t-mingw32.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/pa/t-pa64.diff?cvsroot=gcc&r1=1.7&r2=1.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/t-beos.diff?cvsroot=gcc&r1=1.5&r2=1.6



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

* [Bug target/14548] building Ada library incorrectly requires collect2 on mingw
  2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
                   ` (8 preceding siblings ...)
  2004-04-05  3:58 ` cvs-commit at gcc dot gnu dot org
@ 2004-05-05 17:20 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-05 17:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-05 17:19 -------
*** Bug 15298 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p dot obry at wanadoo dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14548


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

end of thread, other threads:[~2004-05-05 17:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-12  8:56 [Bug bootstrap/14548] New: building Ada library incorrectly requires collect2 on mingw rolf dot ebert dot gcc at gmx dot de
2004-03-12 16:22 ` [Bug bootstrap/14548] " pinskia at gcc dot gnu dot org
2004-03-12 16:32 ` rolf dot ebert dot gcc at gmx dot de
2004-03-12 16:44 ` [Bug target/14548] " pinskia at gcc dot gnu dot org
2004-03-12 22:19 ` ro at techfak dot uni-bielefeld dot de
2004-03-19  1:54 ` ian at wasabisystems dot com
2004-03-19  5:20 ` ian at wasabisystems dot com
2004-03-20  1:06 ` dannysmith at gcc dot gnu dot org
2004-04-05  3:44 ` neroden at gcc dot gnu dot org
2004-04-05  3:58 ` cvs-commit at gcc dot gnu dot org
2004-05-05 17:20 ` pinskia at gcc dot gnu dot org

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).