From nobody Tue Dec 06 03:51:53 2022 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 4NR6161RQHz4jbbh; Tue, 6 Dec 2022 03:51:54 +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 4NR6156ylJz3Jtd; Tue, 6 Dec 2022 03:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670298714; 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=g530s04PHnbcY96hU3BNrRabX9/Xmbd91pPi8/ove5M=; b=DvDiO9FrsgEQV/7pxOSMktvhx/Mu/lq307JEwS12zBXOm6tX0kY1hxp5t8eEtGw8bqrSHa SbAMW8Zv5WQPKkUB1AA7W5NtKwJkQAom/ut1QgwWMgy1VcrdFRYi8IZV1U1kgGPIsgzEAi my+IRgl5jwucNYov+y9Z5+RKkCkFN1fdf1ZFW38R1R/slhy1KBmWB7C8p43pDK1ucQ6J48 32jINAVt1+0P7K1B+7cp56+xj5PjTdd0xPdH9lW6vx5SVVQ4sjxlAiUO8N5ZmVeQiaTjpD 7KN9uqgGOJyZPNdzVJKeYCl4HpL3ty8FPceKtrZeuEVxd5Ng9qQvwsBgjfIeVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670298714; 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=g530s04PHnbcY96hU3BNrRabX9/Xmbd91pPi8/ove5M=; b=sEzfpV514LoXnaIlUFWSE7IbX5OTanZ5omTJNKVtYmRY7WOWj+abVvD86fSuyTv0Wu+XWr rUccj5xbfPWWzlOINpkxo9gu8KvfpzSWDzfHIElNAlknu2Bt/qaaA2MKv9Ada4UnJZKnS7 zx/CUk6bZdwnFEG6AjiZPT3I0fa0fth4L04J5ibff0LOyMimUbkZ3pwLrJnOLSHAXq7PxH pG4qpnE4cE9XVoXir04Kp4D2quKnEGK35Me8Rr5q6dyDVMAmL1eYD61PrNcf5BNTt8OxWT AciIZgGZLLob+r9XIyvcKv5EiyYAWMikrhgGP6UZqL6KAplwLp3VRP/UrtOeqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670298714; a=rsa-sha256; cv=none; b=JeGmRfIGCOt41K/MmpYypTxpw0tvvRBoQF8dIIyaxG3mtWOzvPsv/2559S2qQk9ahN76Lw +hOuzZpOLVdXRKRsiFXat/a4dWETDizArdl+hwnQacLff6QpznGGGOF4/ClEapwhlABpCK 2JDzUzpJV1sY2wymJA9wwL/ZccYp2ZucAvAnShlZvZ78QwOLYZgGPr42AxDKgsBkECxeHv W/ZU+GQzMG0LuxGrzGIP9aDsPygr6NbATiIagwHXLWxEucJN3wUlAiANAsAKxwvM70C/+z HDLNK/FJ9osJjCWG7jEd9YodfJffCUbIXcFL1o31ngXdH9XfiFsndLIyUxUilg== 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 4NR6156413zNXR; Tue, 6 Dec 2022 03:51:53 +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 2B63prEH006439; Tue, 6 Dec 2022 03:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B63prfA006438; Tue, 6 Dec 2022 03:51:53 GMT (envelope-from git) Date: Tue, 6 Dec 2022 03:51:53 GMT Message-Id: <202212060351.2B63prfA006438@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: df3e7be9ffee - main - security/palisade: fix build on powerpc64* and libomp-less architectures 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: df3e7be9ffeecd571a41bdc1ed08c41ed062fffc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=df3e7be9ffeecd571a41bdc1ed08c41ed062fffc commit df3e7be9ffeecd571a41bdc1ed08c41ed062fffc Author: Piotr Kubaj AuthorDate: 2022-12-06 03:51:49 +0000 Commit: Piotr Kubaj CommitDate: 2022-12-06 03:51:49 +0000 security/palisade: fix build on powerpc64* and libomp-less architectures --- security/palisade/Makefile | 7 ++----- ...atch-src_core_include_math_bigintnat_ubintnat.h | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/security/palisade/Makefile b/security/palisade/Makefile index 0d923f077abc..80b7ad07804a 100644 --- a/security/palisade/Makefile +++ b/security/palisade/Makefile @@ -11,11 +11,6 @@ LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE BROKEN_i386= fails to build: a declaration of 'Mul128' must be available -BROKEN_powerpc64= fails to build: math/native_int/binint.h:510:11: error: Architecture not supported for MultD() -BROKEN_riscv64= fails to build: math/bigintnat/ubintnat.h:2250:2: error: Architecture not supported for MultD() -.if !exists(/usr/include/omp.h) -BROKEN= requires OpenMP support that is missing on this architecture -.endif BUILD_DEPENDS= autoconf:devel/autoconf # possibly a mistake in the project @@ -43,7 +38,9 @@ BINARY_ALIAS= git=false LDFLAGS+= -pthread # only for tests: see https://gitlab.com/palisade/palisade-release/-/issues/23 OPTIONS_DEFINE= OPENMP HEXL +.if exists(/usr/include/omp.h) OPTIONS_DEFAULT= OPENMP +.endif HEXL_DESC= Use Intel Hexl Library diff --git a/security/palisade/files/patch-src_core_include_math_bigintnat_ubintnat.h b/security/palisade/files/patch-src_core_include_math_bigintnat_ubintnat.h new file mode 100644 index 000000000000..8f02234b7e17 --- /dev/null +++ b/security/palisade/files/patch-src_core_include_math_bigintnat_ubintnat.h @@ -0,0 +1,22 @@ +--- src/core/include/math/bigintnat/ubintnat.h.orig 2022-01-28 23:16:29 UTC ++++ src/core/include/math/bigintnat/ubintnat.h +@@ -2218,12 +2218,17 @@ class NativeIntegerT + res.lo = x.lo * y; + asm("umulh %0, %1, %2\n\t" : "=r"(res.hi) : "r"(x.lo), "r"(y)); + res.hi += x.hi * y; +-#elif defined(__arm__) // 32 bit processor ++#elif defined(__powerpc64__) || defined(__riscv) ++ U128BITS wres(0), wa(a), wb(b); ++ wres = wa * wb; // should give us 128 bits of 64 * 64 ++ res.hi = (uint64_t)(wres >> 64); ++ res.lo = (uint64_t)wres; ++#elif defined(__arm__) || defined(__powerpc__) // 32 bit processor + uint64_t wres(0), wa(a), wb(b); + + wres = wa * wb; // should give us the lower 64 bits of 32*32 + res.hi = wres >> 32; +- res.lo = (uint32_t)wres && 0xFFFFFFFF; ++ res.lo = (uint32_t)wres & 0xFFFFFFFF; + #elif defined(__EMSCRIPTEN__) // web assembly + U64BITS a1 = a >> 32; + U64BITS a2 = (uint32_t)a;