gdb: Fix an ODR warning with byacc with GDB_YY_REMAP

Message ID 20230912010238.3086346-1-sam@gentoo.org
State New
Headers
Series gdb: Fix an ODR warning with byacc with GDB_YY_REMAP |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed

Commit Message

Sam James Sept. 12, 2023, 12:58 a.m. UTC
  With byacc, we get an ODR warning with YYSTACKDATA between ada-exp.c.tmp
and c-exp.c.tmp. Just include it in the list of symbols we rename.

PR gdb/30839

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30839
Acked-by: Tom de Vries <vries@gcc.gnu.org>
Signed-off-by: Sam James <sam@gentoo.org>
---

Few notes:
- Tom commented that it probably constitutes obvious but while I have binutils
  access, I'm not listed in gdb/MAINTAINERS for write-after-approval, so I'm
  hesitant.

- The top of yy-remap.h does mention that we should fix yacc impls which emit
  symbols that clash that aren't in the list, but meh. I'm not sure we've even
  stuck to that rule for the other symbols, and the list is already for non-Bison
  anyway...

 gdb/yy-remap.h | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Tom de Vries Sept. 12, 2023, 10:49 a.m. UTC | #1
On 9/12/23 02:58, Sam James wrote:
> With byacc, we get an ODR warning with YYSTACKDATA between ada-exp.c.tmp
> and c-exp.c.tmp. Just include it in the list of symbols we rename.
> 
> PR gdb/30839
> 

Please make that "PR build/30839".

> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30839
> Acked-by: Tom de Vries <vries@gcc.gnu.org>

Please change that to "Approved-By: Tom de Vries <tdevries@suse.de>" 
(note the difference in email address).

Otherwise LGTM, please commit.

> Signed-off-by: Sam James <sam@gentoo.org>
> ---
> 
> Few notes:
> - Tom commented that it probably constitutes obvious but while I have binutils
>    access, I'm not listed in gdb/MAINTAINERS for write-after-approval, so I'm
>    hesitant.
> 
> - The top of yy-remap.h does mention that we should fix yacc impls which emit
>    symbols that clash that aren't in the list, but meh. I'm not sure we've even
>    stuck to that rule for the other symbols, and the list is already for non-Bison
>    anyway...
> 

