Fwd: Error for unknown spec function 'dumps' when compiling GCC 11.X

Tammo Tjarks tammo@tammo-tjarks.de
Mon Oct 25 20:41:56 GMT 2021


Dear GCC community,

when I try to compile a 11 Version of GCC I get while compiling in the directory
…./gcc-11.2.0/host-x86_64-pc-linux-gnu/gcc
the following:
x86_64-pc-linux-gnu-g++ -std=c++11 -fno-PIE ….. ../.././gcc/cp/g++spec.c
error occurs:
x86_64-pc-linux-gnu-g++: fatal error: unknown spec function 'dumps'
compilation terminated.

I looked into the spec-file in that directory. There is the entry:
*cpp_debug_options:
%<dumpdir %<dumpbase %<dumpbase-ext %{d*} %:dumps()

When I change it to the entry as in GCC 10.3:
*cpp_debug_options:
%{d*}

the compile runs through even so in the end, the specs file seems to be overwritten again.

I have seen, that this arguments are defined inside ../gcc/gcc.c. I see there for
gcc 11.2:

Gcc-11.2/gcc/gcc.c
1253 – 1262:
/* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al.
     Make it easy for a language to override the argument for the
    %:dumps specs function call.  */
#define DUMPS_OPTIONS(EXTS) \
   "%<dumpdir %<dumpbase %<dumpbase-ext %{d*} %:dumps(" EXTS ")"

/* This contains cpp options which are not passed when the preprocessor
    output will be used by another program.  */
static const char *cpp_debug_options = DUMPS_OPTIONS ("");

While I see in 10.3:
Gcc-10.3/gcc/gcc.c
1142 :
/* This contains cpp options which are not passed when the preprocessor
    output will be used by another program.  */
static const char *cpp_debug_options = "%{d*}";

  
Still have no clue where this dumps is defined. But when I patch the g++spec.c manully and restart compilation, the compilation runs through. My best guess is, that it is not defined inside 10.3 and in the first compilation with 10.3 it fails.
Is there a clean solution to solve this (unclean solution would be to patch gcc.c or to hack the spec-file when it fails and restart compile)? Where is this dumps defined? Are some prerequisites missing?

Best regards,
Tammo



More information about the Gcc-help mailing list