public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] elf.h: Drop duplicate DT_RISCV_VARIANT_CC
@ 2023-04-28 18:19 Palmer Dabbelt
  2023-04-28 19:04 ` Fangrui Song
  0 siblings, 1 reply; 3+ messages in thread
From: Palmer Dabbelt @ 2023-04-28 18:19 UTC (permalink / raw)
  To: joseph; +Cc: libc-alpha, Palmer Dabbelt

I missed the update from last year that included these already, having
duplicates breaks the build due to redefinition errors like

    elf/elf.h:4013: error: macro STO_RISCV_VARIANT_CC redefined
    elf.h:3941: note: location of previous definition

Reported-by: Joseph S. Myers <joseph@codesourcery.com>
Fixes: 117e8b341c ("riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC.")
Link: https://inbox.sourceware.org/libc-alpha/mhng-0d9fb5a0-63fa-4b02-8029-7c20232f39ee@palmer-ri-x1c9/T/#t
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
bulid-many-glibcs is still churning and might take a bit, but looks like
this was just a silly mistake on my end.  I'm pretty confident this
fixes the issue, but happy to wait for the tests to finish given that I
just screwed this up.  That was before coffee, though, so maybe I can
avoid some of the blame... ;)
---
 elf/elf.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/elf/elf.h b/elf/elf.h
index 4f65b5a32d..94ca23c1bb 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -3933,13 +3933,6 @@ enum
 
 #define R_TILEGX_NUM		130
 
-/* RISC-V specific values for the Dyn d_tag field.  */
-#define DT_RISCV_VARIANT_CC	(DT_LOPROC + 1)
-#define DT_RISCV_NUM		2
-
-/* RISC-V specific values for the st_other field.  */
-#define STO_RISCV_VARIANT_CC 0x80
-
 /* RISC-V ELF Flags */
 #define EF_RISCV_RVC 			0x0001
 #define EF_RISCV_FLOAT_ABI 		0x0006
-- 
2.40.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] elf.h: Drop duplicate DT_RISCV_VARIANT_CC
  2023-04-28 18:19 [PATCH] elf.h: Drop duplicate DT_RISCV_VARIANT_CC Palmer Dabbelt
@ 2023-04-28 19:04 ` Fangrui Song
  2023-04-29 17:10   ` Palmer Dabbelt
  0 siblings, 1 reply; 3+ messages in thread
From: Fangrui Song @ 2023-04-28 19:04 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: joseph, libc-alpha

On 2023-04-28, Palmer Dabbelt wrote:
>I missed the update from last year that included these already, having
>duplicates breaks the build due to redefinition errors like
>
>    elf/elf.h:4013: error: macro STO_RISCV_VARIANT_CC redefined
>    elf.h:3941: note: location of previous definition
>
>Reported-by: Joseph S. Myers <joseph@codesourcery.com>
>Fixes: 117e8b341c ("riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC.")
>Link: https://inbox.sourceware.org/libc-alpha/mhng-0d9fb5a0-63fa-4b02-8029-7c20232f39ee@palmer-ri-x1c9/T/#t
>Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
>---
>bulid-many-glibcs is still churning and might take a bit, but looks like
>this was just a silly mistake on my end.  I'm pretty confident this
>fixes the issue, but happy to wait for the tests to finish given that I
>just screwed this up.  That was before coffee, though, so maybe I can
>avoid some of the blame... ;)
>---
> elf/elf.h | 7 -------
> 1 file changed, 7 deletions(-)
>
>diff --git a/elf/elf.h b/elf/elf.h
>index 4f65b5a32d..94ca23c1bb 100644
>--- a/elf/elf.h
>+++ b/elf/elf.h
>@@ -3933,13 +3933,6 @@ enum
>
> #define R_TILEGX_NUM		130
>
>-/* RISC-V specific values for the Dyn d_tag field.  */
>-#define DT_RISCV_VARIANT_CC	(DT_LOPROC + 1)
>-#define DT_RISCV_NUM		2

We probably should keep DT_RISCV_NUM. There is just one definition.

>-/* RISC-V specific values for the st_other field.  */
>-#define STO_RISCV_VARIANT_CC 0x80

The convention appears to place DT_ STO_ definitions after R_
definitions for a particular processor.
I'd suggest that we move the definitions below R_ while keeping just one
copy.

> /* RISC-V ELF Flags */
> #define EF_RISCV_RVC 			0x0001
> #define EF_RISCV_FLOAT_ABI 		0x0006
>-- 
>2.40.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] elf.h: Drop duplicate DT_RISCV_VARIANT_CC
  2023-04-28 19:04 ` Fangrui Song
@ 2023-04-29 17:10   ` Palmer Dabbelt
  0 siblings, 0 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2023-04-29 17:10 UTC (permalink / raw)
  To: maskray; +Cc: joseph, libc-alpha

On Fri, 28 Apr 2023 12:04:51 PDT (-0700), maskray@google.com wrote:
> On 2023-04-28, Palmer Dabbelt wrote:
>>I missed the update from last year that included these already, having
>>duplicates breaks the build due to redefinition errors like
>>
>>    elf/elf.h:4013: error: macro STO_RISCV_VARIANT_CC redefined
>>    elf.h:3941: note: location of previous definition
>>
>>Reported-by: Joseph S. Myers <joseph@codesourcery.com>
>>Fixes: 117e8b341c ("riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC.")
>>Link: https://inbox.sourceware.org/libc-alpha/mhng-0d9fb5a0-63fa-4b02-8029-7c20232f39ee@palmer-ri-x1c9/T/#t
>>Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
>>---
>>bulid-many-glibcs is still churning and might take a bit, but looks like
>>this was just a silly mistake on my end.  I'm pretty confident this
>>fixes the issue, but happy to wait for the tests to finish given that I
>>just screwed this up.  That was before coffee, though, so maybe I can
>>avoid some of the blame... ;)
>>---
>> elf/elf.h | 7 -------
>> 1 file changed, 7 deletions(-)
>>
>>diff --git a/elf/elf.h b/elf/elf.h
>>index 4f65b5a32d..94ca23c1bb 100644
>>--- a/elf/elf.h
>>+++ b/elf/elf.h
>>@@ -3933,13 +3933,6 @@ enum
>>
>> #define R_TILEGX_NUM		130
>>
>>-/* RISC-V specific values for the Dyn d_tag field.  */
>>-#define DT_RISCV_VARIANT_CC	(DT_LOPROC + 1)
>>-#define DT_RISCV_NUM		2
>
> We probably should keep DT_RISCV_NUM. There is just one definition.

Ya, thanks.  I'm not sure why I was being an idiot yesterday, but I took 
a nap and hopefully things will be better today.

>
>>-/* RISC-V specific values for the st_other field.  */
>>-#define STO_RISCV_VARIANT_CC 0x80
>
> The convention appears to place DT_ STO_ definitions after R_
> definitions for a particular processor.
> I'd suggest that we move the definitions below R_ while keeping just one
> copy.

Seems reasonable.  I've just sent a v2.

>> /* RISC-V ELF Flags */
>> #define EF_RISCV_RVC 			0x0001
>> #define EF_RISCV_FLOAT_ABI 		0x0006
>>--
>>2.40.0
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-29 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-28 18:19 [PATCH] elf.h: Drop duplicate DT_RISCV_VARIANT_CC Palmer Dabbelt
2023-04-28 19:04 ` Fangrui Song
2023-04-29 17:10   ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).