From owner-dev-commits-ports-main@freebsd.org Tue Sep 21 21:50:03 2021 Return-Path: Delivered-To: dev-commits-ports-main@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 9166267BF9B; Tue, 21 Sep 2021 21:50:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HDZpg3TVWz4f8v; Tue, 21 Sep 2021 21:50:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 590EB39E4; Tue, 21 Sep 2021 21:50:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18LLo3Aq084290; Tue, 21 Sep 2021 21:50:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LLo3f8084286; Tue, 21 Sep 2021 21:50:03 GMT (envelope-from git) Date: Tue, 21 Sep 2021 21:50:03 GMT Message-Id: <202109212150.18LLo3f8084286@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Piotr Kubaj Subject: git: ece0c9bb0690 - main - devel/sdl20: correctly detect altivec MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ece0c9bb0690863596198c80180dcc702a066ad2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2021 21:50:03 -0000 The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=ece0c9bb0690863596198c80180dcc702a066ad2 commit ece0c9bb0690863596198c80180dcc702a066ad2 Author: Piotr Kubaj AuthorDate: 2021-09-21 21:47:46 +0000 Commit: Piotr Kubaj CommitDate: 2021-09-21 21:47:46 +0000 devel/sdl20: correctly detect altivec The previous patch was not correct. Already upstreamed. --- devel/sdl20/Makefile | 2 +- devel/sdl20/files/patch-src_cpuinfo_SDL__cpuinfo.c | 47 +++++++++++++--------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/devel/sdl20/Makefile b/devel/sdl20/Makefile index 49bf21ccedf0..057f1ca9480b 100644 --- a/devel/sdl20/Makefile +++ b/devel/sdl20/Makefile @@ -1,6 +1,6 @@ PORTNAME= sdl2 PORTVERSION= 2.0.12 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= devel MASTER_SITES= https://www.libsdl.org/release/ DISTNAME= SDL2-${PORTVERSION} diff --git a/devel/sdl20/files/patch-src_cpuinfo_SDL__cpuinfo.c b/devel/sdl20/files/patch-src_cpuinfo_SDL__cpuinfo.c index 7bb8d70d47de..d46b4673236f 100644 --- a/devel/sdl20/files/patch-src_cpuinfo_SDL__cpuinfo.c +++ b/devel/sdl20/files/patch-src_cpuinfo_SDL__cpuinfo.c @@ -1,24 +1,33 @@ --- src/cpuinfo/SDL_cpuinfo.c.orig 2020-03-11 01:36:18 UTC +++ src/cpuinfo/SDL_cpuinfo.c -@@ -49,7 +49,7 @@ - #endif - #if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__)) - #include /* For AltiVec check */ --#elif defined(__OpenBSD__) && defined(__powerpc__) -+#elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__powerpc__) +@@ -53,6 +53,9 @@ #include #include /* For AltiVec check */ #include -@@ -314,9 +314,11 @@ CPU_haveAltiVec(void) - { - volatile int altivec = 0; - #ifndef SDL_CPUINFO_DISABLED --#if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__)) -+#if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__)) || (defined(__FreeBSD__) && defined(__powerpc__)) - #ifdef __OpenBSD__ - int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC }; -+#elif __FreeBSD__ -+ int selectors[2] = { CTL_HW, PPC_FEATURE_HAS_ALTIVEC }; - #else - int selectors[2] = { CTL_HW, HW_VECTORUNIT }; - #endif ++#elif defined(__FreeBSD__) && defined(__powerpc__) ++#include ++#include + #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP + #include + #include +@@ -110,7 +113,7 @@ + #define CPU_HAS_AVX512F (1 << 12) + #define CPU_HAS_ARM_SIMD (1 << 13) + +-#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__ && !__OpenBSD__ ++#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__ && !__OpenBSD__ && !__FreeBSD__ + /* This is the brute force way of detecting instruction sets... + the idea is borrowed from the libmpeg2 library - thanks! + */ +@@ -325,6 +328,11 @@ CPU_haveAltiVec(void) + int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); + if (0 == error) + altivec = (hasVectorUnit != 0); ++#elif defined(__FreeBSD__) && defined(__powerpc__) ++ unsigned long cpufeatures; ++ elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures)); ++ altivec = cpufeatures & PPC_FEATURE_HAS_ALTIVEC; ++ return altivec; + #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP + void (*handler) (int sig); + handler = signal(SIGILL, illegal_instruction);