tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fixing Elf##_Versym



On 2025-11-12 19:15 matthew green <mrg%eterna23.net@localhost> wrote:
> unfortunately, this is breaking several things in pkgsrc.  they're
> all the same chunk of code that is #ifdef __NetBSD__.  we need a
> way to identify this so we can build code either side of this
> change..  eg, the 4th version of this same code i just worked
> around is pkgsrc/devel/abseil:
>
> --- absl/debugging/internal/elf_mem_image.cc.orig       2025-09-22 
> 11:24:38.000000000 -0700
> +++ absl/debugging/internal/elf_mem_image.cc    2025-11-12 
> 11:09:48.791740924 -0800
>
> @@ -377,7 +379,7 @@ void ElfMemImage::SymbolIterator::Update
>    const ElfW(Versym) *version_symbol = image->GetVersym(index_);
>    ABSL_RAW_CHECK(symbol && version_symbol, "");
>    const char *const symbol_name = image->GetDynstr(symbol->st_name);
> -#if defined(__NetBSD__)
> +#if defined(__NetBSD__) && 0
>    const int version_index = version_symbol->vs_vers & VERSYM_VERSION;
>  #else
>    const ElfW(Versym) version_index = version_symbol[0] & VERSYM_VERSION;
>
> i've also seen this same code in firefox, firefox140 and nodejs
> so far.. i did not commit any fixes because i don't know of a
> way to detect this via #ifdef.
>
> we need something.
>
> Joseph, can you have a look please?  thanks.

Oops.

I should have bumped __NetBSD_Version__ alongside the change
to the types, so that packages could use the appropriate
#ifdef stanza to handle both sides of the change. 

Index: sys/sys/param.h
===================================================================
RCS file: /cvsroot/src/sys/sys/param.h,v
retrieving revision 1.741
diff -u -r1.741 param.h
--- sys/sys/param.h	21 Sep 2025 14:43:19 -0000	1.741
+++ sys/sys/param.h	12 Nov 2025 21:09:46 -0000
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	1199000300	/* NetBSD 11.99.3 */
+#define	__NetBSD_Version__	1199000400	/* NetBSD 11.99.4 */
 
 #define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \
     (m) * 1000000) + (p) * 100) <= __NetBSD_Version__)


I will do this shortly.  Apologies for the breakage.

--
Joseph Koshy | jkoshy%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index