[PATCH] gdb: Don't overwrite CC when checking for BFD support

Tom Tromey tom@tromey.com
Fri Apr 21 14:51:07 GMT 2023


>>>>> orbea via Gdb-patches <gdb-patches@sourceware.org> writes:

> This can be solved by using the default value for CC instead where
> autotools is capable of providing an adequate value by default. I
> attached a patch doing this.

I applied this patch and re-ran autoconf, then tried a build.
It failed, and looking in gdb/config.log I see:

configure:28348: gcc -o conftest -I../../binutils-gdb/gdb/../include -I../bfd -I../../binutils-gdb/gdb/../bfd -g -O2      -L../bfd -L../libiberty   conftest.c -lbfd -liberty  -lncursesw -lm  >&5
/bin/ld: cannot find -lbfd

... which is what I guess I would have predicted.

I think for ordinary gdb builds, using libtool here is required.

IIUC you are using some kind of libtool replacement.  I don't know
exactly how but it seems to me that some other sort of fix is needed.

Perhaps the line:

  CC="./libtool --quiet --mode=link $CC"

could also use whatever variable(s) you are setting to pass in your
alternative setup?  Looking at your build log, I don't see anything
special passed to configure, so perhaps that also has to change on your
side.

Anyway, I'm sorry, but I don't think this patch can go in as-is.

thanks,
Tom


More information about the Gdb-patches mailing list