[ Yeah, I think it would be more useful to divide up the list, and 
reformulate the comment as "list below needs to be fixed in 
corresponding parser generators" or some such.

Let's not bother with that for this commit though. ]

Thanks,
- Tom

>   gdb/yy-remap.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/gdb/yy-remap.h b/gdb/yy-remap.h
> index 33bee0fabdb..d0125b9ed45 100644
> --- a/gdb/yy-remap.h
> +++ b/gdb/yy-remap.h
> @@ -85,6 +85,7 @@
>   #define yystacksize	GDB_YY_REMAP (yystacksize)
>   #define yyvs		GDB_YY_REMAP (yyvs)
>   #define yyvsp		GDB_YY_REMAP (yyvsp)
> +#define YYSTACKDATA	GDB_YY_REMAP (YYSTACKDATA)
>   
>   /* The following are common to all parsers.  */
>
  
Tom de Vries Sept. 12, 2023, 1:03 p.m. UTC | #2
On 9/12/23 02:58, Sam James wrote:
> - Tom commented that it probably constitutes obvious but while I have 
> binutils access, I'm not listed in gdb/MAINTAINERS for 
> write-after-approval, so I'm hesitant.

GDB write-after-approval requires a copyright assignment that covers 
gdb.  Do you have a copyright assignment for gdb?

Thanks,
- Tom
  
Tom Tromey Sept. 26, 2023, 1:48 p.m. UTC | #3
>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> On 9/12/23 02:58, Sam James wrote:
>> - Tom commented that it probably constitutes obvious but while I
>> have binutils access, I'm not listed in gdb/MAINTAINERS for
>> write-after-approval, so I'm hesitant.

Tom> GDB write-after-approval requires a copyright assignment that covers
Tom> gdb.  Do you have a copyright assignment for gdb?

I think this patch could land without the paperwork, since it is small.
And, it would be good to get it in before GDB 14, since it is a build
fix.

Tom
  
Tom de Vries Sept. 26, 2023, 1:57 p.m. UTC | #4
On 9/26/23 15:48, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Tom> On 9/12/23 02:58, Sam James wrote:
>>> - Tom commented that it probably constitutes obvious but while I
>>> have binutils access, I'm not listed in gdb/MAINTAINERS for
>>> write-after-approval, so I'm hesitant.
> 
> Tom> GDB write-after-approval requires a copyright assignment that covers
> Tom> gdb.  Do you have a copyright assignment for gdb?
> 
> I think this patch could land without the paperwork, since it is small.

Agreed, which is why I've already approved it and asked Sam to commit it.

> And, it would be good to get it in before GDB 14, since it is a build
> fix.

Agreed.  Sam, is there anything preventing you from committing this?  If 
so, then I can take care of it.

Thanks,
- Tom
  
Sam James Sept. 27, 2023, 7:35 a.m. UTC | #5
Tom de Vries <tdevries@suse.de> writes:

> On 9/26/23 15:48, Tom Tromey wrote:
>>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
>> Tom> On 9/12/23 02:58, Sam James wrote:
>>>> - Tom commented that it probably constitutes obvious but while I
>>>> have binutils access, I'm not listed in gdb/MAINTAINERS for
>>>> write-after-approval, so I'm hesitant.
>> Tom> GDB write-after-approval requires a copyright assignment that
>> covers
>> Tom> gdb.  Do you have a copyright assignment for gdb?
>> I think this patch could land without the paperwork, since it is
>> small.
>
> Agreed, which is why I've already approved it and asked Sam to commit it.
>
>> And, it would be good to get it in before GDB 14, since it is a build
>> fix.
>
> Agreed.  Sam, is there anything preventing you from committing this?
> If so, then I can take care of it.

Sorry folks, done now - Tom's question had prompted me to go finally
figure out the copyright assignment bits and I got distracted.

Pushed!

>
> Thanks,
> - Tom

best,
sam
  
Tom de Vries Sept. 27, 2023, 7:52 a.m. UTC | #6
On 9/27/23 09:35, Sam James wrote:
> 
> Tom de Vries <tdevries@suse.de> writes:
> 
>> On 9/26/23 15:48, Tom Tromey wrote:
>>>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
>>> Tom> On 9/12/23 02:58, Sam James wrote:
>>>>> - Tom commented that it probably constitutes obvious but while I
>>>>> have binutils access, I'm not listed in gdb/MAINTAINERS for
>>>>> write-after-approval, so I'm hesitant.
>>> Tom> GDB write-after-approval requires a copyright assignment that
>>> covers
>>> Tom> gdb.  Do you have a copyright assignment for gdb?
>>> I think this patch could land without the paperwork, since it is
>>> small.
>>
>> Agreed, which is why I've already approved it and asked Sam to commit it.
>>
>>> And, it would be good to get it in before GDB 14, since it is a build
>>> fix.
>>
>> Agreed.  Sam, is there anything preventing you from committing this?
>> If so, then I can take care of it.
> 
> Sorry folks, done now - Tom's question had prompted me to go finally
> figure out the copyright assignment bits and I got distracted.
> 
> Pushed!
> 

Hi,

thanks for pushing it.

I saw you used a Copyright-paperwork-exempt tag, it's good to make that 
explicit (FWIW, I was not familiar with the tag itself, but I see 
there's prior usage).

Just want to mention: my understanding is that this commit goes into the 
bucket legally insignificant contributions.  If you keep adding similar 
commits, at some point this bucket will overflow and you need a 
copyright assignment to keep contributing regardless of the nature of 
the patch.  I wish these things were less complicated ...

Thanks,
- Tom
  
Sam James Sept. 28, 2023, 2:56 a.m. UTC | #7
Tom de Vries <tdevries@suse.de> writes:

> On 9/27/23 09:35, Sam James wrote:
>> Tom de Vries <tdevries@suse.de> writes:
>> 
>>> On 9/26/23 15:48, Tom Tromey wrote:
>>>>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
>>>> Tom> On 9/12/23 02:58, Sam James wrote:
>>>>>> - Tom commented that it probably constitutes obvious but while I
>>>>>> have binutils access, I'm not listed in gdb/MAINTAINERS for
>>>>>> write-after-approval, so I'm hesitant.
>>>> Tom> GDB write-after-approval requires a copyright assignment that
>>>> covers
>>>> Tom> gdb.  Do you have a copyright assignment for gdb?
>>>> I think this patch could land without the paperwork, since it is
>>>> small.
>>>
>>> Agreed, which is why I've already approved it and asked Sam to commit it.
>>>
>>>> And, it would be good to get it in before GDB 14, since it is a build
>>>> fix.
>>>
>>> Agreed.  Sam, is there anything preventing you from committing this?
>>> If so, then I can take care of it.
>> Sorry folks, done now - Tom's question had prompted me to go finally
>> figure out the copyright assignment bits and I got distracted.
>> Pushed!
>> 
>
> Hi,
>
> thanks for pushing it.
>
> I saw you used a Copyright-paperwork-exempt tag, it's good to make
> that explicit (FWIW, I was not familiar with the tag itself, but I see
> there's prior usage).
>
> Just want to mention: my understanding is that this commit goes into
> the bucket legally insignificant contributions.  If you keep adding
> similar commits, at some point this bucket will overflow and you need
> a copyright assignment to keep contributing regardless of the nature
> of the patch.  I wish these things were less complicated ...

Thank you! I've just had the email from the FSF saying it's all done
(it was in-flight for a while but I needed to do some bits to finish it off).

I appreciate the nudge to get this done, it was overdue anyway and
I was putting it off.

Would you mind if I added myself to write-after-approval?

>
> Thanks,
> - Tom

best,
sam
  
Tom de Vries Sept. 28, 2023, 8:30 a.m. UTC | #8
On 9/28/23 04:56, Sam James wrote:
> 
> Tom de Vries <tdevries@suse.de> writes:
> 
>> On 9/27/23 09:35, Sam James wrote:
>>> Tom de Vries <tdevries@suse.de> writes:
>>>
>>>> On 9/26/23 15:48, Tom Tromey wrote:
>>>>>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
>>>>> Tom> On 9/12/23 02:58, Sam James wrote:
>>>>>>> - Tom commented that it probably constitutes obvious but while I
>>>>>>> have binutils access, I'm not listed in gdb/MAINTAINERS for
>>>>>>> write-after-approval, so I'm hesitant.
>>>>> Tom> GDB write-after-approval requires a copyright assignment that
>>>>> covers
>>>>> Tom> gdb.  Do you have a copyright assignment for gdb?
>>>>> I think this patch could land without the paperwork, since it is
>>>>> small.
>>>>
>>>> Agreed, which is why I've already approved it and asked Sam to commit it.
>>>>
>>>>> And, it would be good to get it in before GDB 14, since it is a build
>>>>> fix.
>>>>
>>>> Agreed.  Sam, is there anything preventing you from committing this?
>>>> If so, then I can take care of it.
>>> Sorry folks, done now - Tom's question had prompted me to go finally
>>> figure out the copyright assignment bits and I got distracted.
>>> Pushed!
>>>
>>
>> Hi,
>>
>> thanks for pushing it.
>>
>> I saw you used a Copyright-paperwork-exempt tag, it's good to make
>> that explicit (FWIW, I was not familiar with the tag itself, but I see
>> there's prior usage).
>>
>> Just want to mention: my understanding is that this commit goes into
>> the bucket legally insignificant contributions.  If you keep adding
>> similar commits, at some point this bucket will overflow and you need
>> a copyright assignment to keep contributing regardless of the nature
>> of the patch.  I wish these things were less complicated ...
> 
> Thank you! I've just had the email from the FSF saying it's all done

Ah, that makes things much easier :)

> (it was in-flight for a while but I needed to do some bits to finish it off).
> 
> I appreciate the nudge to get this done, it was overdue anyway and
> I was putting it off.
> 
> Would you mind if I added myself to write-after-approval?

Please do so.

Thanks,
- Tom
  
Sam James Sept. 29, 2023, 4:37 a.m. UTC | #9
Tom de Vries <tdevries@suse.de> writes:

> On 9/28/23 04:56, Sam James wrote:
>> Tom de Vries <tdevries@suse.de> writes:
>> 
>>> On 9/27/23 09:35, Sam James wrote:
>>>> Tom de Vries <tdevries@suse.de> writes:
>>>>
>>>>> On 9/26/23 15:48, Tom Tromey wrote:
>>>>>>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
>>>>>> Tom> On 9/12/23 02:58, Sam James wrote:
>>>>>>>> - Tom commented that it probably constitutes obvious but while I
>>>>>>>> have binutils access, I'm not listed in gdb/MAINTAINERS for
>>>>>>>> write-after-approval, so I'm hesitant.
>>>>>> Tom> GDB write-after-approval requires a copyright assignment that
>>>>>> covers
>>>>>> Tom> gdb.  Do you have a copyright assignment for gdb?
>>>>>> I think this patch could land without the paperwork, since it is
>>>>>> small.
>>>>>
>>>>> Agreed, which is why I've already approved it and asked Sam to commit it.
>>>>>
>>>>>> And, it would be good to get it in before GDB 14, since it is a build
>>>>>> fix.
>>>>>
>>>>> Agreed.  Sam, is there anything preventing you from committing this?
>>>>> If so, then I can take care of it.
>>>> Sorry folks, done now - Tom's question had prompted me to go finally
>>>> figure out the copyright assignment bits and I got distracted.
>>>> Pushed!
>>>>
>>>
>>> Hi,
>>>
>>> thanks for pushing it.
>>>
>>> I saw you used a Copyright-paperwork-exempt tag, it's good to make
>>> that explicit (FWIW, I was not familiar with the tag itself, but I see
>>> there's prior usage).
>>>
>>> Just want to mention: my understanding is that this commit goes into
>>> the bucket legally insignificant contributions.  If you keep adding
>>> similar commits, at some point this bucket will overflow and you need
>>> a copyright assignment to keep contributing regardless of the nature
>>> of the patch.  I wish these things were less complicated ...
>> Thank you! I've just had the email from the FSF saying it's all done
>
> Ah, that makes things much easier :)
>
>> (it was in-flight for a while but I needed to do some bits to finish it off).
>> I appreciate the nudge to get this done, it was overdue anyway and
>> I was putting it off.
>> Would you mind if I added myself to write-after-approval?
>
> Please do so.

Done - thank you!

>
> Thanks,
> - Tom

best,
sam
  

Patch

diff --git a/gdb/yy-remap.h b/gdb/yy-remap.h
index 33bee0fabdb..d0125b9ed45 100644
--- a/gdb/yy-remap.h
+++ b/gdb/yy-remap.h
@@ -85,6 +85,7 @@ 
 #define yystacksize	GDB_YY_REMAP (yystacksize)
 #define yyvs		GDB_YY_REMAP (yyvs)
 #define yyvsp		GDB_YY_REMAP (yyvsp)
+#define YYSTACKDATA	GDB_YY_REMAP (YYSTACKDATA)
 
 /* The following are common to all parsers.  */