[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/25: gnu: Add tcc-boot 0.9.27.
From: |
Jan Nieuwenhuizen |
Subject: |
08/25: gnu: Add tcc-boot 0.9.27. |
Date: |
Tue, 26 Jun 2018 13:48:36 -0400 (EDT) |
janneke pushed a commit to branch wip-bootstrap
in repository guix.
commit 170d3b59c5d69086d21ed84b391244cf7806e77c
Author: Jan Nieuwenhuizen <address@hidden>
Date: Sun Jun 17 23:32:04 2018 +0200
gnu: Add tcc-boot 0.9.27.
* gnu/packages/mes.scm (tcc-boot0): Rename from tcc-boot.
(tcc-boot): New package.
* gnu/packages/patches/tcc-boot-0.9.27.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/mes.scm | 101 +++++++++++++++++++++++++++--
gnu/packages/patches/tcc-boot-0.9.27.patch | 26 ++++++++
3 files changed, 123 insertions(+), 5 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 4b0cf07..5a39a41 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1081,6 +1081,7 @@ dist_patch_DATA =
\
%D%/packages/patches/t1lib-CVE-2011-1552+CVE-2011-1553+CVE-2011-1554.patch
\
%D%/packages/patches/tar-CVE-2016-6321.patch \
%D%/packages/patches/tar-skip-unreliable-tests.patch \
+ %D%/packages/patches/tcc-boot-0.9.27.patch \
%D%/packages/patches/tcl-mkindex-deterministic.patch \
%D%/packages/patches/tclxml-3.2-install.patch \
%D%/packages/patches/tcsh-fix-autotest.patch \
diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index c7e1dad..dc1883a 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -369,13 +369,13 @@ extensive examples, including parsers for the Javascript
and C99 languages.")
(home-page "https://savannah.nongnu.org/projects/nyacc")
(license (list gpl3+ lgpl3+)))))
-(define-public tcc-boot
+(define-public tcc-boot0
(let ((version "0.9.26")
- (revision "0")
- (commit "97196cebf6c5c79ec87f1ee4875cc8c188333a3c"))
+ (revision "1")
+ (commit "c73a151c4d0878f387de0c87ec77484626a7a888"))
(package-with-bootstrap-guile
(package
- (name "tcc-boot")
+ (name "tcc-boot0")
(version (string-append version "-" revision "." (string-take commit
7)))
(synopsis "Tiny and fast C compiler")
(source (origin
@@ -385,7 +385,7 @@ extensive examples, including parsers for the Javascript
and C99 languages.")
"/tinycc-" commit ".tar.gz"))
(sha256
(base32
- "1z156jfnc0dkdb6i9h0nns4hm11c03k3vakw7qhb7651dm8hqxrk"))))
+ "0sxvdj06a21a4a305k0pz4nb36vrcdjqv9xsb8dm06a8j1iqjkx9"))))
(build-system trivial-build-system)
(supported-systems '("i686-linux" "x86_64-linux"))
(native-inputs
@@ -507,6 +507,97 @@ standard.")
(home-page "http://www.tinycc.org/")
(license lgpl2.1+)))))
+(define-public tcc-boot
+ (package
+ (inherit tcc-boot0)
+ (name "tcc-boot")
+ (version "0.9.27")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://savannah/tinycc/tcc-"
+ version ".tar.bz2"))
+ (patches (search-patches "tcc-boot-0.9.27.patch"))
+ (sha256
+ (base32
+ "177bdhwzrnqgyrdv1dwvpd04fcxj68s5pm1dzwny6359ziway8yy"))))
+ (build-system trivial-build-system)
+ (supported-systems '("i686-linux" "x86_64-linux"))
+
+ (native-inputs
+ `(("static-bash" ,@(assoc-ref %bootstrap-inputs "bash"))
+ ("tar" ,(search-bootstrap-binary "tar" (%current-system)))
+ ("xz" ,(search-bootstrap-binary "xz" (%current-system)))
+ ("mes" ,mes-boot)
+ ("tcc" ,tcc-boot0)))
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let* ((bash (assoc-ref %build-inputs "static-bash"))
+ (tar (assoc-ref %build-inputs "tar"))
+ (xz (assoc-ref %build-inputs "xz"))
+ (source (assoc-ref %build-inputs "source"))
+ (mes (assoc-ref %build-inputs "mes"))
+ (tcc (assoc-ref %build-inputs "tcc"))
+ (out (assoc-ref %outputs "out"))
+ (libc (assoc-ref %build-inputs "libc"))
+ (interpreter (if libc
+ (string-append libc
,(glibc-dynamic-linker))
+ (string-append mes "/lib/mes-loader"))))
+ ;; unpack
+ (setenv "PATH" (string-append
+ bash "/bin:"
+ tar "/bin:"
+ tcc "/bin:"
+ xz "/bin"))
+ (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
+ (mkdir-p "source")
+ (system* "tar" "--strip=1" "-C" "source" "-xvf" source)
+ (chdir "source")
+
+ ;; configure
+ (and
+ (zero? (system* "sh" "configure"
+ (string-append "--cc=tcc")
+ (string-append "--cpu=i386")
+ (string-append "--prefix=" out)
+ (string-append "--elfinterp=" interpreter)
+ (string-append "--crtprefix=" tcc "/lib")
+ (string-append "--sysincludepaths=" tcc
"/include")
+ (string-append "--libpaths=" tcc "/lib")))
+ ;; make
+ (zero? (system* "tcc"
+ "-vvv"
+ "-D" "BOOTSTRAP=1"
+ "-D" "ONE_SOURCE=1"
+ "-D" "TCC_TARGET_I386=1"
+ "-D" "CONFIG_TCC_STATIC=1"
+ "-D" "CONFIG_USE_LIBGCC=1"
+ "-D" (string-append "CONFIG_TCCDIR=\"" out
"/lib/tcc\"")
+ "-D" (string-append "CONFIG_TCC_CRTPREFIX=\""
out "/lib:{B}/lib:.\"")
+ "-D" (string-append "CONFIG_TCC_CRTPREFIX=\""
out "/lib:{B}/lib:.\"")
+ "-D" (string-append "CONFIG_TCC_ELFINTERP=\""
interpreter "\"")
+ "-D" (string-append "CONFIG_TCC_LIBPATHS=\""
tcc "/lib:{B}/lib:.\"")
+ "-D" (string-append
"CONFIG_TCC_SYSINCLUDEPATHS=\"" tcc "/include" ":/include:{B}/include\"")
+ "-D" (string-append "TCC_LIBGCC=\"" tcc
"/lib/libc.a\"")
+ "-I" (string-append tcc "/out")
+ "-L" (string-append tcc "/lib")
+ "-o" "tcc"
+ "tcc.c"))
+ (mkdir-p (string-append out "/bin"))
+ (copy-file "tcc" (string-append out "/bin/tcc"))
+ (mkdir-p (string-append out "/lib/tcc"))
+ (copy-recursively (string-append tcc "/include")
+ (string-append out "/include"))
+ (copy-recursively (string-append tcc "/lib")
+ (string-append out "/lib"))
+ (zero? (system* "tcc" "-D" "TCC_TARGET_I386=1" "-c" "-o"
"libtcc1.o" "lib/libtcc1.c"))
+ (zero? (system* "tcc" "-ar" "rc" "libtcc1.a" "libtcc1.o"))
+ (copy-file "libtcc1.a" (string-append out "/lib/libtcc1.a"))
+ (delete-file (string-append out "/lib/tcc/libtcc1.a"))
+ (copy-file "libtcc1.a" (string-append out
"/lib/tcc/libtcc1.a")))))))))
+
(define-public m4-boot
(package
(inherit m4)
diff --git a/gnu/packages/patches/tcc-boot-0.9.27.patch
b/gnu/packages/patches/tcc-boot-0.9.27.patch
new file mode 100644
index 0000000..6f9d365
--- /dev/null
+++ b/gnu/packages/patches/tcc-boot-0.9.27.patch
@@ -0,0 +1,26 @@
+From 1431ba3a99582e4c3d2693ac37e57f361858affd Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <address@hidden>
+Date: Mon, 11 Jun 2018 18:39:44 +0200
+Subject: [PATCH] bootstrappable: Force static link.
+
+---
+ libtcc.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libtcc.c b/libtcc.c
+index 3448f44..02ab850 100644
+--- a/libtcc.c
++++ b/libtcc.c
+@@ -735,6 +735,9 @@ LIBTCCAPI TCCState *tcc_new(void)
+ tcc_state = s;
+ ++nb_states;
+
++#if BOOTSTRAP
++ s->static_link = 1;
++#endif
+ s->alacarte_link = 1;
+ s->nocommon = 1;
+ s->warn_implicit_function_declaration = 1;
+--
+2.16.2
+
- 17/25: gnu: gcc-core-mesboot: Rename from gcc-core-boot., (continued)
- 17/25: gnu: gcc-core-mesboot: Rename from gcc-core-boot., Jan Nieuwenhuizen, 2018/06/26
- 18/25: gnu: glibc-mesboot: Rename from glibc-boot., Jan Nieuwenhuizen, 2018/06/26
- 15/25: gnu: m4:mesboot: Rename from m4-boot., Jan Nieuwenhuizen, 2018/06/26
- 14/25: gnu: Remove binutils-boot0-cheat., Jan Nieuwenhuizen, 2018/06/26
- 23/25: gnu: Add gcc-mesboot 4.7.4. WIP, Jan Nieuwenhuizen, 2018/06/26
- 24/25: REMOVEME: %fake-bootstrap => #t., Jan Nieuwenhuizen, 2018/06/26
- 06/25: gnu: gcc-core-boot: Install libgcc2.a too., Jan Nieuwenhuizen, 2018/06/26
- 25/25: Revert "REMOVEME: %fake-bootstrap => #t.", Jan Nieuwenhuizen, 2018/06/26
- 05/25: gnu: glibc-boot: Install all headers. WIP plus more, Jan Nieuwenhuizen, 2018/06/26
- 10/25: gnu: binutils-boot: Update to 2.20.1a., Jan Nieuwenhuizen, 2018/06/26
- 08/25: gnu: Add tcc-boot 0.9.27.,
Jan Nieuwenhuizen <=
- 20/25: gnu: binutils-mesboot: Rename from binutils-boot., Jan Nieuwenhuizen, 2018/06/26
- 22/25: gnu: Add gcc-mesboot 4.1.0., Jan Nieuwenhuizen, 2018/06/26
- 12/25: gnu: gcc-boot: build with %cheat-binutils?, Jan Nieuwenhuizen, 2018/06/26