From 1ca894a0e403de4be67483069f8b59059ad53a31 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Sun, 4 Feb 2001 08:29:46 +0000 Subject: [PATCH] cppinit.c (BC): New macro. * cppinit.c (BC): New macro. (builtin_array): Add __GXX_WEAK__. * cpplib.h (builtin_type): Add BT_WEAK. * cppmacro.c (builtin_macro): Handle BT_WEAK. * defaults.h (SUPPORTS_ONE_ONLY): Define. * varasm.c (SUPPORTS_ONE_ONLY): Do not define. From-SVN: r39436 --- gcc/ChangeLog | 11 ++++++++++- gcc/cppinit.c | 2 ++ gcc/cpplib.h | 4 +++- gcc/cppmacro.c | 4 ++++ gcc/defaults.h | 9 +++++++++ gcc/varasm.c | 9 --------- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 678c5d6e237..4d1fadea612 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2001-02-04 Mark Mitchell + + * cppinit.c (BC): New macro. + (builtin_array): Add __GXX_WEAK__. + * cpplib.h (builtin_type): Add BT_WEAK. + * cppmacro.c (builtin_macro): Handle BT_WEAK. + * defaults.h (SUPPORTS_ONE_ONLY): Define. + * varasm.c (SUPPORTS_ONE_ONLY): Do not define. + 2001-02-03 Jakub Jelinek * cppinit.c (append_include_chain): Honor NO_IMPLICIT_EXTERN_C. @@ -81,7 +90,7 @@ Fri Feb 2 20:03:50 2001 Richard Kenner (init_spec): Use it. * testsuite/lib/g++.exp: Include the directory where libgcc is located to the LD_LIBRARY_PATH list. - * inovke.texi (-shared-libgcc): Document the cases in which + * invoke.texi (-shared-libgcc): Document the cases in which GCC defaults to using the shared libgcc. 2001-02-02 Alexandre Oliva diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 8319ad987fb..845d35b7fd1 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -643,6 +643,7 @@ struct builtin #define OPERATOR 0x10 #define B(n, t) { U n, 0, t, 0, BUILTIN, sizeof n - 1 } +#define BC(n, t) { U n, 0, t, 0, BUILTIN | CPLUS, sizeof n - 1 } #define C(n, v) { U n, v, 0, 0, 0, sizeof n - 1 } #define X(n, f) { U n, 0, 0, 0, f, sizeof n - 1 } #define O(n, c, f) { U n, 0, 0, c, OPERATOR | f, sizeof n - 1 } @@ -655,6 +656,7 @@ static const struct builtin builtin_array[] = B("__LINE__", BT_SPECLINE), B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL), B("__STDC__", BT_STDC), + BC("__GXX_WEAK__", BT_WEAK), X("__VERSION__", VERS), X("__USER_LABEL_PREFIX__", ULP), diff --git a/gcc/cpplib.h b/gcc/cpplib.h index 9d0b8e253fb..eec4f1eb435 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -462,7 +462,9 @@ enum builtin_type BT_BASE_FILE, /* `__BASE_FILE__' */ BT_INCLUDE_LEVEL, /* `__INCLUDE_LEVEL__' */ BT_TIME, /* `__TIME__' */ - BT_STDC /* `__STDC__' */ + BT_STDC, /* `__STDC__' */ + BT_WEAK /* Whether or not G++ supports weak + symbols. */ }; /* There is a slot in the hashnode for use by front ends when integrated diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index afe60dce877..8e051a9c5b0 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -216,6 +216,10 @@ builtin_macro (pfile, token) *token = node->value.builtin == BT_DATE ? pfile->date: pfile->time; break; + case BT_WEAK: + make_number_token (pfile, token, SUPPORTS_ONE_ONLY); + break; + default: cpp_ice (pfile, "invalid builtin macro \"%s\"", node->name); break; diff --git a/gcc/defaults.h b/gcc/defaults.h index b0f3ce9fa6d..c1c938b5c0c 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -149,6 +149,15 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0) #endif #endif +/* This determines whether or not we support link-once semantics. */ +#ifndef SUPPORTS_ONE_ONLY +#ifdef MAKE_DECL_ONE_ONLY +#define SUPPORTS_ONE_ONLY 1 +#else +#define SUPPORTS_ONE_ONLY 0 +#endif +#endif + /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to provide a weak attribute. Else define it to nothing. diff --git a/gcc/varasm.c b/gcc/varasm.c index cae65cc413e..047065777d7 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -4828,15 +4828,6 @@ assemble_alias (decl, target) #endif } -/* This determines whether or not we support link-once semantics. */ -#ifndef SUPPORTS_ONE_ONLY -#ifdef MAKE_DECL_ONE_ONLY -#define SUPPORTS_ONE_ONLY 1 -#else -#define SUPPORTS_ONE_ONLY 0 -#endif -#endif - /* Returns 1 if the target configuration supports defining public symbols so that one of them will be chosen at link time instead of generating a multiply-defined symbol error, whether through the use of weak symbols or -- 2.30.2