This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [libcc1] Improve detection of triplet on compiler names
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Tom Tromey <tom at tromey dot com>, Keith Seitz <keiths at redhat dot com>, Phil Muldoon <pmuldoon at redhat dot com>, Alexandre Oliva <aoliva at redhat dot com>
- Date: Wed, 23 Aug 2017 14:28:33 -0400
- Subject: Re: [libcc1] Improve detection of triplet on compiler names
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sergiodj at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DC9D84ACCB
- References: <87mv6qhq9u.fsf@redhat.com> <af151878-0195-dd4b-06ea-9c1c05b6903e@redhat.com>
On Wednesday, August 23 2017, Pedro Alves wrote:
> On 08/23/2017 05:17 AM, Sergio Durigan Junior wrote:
>> Hi there,
>>
>> This is a series of two patches, one for GDB and one for GCC, which aims
>> to improve the detection and handling of triplets present on compiler
>> names. The motivation for this series was mostly the fact that GDB's
>> "compile" command is broken on Debian unstable, as can be seen here:
>>
>> <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=851146>
>>
>> The reason for the failure is the fact that Debian compiles GCC using
>> the --program-{prefix,suffix} options from configure in order to name
>> the compiler using the full triplet (i.e., Debian's GCC is not merely
>> named "gcc", but e.g. "x86_64-linux-gnu-gcc-7"), which end up naming the
>> C_COMPILER_NAME and CP_COMPILER_NAME defines with the specified prefix
>> and suffix. Therefore, the regexp being used to match the compiler name
>> is wrong because it doesn't take into account the fact that the defines
>> may already contain the triplets.
>
> As discussed on IRC, I think the problem is that C_COMPILER_NAME
> in libcc1 includes the full triplet in the first place. I think
> that it shouldn't. I think that C_COMPILER_NAME should always
> be "gcc".
Thanks for summarizing the discussion.
I tend to agree with the rationale, and having C_COMPILER_NAME as "gcc"
is also a valid fix for the original problem.
As I said, I'd also like to hear others' opinions about the issue. I
can then submit a proper patch.
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/