Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2020 16:42:17 +0200 (CEST)
From:      Gerald Pfeifer <gerald@pfeifer.com>
To:        Damjan Jovanovic <damjan.jov@gmail.com>,  Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: Wine 5.9 bugfix
Message-ID:  <alpine.LSU.2.21.2005241640030.4832@anthias.pfeifer.com>
In-Reply-To: <CAJm2B-kXrGB88k-oFxH2Le2N---fEL_AUHXQdxgoh-hfM9Jz4Q@mail.gmail.com>
References:  <CAJm2B-m1JU%2B6J88=7r19cP9y=UXV%2BYmMQwoJgA_Ce1-bWPjiKA@mail.gmail.com> <20200523111633.GO64045@kib.kiev.ua> <CAJm2B-=KYW0aiiEfeE87dv9-cbACY0L_Bj%2BSjp-33kJvuF81Qw@mail.gmail.com> <alpine.LSU.2.21.2005232033330.4832@anthias.pfeifer.com> <CAJm2B-=ovDqprxPy4zt6btNBfTDjGWLcatEr786yhzjdePwS6w@mail.gmail.com> <alpine.LSU.2.21.2005232118280.4832@anthias.pfeifer.com> <CAJm2B-kXrGB88k-oFxH2Le2N---fEL_AUHXQdxgoh-hfM9Jz4Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 24 May 2020, Damjan Jovanovic wrote:
> This is the patch I would send, it effectively changes 2 lines to check an
> extra condition (__FreeBSD_version < 1202000):
> 
> 
> commit c81fc2e8dc75c5dcab300da4fa6cc6ccfb0c3d15 (freebsd-mmap)
> Author: Damjan Jovanovic <damjan.jov@gmail.com>
> Date:   Sat May 23 13:49:31 2020 +0200
> 
>     ntdll: only use the link_map.l_addr workaround on FreeBSD < 12.2
> 
>     FreeBSD 12.2 will change the meaning of link_map.l_addr to be
>     the offset from file addresses to RAM addresses, like it is in
>     Linux/NetBSD/Illumos
>     (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246561)
> 
>     Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
> 
> diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
> index 6e41b37ad8..bdd7794683 100644
> --- a/dlls/ntdll/loader.c
> +++ b/dlls/ntdll/loader.c
> @@ -1317,7 +1317,7 @@ static void call_tls_callbacks( HMODULE module, UINT
> reason )
>      }
>  }
> 
> -#ifdef __FreeBSD__
> +#if defined(__FreeBSD__) && (__FreeBSD_version < 1202000)
>  /* The PT_LOAD segments are sorted in increasing order, and the first
>   * starts at the beginning of the ELF file. By parsing the file, we can
>   * find that first PT_LOAD segment, from which we can find the base
> @@ -1370,7 +1370,7 @@ static void call_constructors( WINE_MODREF *wm )
>      {
>          caddr_t relocbase = (caddr_t)map->l_addr;
> 
> -#ifdef __FreeBSD__  /* FreeBSD doesn't relocate l_addr */
> +#if defined(__FreeBSD__) && (__FreeBSD_version < 1202000)  /* FreeBSD
> doesn't relocate l_addr */
>          if (!get_relocbase(map->l_addr, &relocbase)) return;
>  #endif
>          switch (dyn->d_tag)

I wonder whether that's not worth a __FreeBSD_version bump, see
https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/versions-12.html
for other examples.

Konstantin?

(The challenge of course remains when packages are built on/for one
specific minor version/patch level, and then deployed on a later or
earlier one.)

Gerald



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.LSU.2.21.2005241640030.4832>