From owner-freebsd-emulation@freebsd.org Sun May 24 13:46:42 2020 Return-Path: Delivered-To: freebsd-emulation@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B179732E470 for ; Sun, 24 May 2020 13:46:42 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49VM2n5Cvwz4442 for ; Sun, 24 May 2020 13:46:41 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: by mail-io1-xd36.google.com with SMTP id d7so16323993ioq.5 for ; Sun, 24 May 2020 06:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QtP9uQkWzGnGUXFLaV9FCZXgaMXqZvP1vlilAkpE+Ug=; b=aAaTqhSTRTMYt1+4Qn26mQhd7WmDcKRfK9km59MO/SP2Ucyz2tJCTsXExcyKukwAE0 gbHjfiFyyd4Phn+0dhHPcRlbSVE+6MyOT+uxWutLzCL6lrlUWQP/a0RSnMxufDyjS2JV w1mCaQSfm6IRjMb7tlB0rMyUM6NkKWqAOLCbdakH/9xEd7WdTmlzSdY3HtYoLexsz+/Y JXqABlls13IYavI4nFDpLEaF1NP62rykFHE4M+mtomZ3G5xEfGzqy398N/vTXktGd77s pdFcNfv2cBZs+JFdOUDI4vlv/wJtLormMZJS7qiLw4t66hjnRUCpR5OCWBF589WHEFt9 l9Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QtP9uQkWzGnGUXFLaV9FCZXgaMXqZvP1vlilAkpE+Ug=; b=oDAA1AXFftD41yDjRLPoHmjCrTJbGbT5aTm0V+gPJEF8F9vlY8LJm9aha1OWEuqnKb /zIKEagFiYm51ufcSGHaGzSO5/6e311pUnEMVrMuP/uzfCGefbnDmlNun3jcEYEUw9II sy0Tpk4d44O+WseMXByze8+nSZnOhVvotKd2lgUxHIm+dzMpINsRwwzyY1GHSylRFBgU ZGKTMfyQBEyGebSiI3FRjxw/sDKtTddYOS8ir69wmkHcKCFmRKTKbFeCZyL0cOwRlHpz lIbegCiC4UwUvlfCrZm6R0mfkLaXL46de6CG/K4stllUl3Ifs8y6fl/uokw4rmx0jCvi NAvA== X-Gm-Message-State: AOAM531sXbMU2J+3iNQvgfFzwCk9iRz7l0vYs1D8Rm55SyJjsPYKx9wK R0oYPD8ssY4gO7fGcYajwjc0v6iVu94V2J85ocrNKtK+VQr1Iw== X-Google-Smtp-Source: ABdhPJyowAWWURzB5UDWp2yrk5QRoXmum8Yc+Zvq4YP7DUxu8L0Vr/3meBR9gatLbIX8Un2kW6esZopmxXvtgQLB8v4= X-Received: by 2002:a02:1607:: with SMTP id a7mr1778951jaa.14.1590328000001; Sun, 24 May 2020 06:46:40 -0700 (PDT) MIME-Version: 1.0 References: <20200523111633.GO64045@kib.kiev.ua> In-Reply-To: From: Damjan Jovanovic Date: Sun, 24 May 2020 15:45:47 +0200 Message-ID: Subject: Re: Wine 5.9 bugfix To: Gerald Pfeifer Cc: Konstantin Belousov , freebsd-emulation@freebsd.org X-Rspamd-Queue-Id: 49VM2n5Cvwz4442 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=aAaTqhST; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of damjanjov@gmail.com designates 2607:f8b0:4864:20::d36 as permitted sender) smtp.mailfrom=damjanjov@gmail.com X-Spamd-Result: default: False [-3.77 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.07)[-1.069]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-emulation@freebsd.org]; NEURAL_HAM_LONG(-1.01)[-1.014]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d36:from]; NEURAL_HAM_SHORT(-0.68)[-0.682]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2020 13:46:42 -0000 On Sun, May 24, 2020 at 3:40 PM Gerald Pfeifer wrote: > On Sat, 23 May 2020, Damjan Jovanovic wrote: > > For Wine. I'll submit it upstream when the rtld-elf patch goes into > > stable/12. > > What will happen to users on FreeBSD 11 (or 12 before the rtld-elf > patch) when that additional patch goes into upstream Wine? > > Gerald > 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 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 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)