From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: GCC front-ends Date: Sat, 26 Oct 2013 22:08:04 +0200 Message-ID: <87bo2bkd7f.fsf@gnu.org> References: <87wqlfutme.fsf@karetnikov.org> <87hacijnke.fsf@gnu.org> <87ppr4giie.fsf@karetnikov.org> <8738nzdig1.fsf@gnu.org> <87hacdmyc2.fsf_-_@karetnikov.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaA9d-00071D-Bh for guix-devel@gnu.org; Sat, 26 Oct 2013 16:08:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaA9X-0002Wj-Ko for guix-devel@gnu.org; Sat, 26 Oct 2013 16:08:13 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:59748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaA9X-0002Wa-EG for guix-devel@gnu.org; Sat, 26 Oct 2013 16:08:07 -0400 In-Reply-To: <87hacdmyc2.fsf_-_@karetnikov.org> (Nikita Karetnikov's message of "Sat, 19 Oct 2013 12:58:21 +0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: guix-devel@gnu.org Nikita Karetnikov skribis: >> I guess this triggers a complete rebuild, right? (That means it would >> go in =E2=80=98core-updates=E2=80=99.) > >> Using the =E2=80=98substitute-keyword-arguments=E2=80=99 hack as in base= .scm would allow >> you to avoid that. > >> Also, the =E2=80=98origin=E2=80=99 thing should be factorized: > >> (define (gcc-source version) >> (origin ...)) > >> It=E2=80=99s good that you=E2=80=99re tackling this! Then we can also b= uild the >> Objective-C front-end, and then start GNUstepping. > > What do you think about the attached diff? Is there a way to avoid > multiple =E2=80=98map=E2=80=99s? See below. > What about the names of the packages? For example, =E2=80=98gcc-fortran= =E2=80=99 is > usually called =E2=80=98gfortran=E2=80=99, =E2=80=98gcc-go=E2=80=99 is ca= lled =E2=80=98gccgo=E2=80=99, etc. Should we > use these names? How should we call =E2=80=98gcc-objc=E2=80=99, then? I=E2=80=99d say =E2=80=98gfortran=E2=80=99 and =E2=80=98gccgo=E2=80=99, and= perhaps =E2=80=98gcc-objective-c=E2=80=99? > If you want to test any of the front-ends, don=E2=80=99t forget to set > LIBRARY_PATH and LD_LIBRARY_PATH, like so: > > $ export LIBRARY_PATH=3D/nix/store/wmaxqx3p658v2yqjv00mss2shvn23h7a-glibc= -2.18/lib > $ export LD_LIBRARY_PATH=3D/nix/store/kvhg0fszagsx5y80sq79bkmb7yqvjfmd-gc= c-go-4.8.1/lib I guess that=E2=80=99s unnecessary when using =E2=80=98ld-wrapper=E2=80=99. > Notes: > > 1. The Go front-end requires =E2=80=98-g=E2=80=99 (see [1]). That=E2=80=99s a bug, which may have been fixed in 4.8.2 no? I=E2=80=99d r= ather not workaround that if it=E2=80=99s been/being fixed. > 4. The Ada front-end requires GNAT [3] (see [4]). > > 5. Not sure why the Java front-end fails: GNAT and GCJ are definitely trickier, so I=E2=80=99d suggest to leave them = for now. > +(define (custom-gcc gcc name languages) > + (package (inherit gcc) > + (name name) > + (arguments > + (substitute-keyword-arguments (package-arguments gcc) > + ((#:configure-flags flags) > + (map (lambda (x) > + (if (list? x) > + (map (lambda (y) > + (if (equal? "--enable-languages=3Dc,c++" y) > + (string-append "--enable-languages=3D" > + languages) > + y)) > + x) > + x)) > + flags)))))) That=E2=80=99s unreliable because FLAGS is actually a quoted expression, li= ke '(cons "--with-foo" (list "--with-bar")) So the mapping has to be done in builder-side code, not in host-side code, like =E2=80=98gcc-cross-boot0=E2=80=99 does. Something like: `(cons "--enable-languages=3D" ,(string-join languages ",") (remove (cut string-match "--enable-languages.*" <>) ,flags)) (Note that =E2=80=9Cc,c++=E2=80=9D can be omitted since it=E2=80=99s always= enabled.) Thanks, Ludo=E2=80=99.