This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: collect2.c failed to be compiled
- To: egcs at cygnus dot com, weiwen dot liu at yale dot edu
- Subject: Re: collect2.c failed to be compiled
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Sun, 22 Feb 1998 10:16:17 -0500 (EST)
> From: Weiwen Liu <weiwen.liu@yale.edu>
>
> Hi,
> I can not compile collect2.c in the current CVS tree, because "exports" is
> defined within #ifdef COLLECT_EXPORT_LIST, but it is used outside this
> #ifdef.
> Weiwen
You don't say what platform this happened to you on, but I had
a similar problem with egcs-980221 on alphaev5-dec-osf4.0b:
> cc -DIN_GCC -g -DHAVE_CONFIG_H -DHAIFA -I. -I. -I./config \
> -DTARGET_MACHINE=\"alphaev5-dec-osf4.0b\" -DUSE_COLLECT2 \
> -c `echo ./collect2.c | sed 's,^\./,,'`
> cc: Error: collect2.c, line 2859: In this statement, "exports" is not declared.
> add_to_list (&exports, name);
> ------------------------------------------^
> make[2]: *** [collect2.o] Error 1
I used the following patch to get around this, but not being
familiar with that code I can't say if it's correct.
--Kaveh
Sun Feb 22 09:45:39 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* collect2.c (scan_prog_file): Completely cover uses of variable
`exports' with macro COLLECT_EXPORT_LIST.
--- gcc/collect2.c~ Fri Feb 20 07:31:00 1998
+++ gcc/collect2.c Sun Feb 22 09:23:30 1998
@@ -2855,9 +2855,9 @@
{
case 1:
if (! is_shared) add_to_list (&constructors, name);
+#ifdef COLLECT_EXPORT_LIST
if (which_pass == PASS_OBJ)
add_to_list (&exports, name);
-#ifdef COLLECT_EXPORT_LIST
/* If this symbol was undefined and we are building
an import list, we should add a symbol to this
list. */
@@ -2870,9 +2870,9 @@
case 2:
if (! is_shared) add_to_list (&destructors, name);
+#ifdef COLLECT_EXPORT_LIST
if (which_pass == PASS_OBJ)
add_to_list (&exports, name);
-#ifdef COLLECT_EXPORT_LIST
/* If this symbol was undefined and we are building
an import list, we should add a symbol to this
list. */
--
Kaveh R. Ghazi Project Manager / Custom Development
ghazi@caip.rutgers.edu ICon CMT Corp.