libctf doesn't build with Solaris sed

Simon Marchi simon.marchi@polymtl.ca
Sun Oct 18 00:33:06 GMT 2020


Hi,

I'm trying to build GDB on Solaris (on machine gcc211 of the compile
farm), and I stumbled on this error:

    In file included from /export/home/simark/src/binutils-gdb/libctf/ctf-error.c:41:0:
    ./ctf-error.h:1:4: error: expected specifier-qualifier-list before ‘ECTF_FMT’                                                                                                                    9]
        ECTF_FMT, /* File is not in CTF or ELF format.  */
        ^

I tracked it down to ctf-error.h (a generated file) having the wrong
content:

    $ sed -nf /export/home/simark/src/binutils-gdb/libctf/mkerrors.sed < /export/home/simark/src/binutils-gdb/libctf/../include/ctf-api.h
       ECTF_FMT, /* File is not in CTF or ELF format.  */
       ECTF_BFDERR,         /* BFD error.  */
       ...

Normally, it should be like this:

    _CTF_STR (ECTF_FMT, "File is not in CTF or ELF format")
    _CTF_STR (ECTF_BFDERR, "BFD error")

I presume that there is some GNU-ism in mkerrors.sed.  When I replace
sed with gsed in the Makefile, it gets generated correctly.

If the script can be made to work with all seds, then great.  Otherwise,
you could verify that sed is GNU sed and allow the user to pass SED=gsed
or something.

Also, "make clean" does not remove ctf-error.h, I think it should.

Thanks!

Simon


More information about the Binutils mailing list