Re: [PATCH] [GDB 18] gdb/configure: fix string quoting in AC_MSG_WARN and AC_MSG_ERROR

Andrew Burgess <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
Adding Guinevere to the CC list as the author of this feature.

Eli Zaretskii <[email protected]> writes:

>> From: Andrew Burgess <[email protected]>
>> Cc: Eli Zaretskii <[email protected]>,
>> 	Andrew Burgess <[email protected]>
>> Date: Tue, 11 Aug 2026 14:02:06 +0100
>> 
>> If / when approve I plan to push this to both master and gdb-18-branch.
>
> Thanks.  I have a question about this below.
>
>> Now when configuring with
>> --enable-binary-file-formats='coff,xcoff,elf,macho' on a target that
>> doesn't support Mach-O, e.g. GNU/Linux, the configure will stop like
>> this:
>> 
>>   checking for ELF support in BFD... yes
>>   checking for library containing dlopen... (cached) none required
>>   checking for Mach-O support in BFD... no
>>   configure: error: Mach-O support was requested, but BFD does not support it
>>   make: *** [Makefile:13461: configure-gdb] Error 1
>
> Hmm... so building with Mach-O support on GNU/Linux and MS-Windows is
> not possible at all?  I'm not sure I understand the "BFD does not
> support it" part of the error message: shouldn't BFD that is compiled
> as part of GDB be configured to support Mach-O when GDB is configured
> with --enable-binary-file-formats='coff,xcoff,elf,macho'?  Or what am
> I missing?

My understand is that to get support for Mach-O you'll need to use
--enable-targets=.... to add a suitable target in addition to the
default (GNU/Linux or Windows depending on the build host).

Doing this will, I believe, cause BFD to be built with support for that
target.

The --enable-binary-file-formats flag then controls the GDB side of
things, you could choose to exclude macho support from GDB if you
wished.

I'm not sure the use case for doing that is super obvious, and I think
that macho is probably a choice for a motivating use case.

If we consider coff/xcoff, which on GNU/Linux we get "for free".  But
supporting these in GDB means we have an increased surface area for
bugs, all in code that many GNU/Linux distros don't care about.

The motivation for the --enable-binary-file-formats flag was to be able
to compile a GDB that runs on GNU/Linux and only supports ELF.

Hopefully Guinevere will chip in and correct any mistakes I've made in
the above explanation.

Thanks,
Andrew
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.