From nobody Thu Dec 23 22:32:38 2021 X-Original-To: dev-commits-ports-main@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 24319190A006; Thu, 23 Dec 2021 22:32:39 +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 4JKlLt6BQfz4tg2; Thu, 23 Dec 2021 22:32:38 +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 B50D4190DA; Thu, 23 Dec 2021 22:32:38 +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 1BNMWcZ4017733; Thu, 23 Dec 2021 22:32:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BNMWcgX017732; Thu, 23 Dec 2021 22:32:38 GMT (envelope-from git) Date: Thu, 23 Dec 2021 22:32:38 GMT Message-Id: <202112232232.1BNMWcgX017732@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: 006829bcdc99 - main - math/primecount: fix build on big-endian List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org 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: 006829bcdc99fde7f9281eb9fb9c680ff986467c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640298758; 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=dfRWaygkOMyLH8rYWy7k7uoXEe/WeoMj0ZwTo2vPY/Q=; b=OjMislZlM1+26rZ5R6xuOHS15BTZAexym7vCc4HiE1ZAlUqwRaoolyylb9BoblMjhvKvyG NW2GLePqE19HeyyxG0iK6WeKDfQAIRCoPp7DVnNvbOV95v1raBIodwWCacuEavjx6XY3JX fUedp0xxN+qrBtHbO1Xbr/YPVLvOesXWzM+DhHAgGIH3l37Xj88J30JKaZ67gPaKTkQmJR As2FG7DjVVemO4hRbm+N9YGNbQBoRhQEg76E1QUZ3Q2sU1BvTmc91+JbohJVDgcpgkPWW3 HzNd8JQskSNm7iEzLnmtp2hKnY16+RipAMkE8jImsOkvf24/ssiVTcxo5Q6X2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640298758; a=rsa-sha256; cv=none; b=Zpx/nJreEiWCt4pZ8ed+R6hlnu88zqtQ8xgWTY4h4KeAAoZdRfCKp7BpnToB04d5tfUpaH xwdwojSs6/+tU17koznSV3TweVkB3vX/+kg1Faj21+bEwQFQvMiQs0S024AUYFc8bYSEu6 YPjkrfHq807VkyM/O3YqVA40Kq46a/3ypYFZMYEH2zQa6FtlMd37/XnNRhLTFlI657LOdP gg9j6I+0hN5oMVvagjDjMHPetrpou4iOIbFX88caQq3KF8BW8hjLlahZW31gFIBBi3J5Q0 40GnRp/7d9dagaUODusS6tuFUTxUwdRw4KwU+IyR2Le02gd2f5qXnfOl7lzQTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=006829bcdc99fde7f9281eb9fb9c680ff986467c commit 006829bcdc99fde7f9281eb9fb9c680ff986467c Author: Piotr Kubaj AuthorDate: 2021-12-23 22:25:49 +0000 Commit: Piotr Kubaj CommitDate: 2021-12-23 22:25:49 +0000 math/primecount: fix build on big-endian /usr/bin/c++ -DENABLE_DIV32 -Dlibprimecount_EXPORTS -I/wrkdirs/usr/ports/math/primecount/work/primecount-7.2/include -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -MD -MT CMakeFiles/libprimecount.dir/src/Sieve.cpp.o -MF CMakeFiles/libprimecount.dir/src/Sieve.cpp.o.d -o CMakeFiles/libprimecount.dir/src/Sieve.cpp.o -c /wrkdirs/usr/ports/math/primecount/work/primecount-7.2/src/Sieve.cpp In file included from /wrkdirs/usr/ports/math/primecount/work/primecount-7.2/src/Sieve.cpp:38: /wrkdirs/usr/ports/math/primecount/work/primecount-7.2/include/SieveTables.hpp:63:40: error: too many arguments provided to function-like macro invocation constexpr uint64_t bswap64(uint64_t i, uint64_t j = 0, uint64_t n = 0) ^ /usr/include/sys/endian.h:63:9: note: macro 'bswap64' defined here ^ In file included from /wrkdirs/usr/ports/math/primecount/work/primecount-7.2/src/Sieve.cpp:38: /wrkdirs/usr/ports/math/primecount/work/primecount-7.2/include/SieveTables.hpp:65:3: error: expected expression return (n == sizeof(uint64_t)) ? j : ^ /wrkdirs/usr/ports/math/primecount/work/primecount-7.2/include/SieveTables.hpp:66:21: error: too many arguments provided to function-like macro invocation bswap64(i >> 8, (j << 8) | (i & 0xff), n + 1); ^ /usr/include/sys/endian.h:63:9: note: macro 'bswap64' defined here ^ In file included from /wrkdirs/usr/ports/math/primecount/work/primecount-7.2/src/Sieve.cpp:38: /wrkdirs/usr/ports/math/primecount/work/primecount-7.2/include/SieveTables.hpp:67:2: error: expected ';' after top level declarator } ^ ; 4 errors generated. --- .../primecount/files/patch-include_SieveTables.hpp | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/math/primecount/files/patch-include_SieveTables.hpp b/math/primecount/files/patch-include_SieveTables.hpp new file mode 100644 index 000000000000..4dd773f4b179 --- /dev/null +++ b/math/primecount/files/patch-include_SieveTables.hpp @@ -0,0 +1,29 @@ +--- include/SieveTables.hpp.orig 2021-12-20 20:37:55 UTC ++++ include/SieveTables.hpp +@@ -60,22 +60,22 @@ constexpr int right_shift(int n) + /// on big endian CPU architectures. + + /// Reverse byte order of 64-bit integer +-constexpr uint64_t bswap64(uint64_t i, uint64_t j = 0, uint64_t n = 0) ++constexpr uint64_t bswap_64(uint64_t i, uint64_t j = 0, uint64_t n = 0) + { + return (n == sizeof(uint64_t)) ? j : +- bswap64(i >> 8, (j << 8) | (i & 0xff), n + 1); ++ bswap_64(i >> 8, (j << 8) | (i & 0xff), n + 1); + } + + /// Bitmask to unset bits <= n + constexpr uint64_t unset_s(int n) + { +- return bswap64(~0ull << left_shift(n)); ++ return bswap_64(~0ull << left_shift(n)); + } + + /// Bitmask to unset bits >= n + constexpr uint64_t unset_l(int n) + { +- return bswap64((n == 0) ? 0 : ~0ull >> right_shift(n)); ++ return bswap_64((n == 0) ? 0 : ~0ull >> right_shift(n)); + } + + #else