From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Karetnikov Subject: GCC front-ends (was: GFortran =?utf-8?Q?can=E2=80=99t?= find system headers) Date: Sat, 19 Oct 2013 12:58:21 +0400 Message-ID: <87hacdmyc2.fsf_-_@karetnikov.org> References: <87wqlfutme.fsf@karetnikov.org> <87hacijnke.fsf@gnu.org> <87ppr4giie.fsf@karetnikov.org> <8738nzdig1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXSHq-0006ym-C4 for guix-devel@gnu.org; Sat, 19 Oct 2013 04:53:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXSHo-0004Ob-SD for guix-devel@gnu.org; Sat, 19 Oct 2013 04:53:30 -0400 In-Reply-To: <8738nzdig1.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 17 Oct 2013 17:29:34 +0200") 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > 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 bu= ild 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? 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 call= ed =E2=80=98gccgo=E2=80=99, etc. Should we use these names? How should we call =E2=80=98gcc-objc=E2=80=99, then? 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-gcc-= go-4.8.1/lib Notes: 1. The Go front-end requires =E2=80=98-g=E2=80=99 (see [1]). 2. =E2=80=9CGFORTRAN guesses the source code formatting based on the file extension. For .f90 files, it will assume it's working with FORTRAN 90 source code and use free formatting rules. For .f and .for files, it will assume the file is F77 source code and use fixed formatting rules.=E2=80=9D [2] 3. If you want to compile Objective-C or Objective-C++, pass =E2=80=98-x =E2=80=99 to =E2=80=98gcc=E2=80=99. 4. The Ada front-end requires GNAT [3] (see [4]). 5. Not sure why the Java front-end fails: libtool: link: ( cd ".libs" && rm -f "libquadmath.la" && ln -s "../libqu= admath.la" "libquadmath.la" ) make[3]: Leaving directory `/tmp/nix-build-gcc-java-4.8.1.drv-0/build/i6= 86-pc-linux-gnu/libquadmath' make[2]: Leaving directory `/tmp/nix-build-gcc-java-4.8.1.drv-0/build/i6= 86-pc-linux-gnu/libquadmath' make[1]: Leaving directory `/tmp/nix-build-gcc-java-4.8.1.drv-0/build' make: *** [all] Error 2 phase `build' failed after 2229 seconds note: keeping build directory `/tmp/nix-build-gcc-java-4.8.1.drv-0' builder for `/nix/store/wlqwyy9k9mbl3wpy9jq08k91qq23f4kp-gcc-java-4.8.1.= drv' failed with exit code 1 @ build-failed /nix/store/wlqwyy9k9mbl3wpy9jq08k91qq23f4kp-gcc-java-4.8.= 1.drv - 1 builder for `/nix/store/wlqwyy9k9mbl3wpy9jq08k91qq23f4kp-gcc-java= -4.8.1.drv' failed with exit code 1 guix build: error: build failed: build of `/nix/store/wlqwyy9k9mbl3wpy9j= q08k91qq23f4kp-gcc-java-4.8.1.drv' failed [1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D57194 [2] http://ubuntuforums.org/showthread.php?t=3D853105 [3] https://www.gnu.org/software/gnat/ [4] http://gcc.gnu.org/ml/gcc/2007-11/msg00091.html --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=gcc.diff Content-Transfer-Encoding: quoted-printable diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index cececca..c2742fb 100644 =2D-- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -26,6 +26,7 @@ #:use-module (gnu packages texinfo) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (ice-9 regex)) =20 @@ -211,6 +212,41 @@ Go. It also includes standard libraries for these lan= guages.") (base32 "04sqn0ds17ys8l6zn7vyyvjz1a7hsk4zb0381vlw9wnr7az48nsl")))))) =20 +(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)))))) + +;; (define-public gcc-ada-4.8 +;; (custom-gcc gcc-4.8 "gcc-ada" "ada")) + +(define-public gcc-fortran-4.8 + (custom-gcc gcc-4.8 "gcc-fortran" "fortran")) + +(define-public gcc-go-4.8 + (custom-gcc gcc-4.8 "gcc-go" "go")) + +;; (define-public gcc-java-4.8 +;; (custom-gcc gcc-4.8 "gcc-java" "java")) + +(define-public gcc-objc-4.8 + (custom-gcc gcc-4.8 "gcc-objc" "objc")) + +(define-public gcc-objc++-4.8 + (custom-gcc gcc-4.8 "gcc-objc++" "obj-c++")) + (define-public isl (package (name "isl") --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJSYkmwAAoJEM+IQzI9IQ381a4P/R4n5wzC/okYjuT+p7MMVcVY wfrYfG31Pm/9Y4QxGVMRbskaLNT2YHu/AyNkkvO6pmhbSj6PUBzTzLnyY5FZf9SG rB6dx2Fa0ZAC04Si4iKkT/nGS/u2MfR0RszWaqJcqTF2rHYo3Pyo1uhrorUYXMHy 4pQDIhrHFQueIjzL+vz4Yn/gkAWRcO+y8A90GFcEDHMxlNgbDuo0BBpdNkexvfJx nQkg9AdqbBK84XAdySJ8QNnt5a8knwQY2ZUYKJcL/J+pU9amujILqGgNOqrBfIIW d1eBWA/iqvfAiiA5oGIxFZsq6/4ltgC1OyreEk7hFhtUVlUCz4IGXb6E11u/LpUV zc1LOLy2mNfBNb2cz9LFmnys8xTVe/SX3YLcsVIESvXJJkouVrF2EZ/jVROBeymi gQ9xurwdTs08ttOvALma4AiAUnYtARg61pdZKKxMxOd8XBWgFishtGMilCY6YaRF vClp4DErYtIiTjPhFzVaktprgJ+V3zNSDi5xDsP8QwPGPmVVLjDarDQ15l+QBmbJ BkhgPKUmU+ETP/qnoYaXIR8kCoiKmxHgWpRyhlxu/2DQQ7tJyuGcIiqFbm/IviR0 c5XB3x6VTC+5M3zMyYlmg+zgM4BNsrkLwXDtuEWMXS0x2+pX82Pw/U/P+KojtLQX inSpZOeJLn86NWW/p/7B =71Ar -----END PGP SIGNATURE----- --==-=-=--