diff options
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 6 | ||||
-rw-r--r-- | libcpp/pch.c | 25 |
2 files changed, 29 insertions, 2 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 9f6148e..a6378bc 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2008-12-10 Alexandre Oliva <aoliva@redhat.com> + + PR target/37033 + * pch.c (cpp_valid_state): Improve message for poisoned symbols. + Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM. + 2008-11-29 Joseph Myers <joseph@codesourcery.com> * lex.c (cpp_token_len): Use 6 as default length. diff --git a/libcpp/pch.c b/libcpp/pch.c index bf7b9be..f459d2c 100644 --- a/libcpp/pch.c +++ b/libcpp/pch.c @@ -1,5 +1,5 @@ /* Part of CPP library. (Precompiled header reading/writing.) - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -477,11 +477,32 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd) h = cpp_lookup (r, namebuf, m.name_length); if (m.flags & NODE_POISONED - || h->type != NT_MACRO || h->flags & NODE_POISONED) { if (CPP_OPTION (r, warn_invalid_pch)) cpp_error (r, CPP_DL_WARNING_SYSHDR, + "%s: not used because `%.*s' is poisoned", + name, m.name_length, namebuf); + goto fail; + } + + if (h->type != NT_MACRO) + { + /* It's ok if __GCC_HAVE_DWARF2_CFI_ASM becomes undefined, + as in, when the PCH file is created with -g and we're + attempting to use it without -g. Restoring the PCH file + is supposed to bring in this definition *and* enable the + generation of call frame information, so that precompiled + definitions that take this macro into accout, to decide + what asm to emit, won't issue .cfi directives when the + compiler doesn't. */ + if (!(h->flags & NODE_USED) + && m.name_length == sizeof ("__GCC_HAVE_DWARF2_CFI_ASM") - 1 + && !memcmp (namebuf, "__GCC_HAVE_DWARF2_CFI_ASM", m.name_length)) + continue; + + if (CPP_OPTION (r, warn_invalid_pch)) + cpp_error (r, CPP_DL_WARNING_SYSHDR, "%s: not used because `%.*s' not defined", name, m.name_length, namebuf); goto fail; |