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

Tammo Tjarks tammo@tammo-tjarks.de
Wed Nov 3 23:58:42 GMT 2021


Hi Jonathan,
I tried also the git version as well. But that had no effect. My best guess is, that it is related to the fact, that I compile with a static linked gcc.
I tried also a shared linked gcc version (9.2.0), but there I run into other problems.
Anyway, I guess it is something like: First is compiled with the building gcc and after the shared libraries are compiled the shared library is redirected somehow to the 11er-Version which supports the dumps function. Anyway, I solved it on my side with a small hack. I exchanged inside gcc.c simply the line:
static const char *cpp_debug_options = DUMPS_OPTIONS ("");
to
static const char *cpp_debug_options = "%{d*}";
as in gcc 10.3. With that hack I was able to compile.

Best regards,
Tammo

  

On 27.10.21 00:51, Tammo Tjarks wrote:
> Hi Jonathan,
> thank you for your suggestions. I tried some modifications:
> 
> I first have set the environment with:
> 
> cd /opt/add_swlibs/.compile/gcc/11.2/rh6_64/gcc-11.2.0
> setenv PWCCMD `pwd`
> unsetenv LD_LIBRARY_PATH
>    
> setenv PATH "/opt/add_swlibs/gcc/10.3.0/rh6_64/bin:/opt/add_swlibs/binutils/2.36.1/linux60_64/bin:${PATH}"
> setenv CPATH "/opt/add_swlibs/versioned_libs/0.5/include"
> setenv LDFLAGS "-L/opt/add_swlibs/versioned_libs/0.5/linux60_64/lib64_static_only -Wl,-rpath,/opt/add_swlibs/gcc/11.2.0/rh6_64/lib64"
> 
> And then I tried configure and compile with:
> 1.
> /opt/add_swlibs/.compile/gcc/11.2/rh6_64/gcc-11.2.0/configure --prefix=/opt/add_swlibs/gcc/11.2.0/rh6_64 --enable-shared --enable-threads=posix --with-pic --enable-targets=all --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu \
>                                                     --disable-multilib \
>                                                     --enable-__cxa_atexit --enable-gnu-indirect-function --enable-checking
> 
> and still get the dumps error message.
> 
> 2.
> /opt/add_swlibs/.compile/gcc/11.2/rh6_64/gcc-11.2.0/configure --prefix=/opt/add_swlibs/gcc/11.2.0/rh6_64 --enable-shared --enable-threads=posix --with-pic --enable-targets=all --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu \
>                                                     --disable-multilib \
>                                                     --enable-__cxa_atexit
> 
>    
> Still get the dumps error message. Will try a little more on this.
> 
> Best regards,
> Tammo
> 
>     
>     
> 
> 
> 
> On 26.10.21 11:30, Jonathan Wakely wrote:
>> On Mon, 25 Oct 2021 at 22:47, Tammo Tjarks <tammo@tammo-tjarks.de> wrote:
>>>
>>> Hello Jonathan,
>>> thank you very much for your quick answer. Maybe it is related to the fact, that I compile from tarball and do not clone the git repository.
>>
>> That's the usual way people build a release. The Git repo is most
>> commonly used for building the tips of development branches.
>>
>>
>>> I use the commands:
>>>
>>> unset LD_LIBRARY_PATH
>>>
>>>
>>> export PATH="/opt/add_swlibs/gcc/10.3.0/rh6_64/bin:${PATH}"
>>> export LDFLAGS="-L/opt/add_swlibs/versioned_libs/0.5/linux60_64/lib64_static_only "
>>>
>>> /opt/add_swlibs/.compile/gcc/11.2/rh6_64/gcc-11.2.0/configure --prefix=/opt/add_swlibs/gcc/11.2.0/rh6_64 --enable-shared --enable-threads=posix --without-local-prefix --with-pic --enable-targets=all --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu \
>>>                                                      --with-ld=/opt/add_swlibs/binutils/2.36.1/linux60_64/bin/ld LDFLAGS=-Wl,-rpath,/opt/add_swlibs/gcc/11.2.0/rh6_64/lib64 --disable-multilib --with-as=/opt/add_swlibs/binutils/2.36.1/linux60_64/bin/as \
>>>                                                      --enable-__cxa_atexit --enable-gnu-indirect-function --enable-checking --enable-gather-detailed-mem-stats \
>>>                                                      --with-mpc-include=/opt/add_swlibs/versioned_libs/0.5/include --with-mpc-lib=/opt/add_swlibs/versioned_libs/0.5/linux60_64/lib64_static_only \
>>>                                                      --with-mpfr-include=/opt/add_swlibs/versioned_libs/0.5/include --with-mpfr-lib=/opt/add_swlibs/versioned_libs/0.5/linux60_64/lib64_static_only \
>>>                                                      --with-gmp-include=/opt/add_swlibs/versioned_libs/0.5/include --with-gmp-lib=/opt/add_swlibs/versioned_libs/0.5/linux60_64/lib64_static_only \
>>>                                                      --with-isl-include=/opt/add_swlibs/versioned_libs/0.5/include --with-isl-lib=/opt/add_swlibs/versioned_libs/0.5/linux60_64/lib64_static_only \
>>>                                                      --with-zstd-include=/opt/add_swlibs/versioned_libs/0.5/include --with-zstd-lib=/opt/add_swlibs/versioned_libs/0.5/linux60_64/lib64_static_only
>>>
>>>     to compile. Used similar command for 10.3 (where I did not use/provide isl and zstd).
>>> The library directory (/opt/add_swlibs/versioned_libs/0.5/linux60_64/lib64_static_only is a directory where I linked only the static libraries to link the gcc itself without dynamic dependencies. I compile for RH6, but have seen the same problem for RH7/8. For compilation I use
>>> gcc 10.3.
>>
>> You're making things far more complicated than necessary. See
>> https://gcc.gnu.org/wiki/InstallingGCC
>>
>> Also, if you have already installed binutils to the same --prefix as
>> gcc then gcc will find it and use it automatically, you don't need to
>> use --with-as and --with-ld that way (installing all these packages to
>> different directories seems superficially logical, but is actually
>> just over-complicated and unnecessary).
>>
>> I don't know why any of this would cause your problem with the specs,
>> but I also don't know why your configure command needs to be so long.
>>
>> Have you tried simplifying your command to the minimum necessary? e.g.
>> remove --enable-gather-detailed-memory-stats and
>> --without-local-prefix ?
>>
>> And why bother adding things that are the defaults anyway, like
>> --enable-shared --enable-threads=posix and the redundant
>> build/host/target options?
>>
> 



More information about the Gcc-help mailing list