From nobody Tue Oct 12 19:07:01 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 BB9B012DB75D; Tue, 12 Oct 2021 19:07: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 4HTQBt0z30z4Wn6; Tue, 12 Oct 2021 19:07:01 +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 6985819E82; Tue, 12 Oct 2021 19:07:01 +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 19CJ713U020134; Tue, 12 Oct 2021 19:07:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CJ71ha020133; Tue, 12 Oct 2021 19:07:01 GMT (envelope-from git) Date: Tue, 12 Oct 2021 19:07:01 GMT Message-Id: <202110121907.19CJ71ha020133@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: 53404616ab64 - main - math/cado-nfs: fix build on non-amd64 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: 53404616ab6462d01f7aa5e9d252e9df855f5ed0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=53404616ab6462d01f7aa5e9d252e9df855f5ed0 commit 53404616ab6462d01f7aa5e9d252e9df855f5ed0 Author: Piotr Kubaj AuthorDate: 2021-10-12 18:37:12 +0000 Commit: Piotr Kubaj CommitDate: 2021-10-12 18:37:12 +0000 math/cado-nfs: fix build on non-amd64 lingen_pz is installed only on amd64. While here, rework endianness detection, since the current method uses plain list of architectures. Since powerpc64le is little endian and POWER as whole is set up in cado-endian.h as big-endian, it will result in runtime issues. --- math/cado-nfs/Makefile | 9 ++++- math/cado-nfs/files/patch-utils_cado-endian.h | 53 +++++++++++++++++++++++++++ math/cado-nfs/pkg-plist | 2 +- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/math/cado-nfs/Makefile b/math/cado-nfs/Makefile index 3c83cb3611e4..56e6d775224f 100644 --- a/math/cado-nfs/Makefile +++ b/math/cado-nfs/Makefile @@ -9,7 +9,6 @@ COMMENT= Implementation of the Number Field Sieve Algorithm LICENSE= LGPL21 LICENSE_FILE= ${WRKSRC}/COPYING -BROKEN_i386= pkg-static: Unable to access file /wrkdirs/usr/ports/math/cado-nfs/work/stage/usr/local/lib/cado-nfs-3.0.0/linalg/bwc/lingen_pz:No such file or directory CONFLICTS_BUILD= libfmt # bundled libfmt conflicts with package-installed headers BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ @@ -33,4 +32,12 @@ TEST_TARGET= check # 'test' does the same but is less verbose BINARY_ALIAS= python3=${PYTHON_CMD} make=${GMAKE} +.include + +.if ${ARCH} == amd64 +PLIST_SUB= LINGEN_PZ="" +.else +PLIST_SUB= LINGEN_PZ="@comment " +.endif + .include diff --git a/math/cado-nfs/files/patch-utils_cado-endian.h b/math/cado-nfs/files/patch-utils_cado-endian.h new file mode 100644 index 000000000000..b29617f00ec2 --- /dev/null +++ b/math/cado-nfs/files/patch-utils_cado-endian.h @@ -0,0 +1,53 @@ +--- utils/cado-endian.h.orig 2021-09-16 01:25:08 UTC ++++ utils/cado-endian.h +@@ -27,20 +27,16 @@ + + // pragma no prototypes + +-#ifdef HAVE_GLIBC +-// GNU libc offers the helpful header which defines +-// __BYTE_ORDER +-# include +-# if (__BYTE_ORDER == __LITTLE_ENDIAN) ++# if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) + # define CADO_LITTLE_ENDIAN +-# elif (__BYTE_ORDER == __BIG_ENDIAN) ++# elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + # define CADO_BIG_ENDIAN +-# elif (__BYTE_ORDER == __PDP_ENDIAN) ++# elif (__BYTE_ORDER__ == __PDP_ENDIAN) + # define CADO_PDP_ENDIAN + # else + # error Unknown machine endianness detected. + # endif +-# define CADO_BYTE_ORDER __BYTE_ORDER ++# define CADO_BYTE_ORDER __BYTE_ORDER__ + /* There is no serious reason to think that _BIG_ENDIAN or _LITTLE_ENDIAN + * being defined actually means that the machine is big (resp, little) + * endian. Systems may like to unconditionally define these as constants +@@ -54,25 +50,4 @@ + # define CADO_LITTLE_ENDIAN + # define CADO_BYTE_ORDER 1234 + */ +-#elif defined(__sparc) || defined(__sparc__) \ +- || defined(_POWER) || defined(__powerpc__) \ +- || defined(__ppc__) || defined(__hpux) \ +- || defined(_MIPSEB) || defined(_POWER) \ +- || defined(__AARCH64EB__) \ +- || defined(__s390__) +-# define CADO_BIG_ENDIAN +-# define CADO_BYTE_ORDER 4321 +-#elif defined(__i386__) || defined(__alpha__) \ +- || defined(__ia64) || defined(__ia64__) \ +- || defined(_M_IX86) || defined(_M_IA64) \ +- || defined(_M_ALPHA) || defined(__amd64) \ +- || defined(__amd64__) || defined(_M_AMD64) \ +- || defined(__x86_64) || defined(__x86_64__) \ +- || defined(__AARCH64EL__) \ +- || defined(_M_X64) +-# define CADO_LITTLE_ENDIAN +-# define CADO_BYTE_ORDER 1234 +-#else +-# error The file cado-endian.h needs to be set up for your CPU type. +-#endif + #endif diff --git a/math/cado-nfs/pkg-plist b/math/cado-nfs/pkg-plist index 5b9de5438134..f0dfa47d72c3 100644 --- a/math/cado-nfs/pkg-plist +++ b/math/cado-nfs/pkg-plist @@ -18,7 +18,7 @@ lib/cado-nfs-3.0.0/linalg/bwc/cleanup lib/cado-nfs-3.0.0/linalg/bwc/dispatch lib/cado-nfs-3.0.0/linalg/bwc/gather lib/cado-nfs-3.0.0/linalg/bwc/krylov -lib/cado-nfs-3.0.0/linalg/bwc/lingen_pz +%%LINGEN_PZ%%lib/cado-nfs-3.0.0/linalg/bwc/lingen_pz lib/cado-nfs-3.0.0/linalg/bwc/lingen_u64k1 lib/cado-nfs-3.0.0/linalg/bwc/mf_bal lib/cado-nfs-3.0.0/linalg/bwc/mksol