فهرست منبع

build: update gettext and fix QEMU compiler error

Proper fix for the new compiler errors introduced in Xcode 15.3.
osy 1 سال پیش
والد
کامیت
2fc13ca956
5فایلهای تغییر یافته به همراه117 افزوده شده و 87 حذف شده
  1. 0 85
      patches/gettext-0.21.patch
  2. 72 0
      patches/gettext-0.22.5.patch
  3. 43 0
      patches/qemu-7.2.0-utm.patch
  4. 1 1
      patches/sources
  5. 1 1
      scripts/build_dependencies.sh

+ 0 - 85
patches/gettext-0.21.patch

@@ -1,85 +0,0 @@
-diff --git a/libtextstyle/lib/get_ppid_of.c b/libtextstyle/lib/get_ppid_of.c
-index 5579cd9..8323618 100644
---- a/libtextstyle/lib/get_ppid_of.c
-+++ b/libtextstyle/lib/get_ppid_of.c
-@@ -32,10 +32,6 @@
- # include <sys/sysctl.h> /* sysctl, struct kinfo_proc */
- #endif
- 
--#if defined __APPLE__ && defined __MACH__                   /* Mac OS X */
--# include <libproc.h>
--#endif
--
- #if defined _AIX                                            /* AIX */
- # include <procinfo.h>
- #endif
-@@ -225,27 +221,6 @@ get_ppid_of (pid_t pid)
- 
- #endif
- 
--#if defined __APPLE__ && defined __MACH__                   /* Mac OS X */
--
--# if defined PROC_PIDT_SHORTBSDINFO
--  struct proc_bsdshortinfo info;
--
--  if (proc_pidinfo (pid, PROC_PIDT_SHORTBSDINFO, 0, &info, sizeof (info))
--      == sizeof (info))
--    return info.pbsi_ppid;
--# else
--  /* Note: The second part of 'struct proc_bsdinfo' differs in size between
--     32-bit and 64-bit environments, and the kernel of Mac OS X 10.5 knows
--     only about the 32-bit 'struct proc_bsdinfo'.  Fortunately all the info
--     we need is in the first part, which is the same in 32-bit and 64-bit.  */
--  struct proc_bsdinfo info;
--
--  if (proc_pidinfo (pid, PROC_PIDTBSDINFO, 0, &info, 128) == 128)
--    return info.pbi_ppid;
--# endif
--
--#endif
--
- #if defined _AIX                                            /* AIX */
- 
-   /* Reference: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/getprocs.htm
-diff --git a/libtextstyle/lib/get_progname_of.c b/libtextstyle/lib/get_progname_of.c
-index 4b08489..d86dfd4 100644
---- a/libtextstyle/lib/get_progname_of.c
-+++ b/libtextstyle/lib/get_progname_of.c
-@@ -40,10 +40,6 @@
- # include <sys/sysctl.h> /* sysctl, struct kinfo_proc */
- #endif
- 
--#if defined __APPLE__ && defined __MACH__                   /* Mac OS X */
--# include <libproc.h>
--#endif
--
- #if defined _AIX                                            /* AIX */
- # include <procinfo.h>
- #endif
-@@ -265,26 +261,6 @@ get_progname_of (pid_t pid)
- 
- #endif
- 
--#if defined __APPLE__ && defined __MACH__                   /* Mac OS X */
--
--# if defined PROC_PIDT_SHORTBSDINFO
--  struct proc_bsdshortinfo info;
--
--  if (proc_pidinfo (pid, PROC_PIDT_SHORTBSDINFO, 0, &info, sizeof (info))
--      == sizeof (info))
--    return strdup (info.pbsi_comm);
--# else
--  /* Note: The second part of 'struct proc_bsdinfo' differs in size between
--     32-bit and 64-bit environments, and the kernel of Mac OS X 10.5 knows
--     only about the 32-bit 'struct proc_bsdinfo'.  Fortunately all the info
--     we need is in the first part, which is the same in 32-bit and 64-bit.  */
--  struct proc_bsdinfo info;
--
--  if (proc_pidinfo (pid, PROC_PIDTBSDINFO, 0, &info, 128) == 128)
--    return strdup (info.pbi_comm);
--# endif
--
--#endif
- 
- #if defined _AIX                                            /* AIX */
- 

