This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: f build dies with: undefined reference to `lookup_name'
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Geoff Keating <geoffk at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Mar 2002 18:59:49 -0500
- Subject: Re: f build dies with: undefined reference to `lookup_name'
Okay, how about this patch?
* langhooks.h (lang_hooks): Add lookup_name.
* langhooks-def.h (LANG_HOOKS_LOOKUP_NAME): Define.
(LANG_HOOKS_INITIALIZER): Use it.
* varasm.c (weak_finish): Call lookup_name via lang_hooks.
* c-lang.c (LANG_HOOKS_LOOKUP_NAME): Define.
* objc/objc-lang.c (LANG_HOOKS_LOOKUP_NAME): Define.
* cp/cp-lang.c (cxx_lookup_name): New function.
(LANG_HOOKS_LOOKUP_NAME): Use it.
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.256
diff -c -p -r1.256 varasm.c
*** varasm.c 2002/03/13 14:20:17 1.256
--- varasm.c 2002/03/14 23:53:33
*************** weak_finish ()
*** 5078,5084 ****
{
tree name = get_identifier (t->name);
if (name)
! decl = lookup_name (name);
}
ASM_WEAKEN_DECL (asm_out_file, decl, t->name, t->value);
#else
--- 5078,5084 ----
{
tree name = get_identifier (t->name);
if (name)
! decl = (*lang_hooks.lookup_name) (name);
}
ASM_WEAKEN_DECL (asm_out_file, decl, t->name, t->value);
#else
Index: langhooks-def.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/langhooks-def.h,v
retrieving revision 1.10
diff -c -p -r1.10 langhooks-def.h
*** langhooks-def.h 2002/03/08 19:20:47 1.10
--- langhooks-def.h 2002/03/14 23:53:33
*************** void lhd_tree_inlining_end_inlining PAR
*** 78,83 ****
--- 78,84 ----
#define LANG_HOOKS_STATICP lhd_staticp
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
#define LANG_HOOKS_UNSAVE_EXPR_NOW lhd_unsave_expr_now
+ #define LANG_HOOKS_LOOKUP_NAME lhd_return_tree
#define LANG_HOOKS_HONOR_READONLY false
#define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing
#define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing
*************** int lhd_tree_dump_type_quals PARAMS ((
*** 148,153 ****
--- 149,155 ----
LANG_HOOKS_STATICP, \
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
LANG_HOOKS_UNSAVE_EXPR_NOW, \
+ LANG_HOOKS_LOOKUP_NAME, \
LANG_HOOKS_HONOR_READONLY, \
LANG_HOOKS_PRINT_STATISTICS, \
LANG_HOOKS_PRINT_XNODE, \
Index: langhooks.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/langhooks.h,v
retrieving revision 1.17
diff -c -p -r1.17 langhooks.h
*** langhooks.h 2002/03/08 19:20:47 1.17
--- langhooks.h 2002/03/14 23:53:33
*************** struct lang_hooks
*** 137,142 ****
--- 137,145 ----
things are cleared out. */
tree (*unsave_expr_now) PARAMS ((tree));
+ /* Find DECL for NAME. */
+ tree (*lookup_name) PARAMS ((tree));
+
/* Nonzero if TYPE_READONLY and TREE_READONLY should always be honored. */
bool honor_readonly;
Index: c-lang.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-lang.c,v
retrieving revision 1.76
diff -c -p -r1.76 c-lang.c
*** c-lang.c 2002/03/13 01:42:30 1.76
--- c-lang.c 2002/03/14 23:53:33
*************** static void c_post_options PARAMS ((void
*** 57,62 ****
--- 57,64 ----
#define LANG_HOOKS_SET_YYDEBUG c_set_yydebug
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
+ #undef LANG_HOOKS_LOOKUP_NAME
+ #define LANG_HOOKS_LOOKUP_NAME lookup_name
#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
Index: objc/objc-lang.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/objc/objc-lang.c,v
retrieving revision 1.4
diff -c -p -r1.4 objc-lang.c
*** objc-lang.c 2002/03/13 01:42:43 1.4
--- objc-lang.c 2002/03/14 23:53:33
*************** static void objc_post_options
*** 52,57 ****
--- 52,60 ----
#define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier
#undef LANG_HOOKS_SET_YYDEBUG
#define LANG_HOOKS_SET_YYDEBUG c_set_yydebug
+ #undef LANG_HOOKS_LOOKUP_NAME
+ #define LANG_HOOKS_LOOKUP_NAME lookup_name
+
/* Inlining hooks same as the C front end. */
#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
Index: cp/cp-lang.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/cp-lang.c,v
retrieving revision 1.13
diff -c -p -r1.13 cp-lang.c
*** cp-lang.c 2002/03/13 01:42:39 1.13
--- cp-lang.c 2002/03/14 23:53:33
*************** Boston, MA 02111-1307, USA. */
*** 28,33 ****
--- 28,34 ----
#include "langhooks.h"
#include "langhooks-def.h"
+ static tree cxx_lookup_name PARAMS ((tree));
static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree));
static bool ok_to_generate_alias_set_for_type PARAMS ((tree));
*************** static bool ok_to_generate_alias_set_for
*** 55,60 ****
--- 56,63 ----
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl
#undef LANG_HOOKS_UNSAVE_EXPR_NOW
#define LANG_HOOKS_UNSAVE_EXPR_NOW cxx_unsave_expr_now
+ #undef LANG_HOOKS_LOOKUP_NAME
+ #define LANG_HOOKS_LOOKUP_NAME cxx_lookup_name
#undef LANG_HOOKS_PRINT_STATISTICS
#define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
#undef LANG_HOOKS_PRINT_XNODE
*************** static bool ok_to_generate_alias_set_for
*** 99,104 ****
--- 102,116 ----
/* Each front end provides its own hooks, for toplev.c. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+
+ /* Lookup NAME. */
+
+ static tree
+ cxx_lookup_name (t)
+ tree t;
+ {
+ return lookup_name (t, 0);
+ }
/* Check if a C++ type is safe for aliasing.
Return TRUE if T safe for aliasing FALSE otherwise. */