[pixman] fix build on M1 macs (#22854)

This commit is contained in:
autoantwort 2022-02-01 20:57:44 +01:00 committed by GitHub
parent 53e50bc9ee
commit 0a9e204dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 119 additions and 3 deletions

View File

@ -0,0 +1,108 @@
diff --git a/meson.build b/meson.build
index 1cec227..1b07ca8 100644
--- a/meson.build
+++ b/meson.build
@@ -95,44 +95,7 @@ else
mmx_flags = ['-mmmx', '-Winline']
endif
if not use_mmx.disabled()
- if host_machine.cpu_family() == 'x86_64' or cc.get_id() == 'msvc'
- have_mmx = true
- elif host_machine.cpu_family() == 'x86' and cc.compiles('''
- #include <mmintrin.h>
- #include <stdint.h>
-
- /* Check support for block expressions */
- #define _mm_shuffle_pi16(A, N) \
- ({ \
- __m64 ret; \
- \
- /* Some versions of clang will choke on K */ \
- asm ("pshufw %2, %1, %0\n\t" \
- : "=y" (ret) \
- : "y" (A), "K" ((const int8_t)N) \
- ); \
- \
- ret; \
- })
-
- int main () {
- __m64 v = _mm_cvtsi32_si64 (1);
- __m64 w;
-
- w = _mm_shuffle_pi16(v, 5);
-
- /* Some versions of clang will choke on this */
- asm ("pmulhuw %1, %0\n\t"
- : "+y" (w)
- : "y" (v)
- );
-
- return _mm_cvtsi64_si32 (v);
- }''',
- args : mmx_flags,
- name : 'MMX Intrinsic Support')
- have_mmx = true
- endif
+ have_mmx = true
endif
if have_mmx
@@ -154,29 +117,7 @@ elif cc.get_id() != 'msvc'
sse2_flags = ['-msse2', '-Winline']
endif
if not use_sse2.disabled()
- if host_machine.cpu_family() == 'x86'
- if cc.compiles('''
- #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
- # if !defined(__amd64__) && !defined(__x86_64__)
- # error "Need GCC >= 4.2 for SSE2 intrinsics on x86"
- # endif
- #endif
- #include <mmintrin.h>
- #include <xmmintrin.h>
- #include <emmintrin.h>
- int param;
- int main () {
- __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
- c = _mm_xor_si128 (a, b);
- return _mm_cvtsi128_si32(c);
- }''',
- args : sse2_flags,
- name : 'SSE2 Intrinsic Support')
- have_sse2 = true
- endif
- elif host_machine.cpu_family() == 'x86_64'
- have_sse2 = true
- endif
+ have_sse2 = true
endif
if have_sse2
@@ -192,24 +133,8 @@ if cc.get_id() != 'msvc'
ssse3_flags = ['-mssse3', '-Winline']
endif
-# x64 pre-2010 MSVC compilers crashes when building the ssse3 code
-if not use_ssse3.disabled() and not (cc.get_id() == 'msvc' and cc.version().version_compare('<16') and host_machine.cpu_family() == 'x86_64')
- if host_machine.cpu_family().startswith('x86')
- if cc.compiles('''
- #include <mmintrin.h>
- #include <xmmintrin.h>
- #include <emmintrin.h>
- int param;
- int main () {
- __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
- c = _mm_xor_si128 (a, b);
- return _mm_cvtsi128_si32(c);
- }''',
- args : ssse3_flags,
- name : 'SSSE3 Intrinsic Support')
- have_ssse3 = true
- endif
- endif
+if use_ssse3.enabled()
+ have_ssse3 = true
endif
if have_ssse3

View File

@ -39,7 +39,9 @@ vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE} ARCHIVE ${ARCHIVE}
REF ${PIXMAN_VERSION} REF ${PIXMAN_VERSION}
PATCHES remove_test_demos.patch PATCHES
remove_test_demos.patch
no-host-cpu-checks.patch
) )
# Meson install wrongly pkgconfig file! # Meson install wrongly pkgconfig file!
vcpkg_configure_meson( vcpkg_configure_meson(

View File

@ -1,9 +1,10 @@
{ {
"name": "pixman", "name": "pixman",
"version": "0.40.0", "version": "0.40.0",
"port-version": 1, "port-version": 2,
"description": "Pixman is a low-level software library for pixel manipulation, providing features such as image compositing and trapezoid rasterization.", "description": "Pixman is a low-level software library for pixel manipulation, providing features such as image compositing and trapezoid rasterization.",
"homepage": "https://www.cairographics.org/releases", "homepage": "https://www.cairographics.org/releases",
"license": "MIT",
"dependencies": [ "dependencies": [
"libpng", "libpng",
{ {

View File

@ -5314,7 +5314,7 @@
}, },
"pixman": { "pixman": {
"baseline": "0.40.0", "baseline": "0.40.0",
"port-version": 1 "port-version": 2
}, },
"pkgconf": { "pkgconf": {
"baseline": "1.8.0", "baseline": "1.8.0",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "85d5aa0bbd91cff8853d0767bc9dc73e97156291",
"version": "0.40.0",
"port-version": 2
},
{ {
"git-tree": "c2dd7fec404954b43ad0da4ee86c29a4cfdd8fc1", "git-tree": "c2dd7fec404954b43ad0da4ee86c29a4cfdd8fc1",
"version": "0.40.0", "version": "0.40.0",