From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWQuj-0000m1-MO for guix-patches@gnu.org; Fri, 22 Jun 2018 14:36:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWQug-0002I2-G3 for guix-patches@gnu.org; Fri, 22 Jun 2018 14:36:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:52667) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWQug-0002Hr-Az for guix-patches@gnu.org; Fri, 22 Jun 2018 14:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fWQug-00008X-3O for guix-patches@gnu.org; Fri, 22 Jun 2018 14:36:02 -0400 Subject: [bug#31940] [PATCH] gnu: Add Stalin. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWQu7-0000Pb-3d for guix-patches@gnu.org; Fri, 22 Jun 2018 14:35:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWQu3-00029c-Sc for guix-patches@gnu.org; Fri, 22 Jun 2018 14:35:27 -0400 Received: from mail-qt0-x229.google.com ([2607:f8b0:400d:c0d::229]:40536) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWQu3-00029O-Ee for guix-patches@gnu.org; Fri, 22 Jun 2018 14:35:23 -0400 Received: by mail-qt0-x229.google.com with SMTP id j20-v6so166405qtn.7 for ; Fri, 22 Jun 2018 11:35:23 -0700 (PDT) Received: from localhost (dyn-209-2-210-232.dyn.columbia.edu. [209.2.210.232]) by smtp.gmail.com with ESMTPSA id k8-v6sm5754393qti.4.2018.06.22.11.35.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Jun 2018 11:35:21 -0700 (PDT) From: Adam Massmann Date: Fri, 22 Jun 2018 14:35:18 -0400 Message-ID: <878t76655l.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31940@debbugs.gnu.org --=-=-= Content-Type: text/plain Hi Guix, Below is a patch to add the Stalin compiler to Guix. Feedback welcome. Thanks, Adam --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-stalin.patch Content-Transfer-Encoding: quoted-printable >From dbd3395c90aa443a7c6bad9155e6bfc7053bfbf0 Mon Sep 17 00:00:00 2001 From: Adam Massmann Date: Fri, 22 Jun 2018 14:29:23 -0400 Subject: [PATCH] gnu: Add stalin. * gnu/packages/scheme.scm (stalin): New variable. --- gnu/packages/scheme.scm | 78 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index dba5067e9..dbb545532 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -9,6 +9,7 @@ ;;; Copyright =C2=A9 2017 John Darrington ;;; Copyright =C2=A9 2017 Cl=C3=A9ment Lassieur ;;; Copyright =C2=A9 2017, 2018 Tobias Geerinckx-Rice +;;; Copyright =C2=A9 2018 Adam Massmann ;;; ;;; This file is part of GNU Guix. ;;; @@ -356,7 +357,7 @@ mashups, office (web agendas, mail clients, ...), etc.") `(#:modules ((guix build gnu-build-system) (guix build utils) (srfi srfi-1)) -=20=20=20=20=20=20=20 + ;; No `configure' script; run "make check" after "make install" as ;; prescribed by README. #:phases @@ -1025,3 +1026,78 @@ the same program, without any interference between t= hem. Foreign functions in C can be added and values can be defined in the Scheme environment. Being q= uite a small program, it is easy to comprehend, get to grips with, and use.") (license bsd-3))) ; there are no licence headers + +(define-public stalin + (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be")) + (package + (name "stalin") + (version "0.11") + (source (origin + ;; Use Pearlmutter's upstream branch with AMD64 patches + ;; applied. Saves us from including those 20M! patches + ;; in Guix. For more info, see: + ;; + (method git-fetch) + (uri (git-reference + (url "https://github.com/barak/stalin.git") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn")) + (modules '((guix build utils))) + (snippet + ;; remove gc libs from build, we have them as input + '(begin + (delete-file "gc6.8.tar.gz") + (delete-file-recursively "benchmarks") + (substitute* "build" + ((".*gc6.8.*") "") + ((" cd \\.\\.") "") + ((".*B include/libgc.a") "") + ((".*make.*") "")) + #t)))) + (build-system gnu-build-system) + (arguments + `(#:make-flags (list "ARCH_OPTS=3D-freg-struct-return") + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (include-out (string-append out "/include"))) + (invoke "./build") + (for-each (lambda (fname) + (install-file fname include-out)) + (find-files "include")) + (substitute* "makefile" + (("\\./include") include-out)) + (substitute* "post-make" + (("`pwd`") out)) + #t))) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (install-file "stalin.1" + (string-append out "/share/man/man1")) + (install-file "stalin" + (string-append out "/bin")) + #t)))))) + (inputs + `(("libx11" ,libx11))) + (propagated-inputs + `(("libgc" ,libgc))) + (supported-systems '("x86_64-linux")) + (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf") + (synopsis "Brutally efficient Scheme compiler") + (description + "Stalin is an aggressively optimizing whole-program compiler +for Scheme that does polyvariant interprocedural flow analysis, +flow-directed interprocedural escape analysis, flow-directed +lightweight CPS conversion, flow-directed lightweight closure +conversion, flow-directed interprocedural lifetime analysis, automatic +in-lining, unboxing, and flow-directed program-specific and +program-point-specific low-level representation selection and code +generation.") + (license gpl2+)))) --=20 2.17.1 --=-=-=--