Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 2021 07:57:52 GMT
From:      Gerald Pfeifer <gerald@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 7d6c458605b7 - main - emulators/wine-devel: Fix build when devel/libsysinfo is present
Message-ID:  <202108120757.17C7vqiZ083679@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by gerald:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7d6c458605b7075a8bc6d4c0d80605f49f17dd21

commit 7d6c458605b7075a8bc6d4c0d80605f49f17dd21
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2021-08-12 07:53:10 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2021-08-12 07:57:34 +0000

    emulators/wine-devel: Fix build when devel/libsysinfo is present
    
    When devel/libsysinfo is present, <sys/sysinfo.h> exists which
    misleads Wine into enabling some code that invokes the sysinfo
    function. That one isn't actually available, though, without
    additional linking parameters (and we don't want to add another
    dependency at this point anyway), so properly test for sysinfo()
    before using it.
    
    This is a patch of mine that was accepted upstream and should
    come in via Wine 6.15.
    
    PR:             257398
---
 .../files/patch-dlls-ntdll-unix-virtual.c          | 68 ++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/emulators/wine-devel/files/patch-dlls-ntdll-unix-virtual.c b/emulators/wine-devel/files/patch-dlls-ntdll-unix-virtual.c
new file mode 100644
index 000000000000..125e0908dcc6
--- /dev/null
+++ b/emulators/wine-devel/files/patch-dlls-ntdll-unix-virtual.c
@@ -0,0 +1,68 @@
+commit 59da79021a6e441e3b21b933c744aba922208ec1
+Author: Gerald Pfeifer <gerald@pfeifer.com>
+Date:   Tue Aug 10 22:36:27 2021 +0200
+
+    ntdll: Only use sysinfo function when present.
+    
+    On some systems <sys/sysinfo.h> may be present while the sysinfo
+    function may not, or at least not as part of standard libraries,
+    so check whether the function is actually available before using
+    it.
+    
+    This fixes builds on FreeBSD with the devel/libsysinfo present.
+    
+    Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
+    Signed-off-by: Alexandre Julliard <julliard@winehq.org>
+
+diff --git a/configure b/configure
+index 1be0aa9d217..e8c1cb9e3a8 100755
+--- configure
++++ configure
+@@ -18068,6 +18068,7 @@ for ac_func in \
+ 	setprogname \
+ 	sigprocmask \
+ 	symlink \
++	sysinfo \
+ 	tcdrain \
+ 	thr_kill2
+ 
+diff --git a/configure.ac b/configure.ac
+index 69e27147088..065b3f231bf 100644
+--- configure.ac
++++ configure.ac
+@@ -2205,6 +2205,7 @@ AC_CHECK_FUNCS(\
+ 	setprogname \
+ 	sigprocmask \
+ 	symlink \
++	sysinfo \
+ 	tcdrain \
+ 	thr_kill2
+ )
+diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
+index a252e25fbc6..2cca90ac952 100644
+--- dlls/ntdll/unix/virtual.c
++++ dlls/ntdll/unix/virtual.c
+@@ -2737,7 +2737,8 @@ ULONG_PTR get_system_affinity_mask(void)
+  */
+ void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info, BOOL wow64 )
+ {
+-#if defined(HAVE_STRUCT_SYSINFO_TOTALRAM) && defined(HAVE_STRUCT_SYSINFO_MEM_UNIT)
++#if defined(HAVE_SYSINFO) \
++    && defined(HAVE_STRUCT_SYSINFO_TOTALRAM) && defined(HAVE_STRUCT_SYSINFO_MEM_UNIT)
+     struct sysinfo sinfo;
+ 
+     if (!sysinfo(&sinfo))
+diff --git a/include/config.h.in b/include/config.h.in
+index ad770281471..24f7b64ffd3 100644
+--- include/config.h.in
++++ include/config.h.in
+@@ -744,6 +744,9 @@
+ /* Define to 1 if you have the <syscall.h> header file. */
+ #undef HAVE_SYSCALL_H
+ 
++/* Define to 1 if you have the `sysinfo' function. */
++#undef HAVE_SYSINFO
++
+ /* Define to 1 if you have the
+    <SystemConfiguration/SCDynamicStoreCopyDHCPInfo.h> header file. */
+ #undef HAVE_SYSTEMCONFIGURATION_SCDYNAMICSTORECOPYDHCPINFO_H



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