Re: [PATCH v6] gdb, configure: Add disable-formats option for configure

Guinevere Larsen
2025-08-06T13:54:24Z

[-- Attachment #1: Type: text/plain, Size: 1984 bytes --]

On 8/5/25 5:07 PM, Guinevere Larsen wrote:
>>> @@ -1952,11 +1970,17 @@ fi
>>>   # Note that WIN32APILIBS is set by GDB_AC_COMMON.
>>>   WIN32LIBS="$WIN32LIBS $WIN32APILIBS"
>>>   +# Object files to be used when building with support for all file
>>> formats.
>>> +# This should not have elf or macho, as support for those formats
>>> depends
>>> +# on BFD enabling them as well.
>>> +all_binary_file_srcs="\$(dbx_SRCS) \$(mips_SRCS) \$(coff_SRCS)
>>> \$(xcoff_SRCS)"
>>> +
>>> +support_elf=no
>>>   # Add ELF support to GDB, but only if BFD includes ELF support.
>>>   GDB_AC_CHECK_BFD([for ELF support in BFD], gdb_cv_var_elf,
>>>                    [bfd_get_elf_phdr_upper_bound (NULL)], elf-bfd.h)
>>>   if test "$gdb_cv_var_elf" = yes; then
>>> -  CONFIG_OBS="$CONFIG_OBS elfread.o stap-probe.o dtrace-probe.o \
>>> +  CONFIG_OBS="$CONFIG_OBS stap-probe.o dtrace-probe.o \
>>>           gcore-elf.o elf-none-tdep.o"
>> Does it make sense (or is it useful) to compile these other files (other
>> than elfread.o) if ELF support is not enabled?  Could we just list them
>> all in elf_SRCS so that they are not built if the user doesn't want ELF
>> support?  If you don't have an ELF reader.
>
> I don't know. I took the path of least changes to implementing this,
> made worse by me not having a convenient way to test a non-ELF target.
>
> I'll try to find a way to test if those are necessary and update the
> patch if they aren't

ah, turns out I could've just tried compiling with no elf support, oops.
stap-probe and dtrace-probe can go

gcore-elf and elf-none-tdep are required to compile with
--enable-targets=all, and since these aren't enough to consider elf
supported, I think it's easier to just leave them here than figuring out
which targets require them... I did notice that the arm-tdep.c does need
them, but didn't go far into anything...

I'll submit a v7 with that update shortly

--
Cheers,
Guinevere Larsen
She/it

[-- Attachment #2: Type: text/html, Size: 3088 bytes --]