+ 72 - 0
patches/gettext-0.22.5.patch

@@ -0,0 +1,72 @@
+diff --color -Naur a/libtextstyle/lib/get_ppid_of.c b/libtextstyle/lib/get_ppid_of.c
+--- a/libtextstyle/lib/get_ppid_of.c	2024-02-21 02:45:23
++++ b/libtextstyle/lib/get_ppid_of.c	2024-03-30 20:38:55
+@@ -33,6 +33,8 @@
+ #endif
+ 
+ #if defined __APPLE__ && defined __MACH__                   /* Mac OS X */
++# include <TargetConditionals.h>
++# if TARGET_OS_OSX
+ /* Get MAC_OS_X_VERSION_MIN_REQUIRED, MAC_OS_X_VERSION_MAX_ALLOWED.
+    The version at runtime satisfies
+    MAC_OS_X_VERSION_MIN_REQUIRED <= version <= MAC_OS_X_VERSION_MAX_ALLOWED.  */
+@@ -46,6 +48,7 @@
+ extern int proc_pidinfo (int, int, uint64_t, void *, int) WEAK_IMPORT_ATTRIBUTE;
+ #  endif
+ # endif
++# endif
+ #endif
+ 
+ #if defined _AIX                                            /* AIX */
+@@ -238,6 +241,7 @@
+ #endif
+ 
+ #if defined __APPLE__ && defined __MACH__                   /* Mac OS X */
++# if TARGET_OS_OSX
+ # if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ 
+   /* Mac OS X >= 10.7 has PROC_PIDT_SHORTBSDINFO.  */
+@@ -271,6 +275,7 @@
+     }
+ #  endif
+ 
++# endif
+ # endif
+ #endif
+ 
+diff --color -Naur a/libtextstyle/lib/get_progname_of.c b/libtextstyle/lib/get_progname_of.c
+--- a/libtextstyle/lib/get_progname_of.c	2024-02-21 02:45:23
++++ b/libtextstyle/lib/get_progname_of.c	2024-03-30 20:39:22
+@@ -41,6 +41,8 @@
+ #endif
+ 
+ #if defined __APPLE__ && defined __MACH__                   /* Mac OS X */
++# include <TargetConditionals.h>
++# if TARGET_OS_OSX
+ /* Get MAC_OS_X_VERSION_MIN_REQUIRED, MAC_OS_X_VERSION_MAX_ALLOWED.
+    The version at runtime satisfies
+    MAC_OS_X_VERSION_MIN_REQUIRED <= version <= MAC_OS_X_VERSION_MAX_ALLOWED.  */
+@@ -54,6 +56,7 @@
+ extern int proc_pidinfo (int, int, uint64_t, void *, int) WEAK_IMPORT_ATTRIBUTE;
+ #  endif
+ # endif
++# endif
+ #endif
+ 
+ #if defined _AIX                                            /* AIX */
+@@ -278,6 +281,7 @@
+ #endif
+ 
+ #if defined __APPLE__ && defined __MACH__                   /* Mac OS X */
++# if TARGET_OS_OSX
+ # if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ 
+   /* Mac OS X >= 10.7 has PROC_PIDT_SHORTBSDINFO.  */
+@@ -311,6 +315,7 @@
+     }
+ #  endif
+ 
++# endif
+ # endif
+ #endif
+ 

+ 43 - 0
patches/qemu-7.2.0-utm.patch

@@ -7011,3 +7011,46 @@ index 9f6e6279d9..b6cda6e00b 100644
 -- 
 2.41.0
 
