diff --git a/gnu/dist/gcc/gcc/config/netbsd.h b/gnu/dist/gcc/gcc/config/netbsd.h index 044138996212..61ecfdce4e41 100644 --- a/gnu/dist/gcc/gcc/config/netbsd.h +++ b/gnu/dist/gcc/gcc/config/netbsd.h @@ -234,3 +234,7 @@ __enable_execute_stack (addr) \ /* 7 == PROT_READ | PROT_WRITE | PROT_EXEC */ \ (void) mprotect (page, end - page, 7); \ } + +/* NetBSD depends on "cpp" having GNUC semantics, and must default as if + "cpp -gcc" was called. */ +#define DEFAULT_CPP_NEED_NO_GCC 0 diff --git a/gnu/dist/gcc/gcc/cppspec.c b/gnu/dist/gcc/gcc/cppspec.c index d5b49d019a34..9650eea4a5af 100644 --- a/gnu/dist/gcc/gcc/cppspec.c +++ b/gnu/dist/gcc/gcc/cppspec.c @@ -85,6 +85,13 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) is_cpp_driver = 1; + /* NetBSD uses __GNUC__ and friends in header files processed with cpp + regularly. Default to old behaviour here. XXX - move me to + config/netbsd.h "DEFAULT_CPP_NEED_NO_GCC". */ +#ifdef DEFAULT_CPP_NEED_NO_GCC + need_no_gcc = DEFAULT_CPP_NEED_NO_GCC; +#endif + /* First pass. If we see an -S or -c, barf. If we see an input file, turn off read_stdin. If we see a second input file, it is actually the output file. If we see a third input file, barf. */