From nobody Sat Jan 08 21:23:55 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 3B64C192AA45; Sat, 8 Jan 2022 21:23:57 +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 4JWY4C59xxz4WRr; Sat, 8 Jan 2022 21:23:55 +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 6DDAF25FA0; Sat, 8 Jan 2022 21:23:55 +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 208LNtwp081587; Sat, 8 Jan 2022 21:23:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 208LNtZa081586; Sat, 8 Jan 2022 21:23:55 GMT (envelope-from git) Date: Sat, 8 Jan 2022 21:23:55 GMT Message-Id: <202201082123.208LNtZa081586@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: e083afb30dbf - main - devel/ispc: Add support for LLVM 13 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: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e083afb30dbfe0b9c2be4ff751d0f775e40b4638 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641677036; 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=ZyDY9GFI4VmUjUEl19bdiM5lXFOqhIZB7V8KB9nl6BU=; b=N+9f+uJvS8wFRLrqZZX7diMqgBQKuGAZ+TO1gnnO0RrLccKUeDn3lMZ1774IcL/NULHreS 4dNr8s8F2/iRiLIe6d7kmdG9kA9HryfCadf9L7yGDY3llpsEe5b8BN9JrL/FuhLvkq4VhX 4m+D4MHg8qgHl7/xtS5oqVVStzPnNiV4GK7EHTvJjPXi0zos9folGuMr1LvxWjSA/oe4Dr GZbEm2Oxjvq2QWgvRyO0kQQViCKlDfNy5f4aNYObRthgolJbxyjrBNW38TEhN6JtzHD+02 7gsARzSR6Rm75Ha+j+QJQJG2jcDR6tf5abUCvL54NB2qrv0+J+EOsuz6y/6zUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641677036; a=rsa-sha256; cv=none; b=BnXUosL2rdNAg75gThYJkkxakAzr2pbNzsT8SqohTWUsWvMbY7OQ0Ruk9pUEsc8eXnxP0a lIwT+iCI7cGncx6BaGlXK87rXjBQpvhSxZwnh1dM8RJRvfyYIsoI18QxNwQRMI09K9L2yu qvCsWxncQOaLkzmQiHdY/mM8XSmAe5yegpposX0ENPmB/JX+E+0pqdq3uLXOshtoLY5TYa WP3XrD0TlL3OmwZ36/2HlXxFgAwmJ6KZc5g6p/W2dOKcOvG/NBMIoPzq4mLJa9iNVIbQEC BmlMjDh64KliBt98Z+FwV+1YY5ZZfkSJuTO6KeDEy/0smxWyIgqsSbtUlcotkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=e083afb30dbfe0b9c2be4ff751d0f775e40b4638 commit e083afb30dbfe0b9c2be4ff751d0f775e40b4638 Author: Yuri Victorovich AuthorDate: 2022-01-08 21:20:49 +0000 Commit: Yuri Victorovich CommitDate: 2022-01-08 21:23:52 +0000 devel/ispc: Add support for LLVM 13 PR: 260976 Submitted by: VVD (original version) --- devel/ispc/Makefile | 14 ++++++++------ devel/ispc/files/patch-src_module.cpp | 14 ++++++++++++++ devel/ispc/files/patch-src_opt.cpp | 15 +++++++++++++++ 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/devel/ispc/Makefile b/devel/ispc/Makefile index 8bcfa95a296a..9008d20dd145 100644 --- a/devel/ispc/Makefile +++ b/devel/ispc/Makefile @@ -3,7 +3,7 @@ PORTNAME= ispc DISTVERSIONPREFIX= v DISTVERSION= 1.16.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MAINTAINER= yuri@FreeBSD.org @@ -23,11 +23,6 @@ USES= bison cmake compiler:c++14-lang python:build,test shebangfix USE_GITHUB= yes SHEBANG_FILES= *.py -#LLVM_VERSION= -devel # fails with 12: call to non-static member function without an object argument: llvm::DebugLoc::get - # Release notes https://github.com/ispc/ispc/blob/master/docs/ReleaseNotes.txt list compatible LLVM versions, but they assume that extra patches are applied to LLVM - # LLVM build script: https://github.com/ispc/ispc/blob/master/scripts/build.sh -LLVM_VERSION= 11 # it fails with -devel (13.0.d20210308), with 12.0.0.r2 it also fails, using 11 that it succeeds with - CONFIGURE_ENV= PATH=${LOCALBASE}/llvm${LLVM_VERSION}/bin:${PATH} CMAKE_OFF= ISPC_NO_DUMPS ISPC_INCLUDE_EXAMPLES @@ -59,6 +54,13 @@ GENX_PLIST_FILES= include/ispcrt/ispcrt.h \ lib/libispcrt.so.${PORTVERSION} \ lib/libispcrt_static.a +.include +.if ${LLVM_DEFAULT:M[7891]0} || ${LLVM_DEFAULT:M1[12]} # max(LLVM_DEFAULT,13) +LLVM_VERSION= 13 +.else +LLVM_VERSION= ${LLVM_DEFAULT} +.endif + do-test: # some tests fail: https://github.com/ispc/ispc/issues/1868 @cd ${WRKSRC} && ISPC_HOME=${BUILD_WRKSRC}/bin ./run_tests.py diff --git a/devel/ispc/files/patch-src_module.cpp b/devel/ispc/files/patch-src_module.cpp index 987c2fcb2fd6..06bfac61b41f 100644 --- a/devel/ispc/files/patch-src_module.cpp +++ b/devel/ispc/files/patch-src_module.cpp @@ -18,3 +18,17 @@ Opts.setSPIRVAllowUnknownIntrinsics({"llvm.genx"}); #else llvm::cl::opt SPIRVAllowUnknownIntrinsics( +@@ -1314,7 +1314,12 @@ bool Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine, llvm::Module *module, OutputType outputType, + llvm::CodeGenFileType fileType = (outputType == Object) ? llvm::CGFT_ObjectFile : llvm::CGFT_AssemblyFile; + bool binary = (fileType == llvm::CGFT_ObjectFile); + +- llvm::sys::fs::OpenFlags flags = binary ? llvm::sys::fs::F_None : llvm::sys::fs::F_Text; ++ llvm::sys::fs::OpenFlags flags = binary ? ++#if ISPC_LLVM_VERSION >= ISPC_LLVM_13_0 ++ llvm::sys::fs::OF_None : llvm::sys::fs::OF_Text; ++#else ++ llvm::sys::fs::F_None : llvm::sys::fs::F_Text; ++#endif + + std::error_code error; + diff --git a/devel/ispc/files/patch-src_opt.cpp b/devel/ispc/files/patch-src_opt.cpp index de3ecdcbd15f..3bf08c14a7d0 100644 --- a/devel/ispc/files/patch-src_opt.cpp +++ b/devel/ispc/files/patch-src_opt.cpp @@ -62,3 +62,18 @@ ISPC devs insist on using dump() functions which LLVM devs consider a debug func return true; } +@@ -4687,7 +4687,13 @@ void DebugPassFile::run(llvm::Module &module, bool init) + std::error_code EC; + char fname[100]; + snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str()); +- llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None); ++ llvm::raw_fd_ostream OS(fname, EC, ++#if ISPC_LLVM_VERSION >= ISPC_LLVM_13_0 ++ llvm::sys::fs::OF_None ++#else ++ llvm::sys::fs::F_None ++#endif ++ ); + Assert(!EC && "IR dump file creation failed!"); + module.print(OS, 0); + }