Re: [PATCH] Enable building GDB without installed libtermcap

Pedro Alves
2015-02-26T18:45:04Z

On 02/26/2015 06:00 PM, Eli Zaretskii wrote:
>> Date: Thu, 26 Feb 2015 17:48:06 +0000
>> From: Pedro Alves <palves@redhat.com>
>> CC: GDB Patches <gdb-patches@sourceware.org>, Doug Evans <dje@google.com>, Mike Frysinger <vapier@gentoo.org>
>>
>> My idea to work around that is to simply use __attribute__((weak)).
>> Of all supported hosts
>> (https://sourceware.org/gdb/wiki/Systems#Supported_Hosts),
>> Windows/PE/COFF would be the one that I'd be worried about WRT use of
>> weak, but the limited weak support in PE/COFF seems to work here. A
>> cross build using x86_64-w64-mingw32 on Fedora 20 builds fine with
>> this.
>
> With what version of GCC? Quick testing indicates that 4.8.1 supports
> that, but 3.4.2 doesn't.

Ah. This was:
gcc version 4.8.3 20140522 (Fedora MinGW 4.8.3-1.fc20) (GCC)

>
> Which version of GCC is the minimal one we want to support?

Hard to say at this point. I'd hope we'd move to requiring
something more recent than 3.4.x. From past discussions, I was
assuming we'd start by requiring 4.2 at least when finally require
C++.

> Or how about making this conditional on C++?

Some want to build with -fno-common, even in C mode. Given
that this stub file never needed these variables while it was
Windows-only, how about we simply not define the variables
if compiling for mingw/cygwin, but define them as weak
everywhere else? The worse that can happen is some host that
didn't use to build for lack of termcap will now fail to build
due to lack of weak. In practical terms, you just end up with
no gdb, just like before, so no worse.

Thanks,
Pedro Alves