From nobody Thu May 25 09:44:03 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRjn04YRWz4TGtp; Thu, 25 May 2023 09:44:04 +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 4QRjmz4Jcbz3kW2; Thu, 25 May 2023 09:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685007843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mWv+kyvkdNOAEg7o6AwRm7MXLLL5Jy+djyNG8+Nt2RQ=; b=VguNUfc8Qx8gphxHGMaqJIGJfCQN6ISQ4a6IVEkETyT99iT0O6uL7aGqB2YUAgaG2+jW+h ufzOnWdy+w9+hhlguc6+QFZS/FjwTVMW7oseQqDdwylUzBBvSFOb1PvZAzddWlIMECP5Vh rvxuiSEztcKOsMS0gHj/Axi7jY6fy/BhS26QDoF4M7GbJKPQHJyItt/hAUcEODwrpQWFUQ ld7qeeOZ7+fsFFwSA1AtuUPOEq/zH+4DF29JrQmaJnCTSPXxM69CIyjLWhRR/Wv63XZ8tz O2EBqQai0+F8thFCuYrKXU/V0Ry+nLLA7JpwdWHIA/M8SQpBWGB4M8jHVkQjRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685007843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mWv+kyvkdNOAEg7o6AwRm7MXLLL5Jy+djyNG8+Nt2RQ=; b=eK7CLy97mbRKbcqSInIO1brjs4hqm9l3V4phJLvdzERRX7gCMsHE0Mauqx4LnSdvMP/b5R UAWQ0Lp4vQOzd+4ElhdmckNvnYg+v0IW2HTKOYFdOSvf07YwTcepdXVuamqwOaKfcCI32v YykrroypxjGekOa98+gH/solLw+Vjwqol+0oFBii2IyPzpt3lxVv/90jb/I6O+YgxaQHEM 8Jq6VpoLYXhpW1Nk+mgRAaFEoy4khgmeZvjGo/OSLjX9XmI4ZnZmj6vTtR4K6NokdOH5YQ 9XNVcHwrgcSL98sOGe8OT+Kyv60Ee3P1o1YXnone67n3fu56w3pRkWqf9Mt1rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685007843; a=rsa-sha256; cv=none; b=KvzA8pdVLCwWM60ZHzJ96OO9Vhe1/CzTwgFHIwjBbK7H2yXDqfpTG+N/cQ+r6mmUb7Ho9L lqQrmM2Dv9VYLAITHeNPsOjomFQo0Ys/oUzP/6u90HG2dQ8LylFf75iuZOly+cOqyM3FxO P3CI6TbauzwwX9SJrhQPgJ84/oIoE/NgiQuDNt0wMicFPfRHMwZiXy1u9/1KgqGUtbmPhi OFhA2WvHQzHUZWKa4nQ6792Lvk0+D2d0YZbCCtQvMgyOk2fENI4gr/lHhDJ+Jn559yS/d1 MoTas7WqHPdj4jSjD5IOiAF7bYMY22hDJ5BsPK90uE1jiJF0i13DTT4amAQfcw== 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 4QRjmz2m0zzKR3; Thu, 25 May 2023 09:44: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 34P9i37p001184; Thu, 25 May 2023 09:44:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P9i3CN001183; Thu, 25 May 2023 09:44:03 GMT (envelope-from git) Date: Thu, 25 May 2023 09:44:03 GMT Message-Id: <202305250944.34P9i3CN001183@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: 2313549e74be - main - devel/corrade: fix build on aarch64, missing FreeBSD code List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2313549e74bebb854ba9f5088fc9d883ea6a6545 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=2313549e74bebb854ba9f5088fc9d883ea6a6545 commit 2313549e74bebb854ba9f5088fc9d883ea6a6545 Author: Robert Clausecker AuthorDate: 2023-05-22 12:33:20 +0000 Commit: Robert Clausecker CommitDate: 2023-05-25 09:39:32 +0000 devel/corrade: fix build on aarch64, missing FreeBSD code - add CPU detection code for armv7, aarch64 (armv7 is still broken for other reasons) - add missing FreeBSD support code for executableLocation() - hook up test suite See also: https://github.com/mosra/corrade/issues/171 Approved by: yuri (maintainer) Differential Revision: https://reviews.freebsd.org/D40202 --- devel/corrade/Makefile | 5 ++- devel/corrade/files/patch-src_Corrade_Cpu.cpp | 34 +++++++++++++++++++ devel/corrade/files/patch-src_Corrade_Cpu.h | 38 ++++++++++++++++++++++ .../files/patch-src_Corrade_Utility_Path.cpp | 33 +++++++++++++++++++ 4 files changed, 109 insertions(+), 1 deletion(-) diff --git a/devel/corrade/Makefile b/devel/corrade/Makefile index cd0cba4b7151..815f347cd220 100644 --- a/devel/corrade/Makefile +++ b/devel/corrade/Makefile @@ -11,7 +11,7 @@ WWW= https://magnum.graphics/corrade/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING -USES= cmake compiler:c++14-lang +USES= cmake:testing compiler:c++14-lang USE_LDCONFIG= yes USE_GITHUB= yes @@ -20,4 +20,7 @@ GH_TUPLE= mosra:toolchains:65568a9:toolchains/toolchains CMAKE_ARGS= -DLIB_SUFFIX:STRING="" +OPTIONS_DEFINE= TEST +TEST_CMAKE_BOOL= CORRADE_BUILD_TESTS + .include diff --git a/devel/corrade/files/patch-src_Corrade_Cpu.cpp b/devel/corrade/files/patch-src_Corrade_Cpu.cpp new file mode 100644 index 000000000000..aab22a1bb3fd --- /dev/null +++ b/devel/corrade/files/patch-src_Corrade_Cpu.cpp @@ -0,0 +1,34 @@ +--- src/Corrade/Cpu.cpp.orig 2023-05-22 11:59:16 UTC ++++ src/Corrade/Cpu.cpp +@@ -34,7 +34,7 @@ + /** @todo these are indented to work around acme.py extracting them to the top, + fix properly */ + /* getauxval() for ARM on Linux and Android with API level 18+ */ +-#if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) ++#if defined(CORRADE_TARGET_ARM) && (defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) || defined(__FreeBSD__)) + #include + /* sysctlbyname() for ARM on macOS / iOS */ + #elif defined(CORRADE_TARGET_ARM) && defined(CORRADE_TARGET_APPLE) +@@ -80,7 +80,7 @@ int appleSysctlByName(const char* name) { + } + #endif + +-#if defined(CORRADE_TARGET_ARM) && ((defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18)) || defined(CORRADE_TARGET_APPLE)) ++#if defined(CORRADE_TARGET_ARM) && ((defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18)) || defined(CORRADE_TARGET_APPLE) || defined(__FreeBSD__)) + Features runtimeFeatures() { + /* Use getauxval() on ARM on Linux and Android */ + #if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) +@@ -130,6 +130,13 @@ Features runtimeFeatures() { + /* No other (deinlined) implementation at the moment. The function should + not be even defined here in that case -- it's inlined in the header + instead, including the x86 implementation. */ ++ #elif defined(CORRADE_TARGET_ARM) && defined(__FreeBSD__) ++ /* use elf_aux_info() on ARM on FreeBSD */ ++ unsigned long hwcap = 0; ++ ++ elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); ++ ++ return Implementation::runtimeFeatures(hwcap); + #else + #error + #endif diff --git a/devel/corrade/files/patch-src_Corrade_Cpu.h b/devel/corrade/files/patch-src_Corrade_Cpu.h new file mode 100644 index 000000000000..7cb1c95f83db --- /dev/null +++ b/devel/corrade/files/patch-src_Corrade_Cpu.h @@ -0,0 +1,38 @@ +--- src/Corrade/Cpu.h.orig 2023-05-22 12:04:59 UTC ++++ src/Corrade/Cpu.h +@@ -1357,7 +1357,7 @@ equivalent: + */ + template constexpr T tag() { return T{Implementation::Init}; } + +-#if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) ++#if defined(CORRADE_TARGET_ARM) && (defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) || defined(__FreeBSD__)) + namespace Implementation { + /* Needed for a friend declaration, implementation is at the very end of + the header */ +@@ -1496,7 +1496,7 @@ class Features { + #endif + Features runtimeFeatures(); + #endif +- #if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) ++ #if defined(CORRADE_TARGET_ARM) && (defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) || defined(__FreeBSD__)) + friend Features Implementation::runtimeFeatures(unsigned long); + #endif + +@@ -1775,7 +1775,7 @@ value is equal to @ref Scalar, which in turn is equiva + default-constructed) @ref Features. + @see @ref DefaultBase, @ref DefaultExtra, @ref Default + */ +-#if (defined(CORRADE_TARGET_X86) && (defined(CORRADE_TARGET_MSVC) || defined(CORRADE_TARGET_GCC))) || (defined(CORRADE_TARGET_ARM) && ((defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18)) || defined(CORRADE_TARGET_APPLE))) || defined(DOXYGEN_GENERATING_OUTPUT) ++#if (defined(CORRADE_TARGET_X86) && (defined(CORRADE_TARGET_MSVC) || defined(CORRADE_TARGET_GCC))) || (defined(CORRADE_TARGET_ARM) && ((defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18)) || defined(CORRADE_TARGET_APPLE) || defined(__FreeBSD__))) || defined(DOXYGEN_GENERATING_OUTPUT) + #ifdef CORRADE_TARGET_ARM + CORRADE_UTILITY_EXPORT /* Inlined on x86 at the very end of the header */ + #endif +@@ -3214,7 +3214,7 @@ inline Features runtimeFeatures() { + /** @todo If AT_HWCAP2 or other bits are needed, it's passed to ifunc resolvers + only since glibc 2.30 (and Android API 30+, which is the same as before): + https://github.com/bminor/glibc/commit/2b8a3c86e7606cf1b0a997dad8af2d45ae8989c3 */ +-#if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) ++#if defined(CORRADE_TARGET_ARM) && (defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) || defined(__FreeBSD__)) + namespace Implementation { + inline Features runtimeFeatures(const unsigned long caps) { + unsigned int out = 0; diff --git a/devel/corrade/files/patch-src_Corrade_Utility_Path.cpp b/devel/corrade/files/patch-src_Corrade_Utility_Path.cpp new file mode 100644 index 000000000000..a60703fdb2b6 --- /dev/null +++ b/devel/corrade/files/patch-src_Corrade_Utility_Path.cpp @@ -0,0 +1,33 @@ +--- src/Corrade/Utility/Path.cpp.orig 2023-01-12 11:52:02 UTC ++++ src/Corrade/Utility/Path.cpp +@@ -89,6 +89,11 @@ + #include + #endif + ++#ifdef __FreeBSD__ ++#include ++#include ++#endif ++ + #include "Corrade/configure.h" + #include "Corrade/Containers/Array.h" + #include "Corrade/Containers/GrowableArray.h" +@@ -540,6 +545,18 @@ Containers::Optional executableLoc + /* hardcoded for Emscripten */ + #elif defined(CORRADE_TARGET_EMSCRIPTEN) + return Containers::String{"/app.js"_s}; ++ ++ #elif defined(__FreeBSD__) ++ Containers::Array path; ++ size_t size; ++ const int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; ++ ++ sysctl(mib, 4, nullptr, &size, NULL, 0); ++ arrayResize(path, NoInit, size + 1); ++ sysctl(mib, 4, path, &size, NULL, 0); ++ path[size] = '\0'; ++ const auto deleter = path.deleter(); ++ return Containers::String{path.release(), size, deleter}; + + /* Not implemented */ + #else