Bug 18897 - [4.0 Regression] /usr/ccs/bin/ld: Unsatisfied symbols: putchar (first referenced in build/gengenrtl.o) (data)
Summary: [4.0 Regression] /usr/ccs/bin/ld: Unsatisfied symbols: putchar (first referen...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.0.0
: P2 critical
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2004-12-09 04:13 UTC by John David Anglin
Modified: 2004-12-18 06:42 UTC (History)
3 users (show)

See Also:
Host: hppa2.0w-hp-hpux11.11
Target: hppa2.0w-hp-hpux11.11
Build: hppa2.0w-hp-hpux11.11
Known to work:
Known to fail:
Last reconfirmed: 2004-12-17 13:00:37


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2004-12-09 04:13:25 UTC
stage1/xgcc -Bstage1/ -B/opt/gnu/gcc/gcc-4.0.0/hppa2.0w-hp-hpux11.11/bin/   -g -
O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
 -fno-common   -DHAVE_CONFIG_H -DGENERATOR_FILE  -o build/gengenrtl \
 build/gengenrtl.o build/errors.o ../build-hppa2.0w-hp-hpux11.11/libiberty/libib
erty.a
/usr/ccs/bin/ld: Unsatisfied symbols:
   putchar (first referenced in build/gengenrtl.o) (data)
/usr/ccs/bin/ld: (Warning) Linker features were used that may not be supported i
n future releases. The +vallcompatwarnings option can be used to display more de
tails, and the ld(1) man page contains additional information. This warning can
be suppressed with the +vnocompatwarnings option.
collect2: ld returned 1 exit status
make[2]: *** [build/gengenrtl] Error 1

The above error indicates that .import assembler directives are not
being emitted for undefined functions.  As a result, the type defaults
to "data".
Comment 1 Andrew Pinski 2004-12-09 04:16:34 UTC
I think this was caused by:
2004-12-08  Zack Weinberg  <zack@codesourcery.com>

        PR 17982
        * varasm.c (pending_assemble_externals): New static.
        (assemble_external_real): Meat of assemble_external split out
        to this new function.
        (process_pending_assemble_externals): New function.
        (assemble_external): Use gcc_assert.  If flag_unit_at_a_time
        is true and the basic test passes, merely cons the decl onto
        the pending list to be handled later.
        * tree.h: Declare process_pending_assemble_externals.
        * cgraphunit.c (cgraph_optimize): Call it.


Can you confirm that?
Comment 2 dave 2004-12-10 04:38:50 UTC
Subject: Re:  [4.0 Regression] /usr/ccs/bin/ld: Unsatisf

> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09
> 04:16 -------
> I think this was caused by:
> 2004-12-08  Zack Weinberg  <zack@codesourcery.com>
> 
>         PR 17982
>         * varasm.c (pending_assemble_externals): New static.
>         (assemble_external_real): Meat of assemble_external split out
>         to this new function.
>         (process_pending_assemble_externals): New function.
>         (assemble_external): Use gcc_assert.  If flag_unit_at_a_time
>         is true and the basic test passes, merely cons the decl onto
>         the pending list to be handled later.
>         * tree.h: Declare process_pending_assemble_externals.
>         * cgraphunit.c (cgraph_optimize): Call it.
> 
> 
> Can you confirm that?

Yes, it introduced the problem.

Dave
Comment 3 dave 2004-12-11 21:11:04 UTC
Subject: Re:  [4.0 Regression] /usr/ccs/bin/ld: Unsatisf

> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09
> 04:16 -------
> I think this was caused by:
> 2004-12-08  Zack Weinberg  <zack@codesourcery.com>
> 
>         PR 17982
>         * varasm.c (pending_assemble_externals): New static.
>         (assemble_external_real): Meat of assemble_external split out
>         to this new function.
>         (process_pending_assemble_externals): New function.
>         (assemble_external): Use gcc_assert.  If flag_unit_at_a_time
>         is true and the basic test passes, merely cons the decl onto
>         the pending list to be handled later.
>         * tree.h: Declare process_pending_assemble_externals.
>         * cgraphunit.c (cgraph_optimize): Call it.

The problem with this change is that assemble_external is
called in rtx_for_function_call after cgraph_optimize calls
process_pending_assemble_externals.  These additions to the
list are never output in unit-at-a-time mode.

Dave
Comment 4 dave 2004-12-16 01:42:23 UTC
Subject: Re:  [4.0 Regression] /usr/ccs/bin/ld: Unsatisf

Steve,

>                  CC|                            |sje at cup dot hp dot com

Until this problem is looked at, I am using the enclosed work around.
Of course, this breaks the ia64 PR fix.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.468
diff -u -3 -p -r1.468 varasm.c
--- varasm.c	9 Dec 2004 10:54:38 -0000	1.468
+++ varasm.c	16 Dec 2004 01:39:23 -0000
@@ -1834,7 +1834,7 @@ assemble_external (tree decl ATTRIBUTE_U
   if (!DECL_P (decl) || !DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
     return;
 
-  if (flag_unit_at_a_time)
+  if (0 && flag_unit_at_a_time)
     pending_assemble_externals = tree_cons (0, decl,
 					    pending_assemble_externals);
   else
Comment 5 GCC Commits 2004-12-18 06:38:31 UTC
Subject: Bug 18897

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	zack@gcc.gnu.org	2004-12-18 06:38:26

Modified files:
	gcc            : ChangeLog toplev.c 

Log message:
	PR 18897
	* toplev.c (compile_file): Call process_pending_assemble_externals
	just before targetm.asm_out.file_end.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6871&r2=2.6872
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.c.diff?cvsroot=gcc&r1=1.934&r2=1.935

Comment 6 Zack Weinberg 2004-12-18 06:42:33 UTC
Fixed.
Comment 7 dave 2004-12-18 15:38:12 UTC
Subject: Re:  [4.0 Regression] /usr/ccs/bin/ld: Unsatisf

> Fixed.

Thanks very much.

Dave