+From c03d7e35473b57544523ba19975023332567a63d Mon Sep 17 00:00:00 2001
+From: osy <osy@turing.llc>
+Date: Sat, 30 Mar 2024 20:15:01 -0700
+Subject: [PATCH] egl-helpers: incorrect type for native_display
+
+---
+ ui/egl-helpers.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
+index 0df9dd8fd5..0e9a3e469d 100644
+--- a/ui/egl-helpers.c
++++ b/ui/egl-helpers.c
+@@ -505,7 +505,7 @@ static int qemu_egl_init_dpy_platform(EGLNativeDisplayType native,
+         PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplayEXT =
+             (void *) eglGetProcAddress("eglGetPlatformDisplayEXT");
+         if (getPlatformDisplayEXT && platform != 0) {
+-            dpy = getPlatformDisplayEXT(platform, native, NULL);
++            dpy = getPlatformDisplayEXT(platform, (void *)native, NULL);
+         }
+     }
+ 
+@@ -526,7 +526,7 @@ static int qemu_egl_init_dpy_platform(EGLNativeDisplayType native,
+ 
+ int qemu_egl_init_dpy_surfaceless(DisplayGLMode mode)
+ {
+-    return qemu_egl_init_dpy_platform(NULL, EGL_PLATFORM_SURFACELESS_MESA, mode);
++    return qemu_egl_init_dpy_platform(EGL_DEFAULT_DISPLAY, EGL_PLATFORM_SURFACELESS_MESA, mode);
+ }
+ 
+ #if defined(CONFIG_X11) || defined(CONFIG_GBM)
+@@ -555,7 +555,7 @@ int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode)
+ 
+ int qemu_egl_init_dpy_angle(DisplayGLMode mode)
+ {
+-    return qemu_egl_init_dpy_platform(NULL, EGL_PLATFORM_ANGLE_ANGLE, mode);
++    return qemu_egl_init_dpy_platform(EGL_DEFAULT_DISPLAY, EGL_PLATFORM_ANGLE_ANGLE, mode);
+ }
+ 
+ #endif
+-- 
+2.41.0
+

+ 1 - 1
patches/sources

@@ -6,7 +6,7 @@ PKG_CONFIG_SRC="https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar
 # Source files for qemu
 FFI_SRC="https://sourceware.org/ftp/libffi/libffi-3.3.tar.gz"
 ICONV_SRC="https://ftp.gnu.org/gnu/libiconv/libiconv-1.16.tar.gz"
-GETTEXT_SRC="https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.gz"
+GETTEXT_SRC="https://ftp.gnu.org/gnu/gettext/gettext-0.22.5.tar.gz"
 PNG_SRC="https://ftp.osuosl.org/pub/blfs/conglomeration/libpng/libpng-1.6.37.tar.xz"
 JPEG_TURBO_SRC="https://ftp.osuosl.org/pub/blfs/conglomeration/libjpeg-turbo/libjpeg-turbo-1.5.3.tar.gz"
 GLIB_SRC="https://download.gnome.org/sources/glib/2.69/glib-2.69.0.tar.xz"

+ 1 - 1
scripts/build_dependencies.sh

@@ -760,7 +760,7 @@ export STRIP
 export PREFIX
 
 # Flags
-CFLAGS="$CFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -F$PREFIX/Frameworks $CFLAGS_MINVER $CFLAGS_TARGET -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion"
+CFLAGS="$CFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -F$PREFIX/Frameworks $CFLAGS_MINVER $CFLAGS_TARGET"
 CPPFLAGS="$CPPFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -F$PREFIX/Frameworks $CFLAGS_MINVER $CFLAGS_TARGET"
 CXXFLAGS="$CXXFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -F$PREFIX/Frameworks $CFLAGS_MINVER $CFLAGS_TARGET"
 OBJCFLAGS="$OBJCFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -F$PREFIX/Frameworks $CFLAGS_MINVER $CFLAGS_TARGET"