[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 03/10: Distribute prebuilt bootstraps for common hosts
From: |
Andy Wingo |
Subject: |
[Guile-commits] 03/10: Distribute prebuilt bootstraps for common hosts |
Date: |
Mon, 01 Feb 2016 14:35:30 +0000 |
wingo pushed a commit to branch master
in repository guile.
commit eccdeb6cc6c164ea10160fafbd276b6dc5e9b73e
Author: Andy Wingo <address@hidden>
Date: Fri Jan 29 10:21:44 2016 +0100
Distribute prebuilt bootstraps for common hosts
* am/bootstrap.am: New file, factored out of bootstrap/Makefile.am.
* bootstrap/Makefile.am: Use bootstrap.am.
* prebuilt/Makefile.am:
* prebuilt/i686-pc-linux-gnu/Makefile.am:
* prebuilt/mips-unknown-linux-gnu/Makefile.am:
* prebuilt/x86_64-unknown-linux-gnu/Makefile.am: New files.
* configure.ac: Output the prebuilt/ makefiles.
* Makefile.am: Descend into prebuilt/ when making dist.
* meta/uninstalled-env.in: Arrange to put prebuilt/ in the beginning of
the GUILE_LOAD_COMPILED_PATH. Also fix a case where bootstrap/ wasn't
being correctly added to the load path.
---
Makefile.am | 2 +
bootstrap/Makefile.am => am/bootstrap.am | 43 ++++-----
bootstrap/Makefile.am | 133 +------------------------
configure.ac | 5 +
meta/uninstalled-env.in | 27 +++---
prebuilt/Makefile.am | 56 +++++++++++
prebuilt/i686-pc-linux-gnu/Makefile.am | 25 +++++
prebuilt/mips-unknown-linux-gnu/Makefile.am | 25 +++++
prebuilt/x86_64-unknown-linux-gnu/Makefile.am | 25 +++++
9 files changed, 174 insertions(+), 167 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 7918c79..0703326 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,6 +41,8 @@ SUBDIRS = \
am \
doc
+DIST_SUBDIRS = $(SUBDIRS) prebuilt
+
libguileincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)
libguileinclude_HEADERS = libguile.h
diff --git a/bootstrap/Makefile.am b/am/bootstrap.am
similarity index 80%
copy from bootstrap/Makefile.am
copy to am/bootstrap.am
index e954059..d613d7f 100644
--- a/bootstrap/Makefile.am
+++ b/am/bootstrap.am
@@ -1,54 +1,48 @@
-## Process this file with automake to produce Makefile.in.
-##
## Copyright (C) 2009, 2010, 2011, 2012, 2013,
## 2014, 2015 Free Software Foundation, Inc.
##
-## This file is part of GUILE.
+## This file is part of GNU Guile.
##
-## GUILE is free software; you can redistribute it and/or modify it
-## under the terms of the GNU Lesser General Public License as
-## published by the Free Software Foundation; either version 3, or
-## (at your option) any later version.
+## GNU Guile is free software; you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as
+## published by the Free Software Foundation; either version 3, or (at
+## your option) any later version.
##
-## GUILE is distributed in the hope that it will be useful, but
+## GNU Guile is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
-## License along with GUILE; see the file COPYING.LESSER. If not,
+## License along with GNU Guile; see the file COPYING.LESSER. If not,
## write to the Free Software Foundation, Inc., 51 Franklin Street,
## Fifth Floor, Boston, MA 02110-1301 USA
+# These variables can be set before you include bootstrap.am.
+GUILE_WARNINGS ?= -Wunbound-variable -Warity-mismatch -Wformat
+GUILE_OPTIMIZATIONS ?= -O2
+GUILE_TARGET ?= $(host)
+GUILE_BUILD_TAG ?= BOOTSTRAP
GOBJECTS = $(SOURCES:%.scm=%.go)
-# No warnings for the bootstrap build. Run
-# make GUILE_WARNINGS="-Wunbound-variable -Warity-mismatch -Wformat"
-# to get the normal set of warnings.
-GUILE_WARNINGS =
-GUILE_OPTIMIZATIONS = -O1
-nobase_noinst_DATA = $(GOBJECTS) ice-9/eval.go
-CLEANFILES = $(GOBJECTS) ice-9/eval.go
-
-# We must build the evaluator first, so that we can be sure to control
-# the stack.
-$(GOBJECTS): ice-9/eval.go
+nobase_noinst_DATA = $(GOBJECTS)
+CLEANFILES = $(GOBJECTS)
-VM_TARGETS := system/vm/assembler.go system/vm/disassembler.go
+VM_TARGETS = system/vm/assembler.go system/vm/disassembler.go
$(VM_TARGETS): $(top_builddir)/libguile/vm-operations.h
AM_V_GUILEC = $(AM_V_GUILEC_$(V))
AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
-AM_V_GUILEC_0 = @echo " BOOTSTRAP GUILEC" $@;
+AM_V_GUILEC_0 = @echo " $(GUILE_BUILD_TAG) GUILEC" $@;
-vpath %.scm @srcdir@/../module
+vpath %.scm @top_srcdir@/module
SUFFIXES = .scm .go
.scm.go:
$(AM_V_GUILEC)GUILE_AUTO_COMPILE=0 \
$(top_builddir)/meta/uninstalled-env \
- guild compile --target="$(host)" \
+ guild compile --target="$(GUILE_TARGET)" \
$(GUILE_WARNINGS) $(GUILE_OPTIMIZATIONS) \
-L "$(abs_top_srcdir)/module" \
-L "$(abs_top_srcdir)/guile-readline" \
@@ -58,6 +52,7 @@ SUFFIXES = .scm .go
# these in any order; the order below is designed to hopefully result in
# the lowest total compile time.
SOURCES = \
+ ice-9/eval.scm \
ice-9/psyntax-pp.scm \
language/cps/intmap.scm \
language/cps/intset.scm \
diff --git a/bootstrap/Makefile.am b/bootstrap/Makefile.am
index e954059..496d530 100644
--- a/bootstrap/Makefile.am
+++ b/bootstrap/Makefile.am
@@ -21,138 +21,11 @@
## Fifth Floor, Boston, MA 02110-1301 USA
-GOBJECTS = $(SOURCES:%.scm=%.go)
-# No warnings for the bootstrap build. Run
-# make GUILE_WARNINGS="-Wunbound-variable -Warity-mismatch -Wformat"
-# to get the normal set of warnings.
GUILE_WARNINGS =
GUILE_OPTIMIZATIONS = -O1
-nobase_noinst_DATA = $(GOBJECTS) ice-9/eval.go
-CLEANFILES = $(GOBJECTS) ice-9/eval.go
+
+include $(top_srcdir)/am/bootstrap.am
# We must build the evaluator first, so that we can be sure to control
# the stack.
-$(GOBJECTS): ice-9/eval.go
-
-VM_TARGETS := system/vm/assembler.go system/vm/disassembler.go
-$(VM_TARGETS): $(top_builddir)/libguile/vm-operations.h
-
-AM_V_GUILEC = $(AM_V_GUILEC_$(V))
-AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
-AM_V_GUILEC_0 = @echo " BOOTSTRAP GUILEC" $@;
-
-vpath %.scm @srcdir@/../module
-
-SUFFIXES = .scm .go
-
-.scm.go:
- $(AM_V_GUILEC)GUILE_AUTO_COMPILE=0 \
- $(top_builddir)/meta/uninstalled-env \
- guild compile --target="$(host)" \
- $(GUILE_WARNINGS) $(GUILE_OPTIMIZATIONS) \
- -L "$(abs_top_srcdir)/module" \
- -L "$(abs_top_srcdir)/guile-readline" \
- -o "$@" "$<"
-
-# A subset of sources that are used by the compiler. We can compile
-# these in any order; the order below is designed to hopefully result in
-# the lowest total compile time.
-SOURCES = \
- ice-9/psyntax-pp.scm \
- language/cps/intmap.scm \
- language/cps/intset.scm \
- language/cps/utils.scm \
- ice-9/vlist.scm \
- srfi/srfi-1.scm \
- \
- language/tree-il.scm \
- language/tree-il/analyze.scm \
- language/tree-il/canonicalize.scm \
- language/tree-il/compile-cps.scm \
- language/tree-il/debug.scm \
- language/tree-il/effects.scm \
- language/tree-il/fix-letrec.scm \
- language/tree-il/optimize.scm \
- language/tree-il/peval.scm \
- language/tree-il/primitives.scm \
- language/tree-il/spec.scm \
- \
- language/cps.scm \
- language/cps/closure-conversion.scm \
- language/cps/compile-bytecode.scm \
- language/cps/constructors.scm \
- language/cps/contification.scm \
- language/cps/cse.scm \
- language/cps/dce.scm \
- language/cps/effects-analysis.scm \
- language/cps/elide-values.scm \
- language/cps/licm.scm \
- language/cps/peel-loops.scm \
- language/cps/primitives.scm \
- language/cps/prune-bailouts.scm \
- language/cps/prune-top-level-scopes.scm \
- language/cps/reify-primitives.scm \
- language/cps/renumber.scm \
- language/cps/rotate-loops.scm \
- language/cps/optimize.scm \
- language/cps/simplify.scm \
- language/cps/self-references.scm \
- language/cps/slot-allocation.scm \
- language/cps/spec.scm \
- language/cps/specialize-primcalls.scm \
- language/cps/specialize-numbers.scm \
- language/cps/split-rec.scm \
- language/cps/type-checks.scm \
- language/cps/type-fold.scm \
- language/cps/types.scm \
- language/cps/verify.scm \
- language/cps/with-cps.scm \
- \
- language/scheme/spec.scm \
- language/scheme/compile-tree-il.scm \
- language/scheme/decompile-tree-il.scm \
- \
- language/bytecode.scm \
- language/bytecode/spec.scm \
- \
- language/value/spec.scm \
- \
- system/base/pmatch.scm \
- system/base/syntax.scm \
- system/base/compile.scm \
- system/base/language.scm \
- system/base/lalr.scm \
- system/base/message.scm \
- system/base/target.scm \
- system/base/types.scm \
- system/base/ck.scm \
- \
- ice-9/boot-9.scm \
- ice-9/r5rs.scm \
- ice-9/deprecated.scm \
- ice-9/binary-ports.scm \
- ice-9/command-line.scm \
- ice-9/control.scm \
- ice-9/format.scm \
- ice-9/getopt-long.scm \
- ice-9/i18n.scm \
- ice-9/match.scm \
- ice-9/networking.scm \
- ice-9/posix.scm \
- ice-9/rdelim.scm \
- ice-9/receive.scm \
- ice-9/regex.scm \
- ice-9/session.scm \
- ice-9/pretty-print.scm \
- \
- system/vm/assembler.scm \
- system/vm/debug.scm \
- system/vm/disassembler.scm \
- system/vm/dwarf.scm \
- system/vm/elf.scm \
- system/vm/frame.scm \
- system/vm/linker.scm \
- system/vm/loader.scm \
- system/vm/program.scm \
- system/vm/vm.scm \
- system/foreign.scm
+$(filter-out ice-9/eval.go, $(GOBJECTS)): ice-9/eval.go
diff --git a/configure.ac b/configure.ac
index 9e639d6..0eb2368 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1645,8 +1645,13 @@ AC_CONFIG_FILES([
meta/Makefile
bootstrap/Makefile
module/Makefile
+ prebuilt/Makefile
+ prebuilt/x86_64-unknown-linux-gnu/Makefile
+ prebuilt/i686-pc-linux-gnu/Makefile
+ prebuilt/mips-unknown-linux-gnu/Makefile
])
+
GUILE_CONFIG_SCRIPT([check-guile])
GUILE_CONFIG_SCRIPT([benchmark-guile])
GUILE_CONFIG_SCRIPT([meta/guile])
diff --git a/meta/uninstalled-env.in b/meta/uninstalled-env.in
index 3bcde8e..7197eab 100644
--- a/meta/uninstalled-env.in
+++ b/meta/uninstalled-env.in
@@ -80,21 +80,22 @@ then
fi
export GUILE_LOAD_PATH
- if test "x$GUILE_LOAD_COMPILED_PATH" = "x"
- then
-
GUILE_LOAD_COMPILED_PATH="${top_builddir}/module:${top_builddir}/guile-readline"
+ if test "x$GUILE_LOAD_COMPILED_PATH" = "x"; then
+ GUILE_LOAD_COMPILED_PATH="${top_srcdir}/prebuilt/@host@"
else
- for d in "/bootstrap" "/module" "/guile-readline"
- do
- # This hair prevents double inclusion.
- # The ":" prevents prefix aliasing.
- case x"$GUILE_LOAD_COMPILED_PATH" in
- x*${top_builddir}${d}:*) ;;
- x*${top_builddir}${d}) ;;
- *)
GUILE_LOAD_COMPILED_PATH="${top_builddir}${d}:$GUILE_LOAD_COMPILED_PATH" ;;
- esac
- done
+
GUILE_LOAD_COMPILED_PATH="${top_srcdir}/prebuilt/@host@:$GUILE_LOAD_COMPILED_PATH"
fi
+
+ for d in "/bootstrap" "/module" "/guile-readline"
+ do
+ # This hair prevents double inclusion.
+ # The ":" prevents prefix aliasing.
+ case x"$GUILE_LOAD_COMPILED_PATH" in
+ x*${top_builddir}${d}:*) ;;
+ x*${top_builddir}${d}) ;;
+ *)
GUILE_LOAD_COMPILED_PATH="${top_builddir}${d}:$GUILE_LOAD_COMPILED_PATH" ;;
+ esac
+ done
export GUILE_LOAD_COMPILED_PATH
# Don't look in installed dirs for guile modules
diff --git a/prebuilt/Makefile.am b/prebuilt/Makefile.am
new file mode 100644
index 0000000..b0a24d0
--- /dev/null
+++ b/prebuilt/Makefile.am
@@ -0,0 +1,56 @@
+## Process this file with automake to produce Makefile.in.
+##
+## Copyright (C) 2016 Free Software Foundation, Inc.
+##
+## This file is part of GNU Guile.
+##
+## GNU Guile is free software; you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as
+## published by the Free Software Foundation; either version 3, or (at
+## your option) any later version.
+##
+## GNU Guile is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with GNU Guile; see the file COPYING.LESSER. If not,
+## write to the Free Software Foundation, Inc., 51 Franklin Street,
+## Fifth Floor, Boston, MA 02110-1301 USA
+
+# Guile Scheme is mostly written in Guile Scheme. Its compiler is
+# written in Guile Scheme, and its interpreter too. However, it is not
+# bootstrapped from itself: Guile includes a minimal interpreter written
+# in C as well which can load the compiler, enough to compile the
+# interpreter written in Scheme. That compiled interpreter written in
+# Scheme is then used to compile the rest of Guile, including the
+# compiler itself.
+#
+# The problem is, this process takes a long time, and for people
+# installing Guile from source, it's their first experience of Guile: an
+# hour-long bootstrap. It's not the nicest experience. To avoid this,
+# in our tarballs we pre-build object files for the essential parts of
+# the compiler.
+#
+# In the future we will do native compilation and so we will need to
+# precompile object files for all common host types. Still, since we
+# use ELF everywhere, there will be many host types whose compiled files
+# are the same: because Guile incorporates its own linker and loader for
+# compiled Scheme files, any AArch64 machine, for example, is going to
+# have the same compiled files. So, for the variants that will be the
+# same, we compile one target triple, and symlink the similar targets to
+# that directory.
+#
+# The current situation though is that we compile to bytecode, and there
+# are only four variants of that bytecode: big- or little-endian, and
+# 32- or 64-bit. The strategy is the same, only that now
+# arm64-unknown-linux-gnu will link to x86_64-unknown-linux-gnu, as they
+# have the same word size and endianness. A pending issue to resolve is
+# how this wil deal with architectures where longs are 32 bits and
+# pointers are 64 bits; we'll let the x32 people deal with that.
+
+SUBDIRS = \
+ x86_64-unknown-linux-gnu \
+ i686-pc-linux-gnu \
+ mips-unknown-linux-gnu
diff --git a/prebuilt/i686-pc-linux-gnu/Makefile.am
b/prebuilt/i686-pc-linux-gnu/Makefile.am
new file mode 100644
index 0000000..6b56834
--- /dev/null
+++ b/prebuilt/i686-pc-linux-gnu/Makefile.am
@@ -0,0 +1,25 @@
+## Process this file with automake to produce Makefile.in.
+##
+## Copyright (C) 2016 Free Software Foundation, Inc.
+##
+## This file is part of GNU Guile.
+##
+## GNU Guile is free software; you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as
+## published by the Free Software Foundation; either version 3, or (at
+## your option) any later version.
+##
+## GNU Guile is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with GNU Guile; see the file COPYING.LESSER. If not,
+## write to the Free Software Foundation, Inc., 51 Franklin Street,
+## Fifth Floor, Boston, MA 02110-1301 USA
+
+GUILE_TARGET = $(shell basename $(subdir))
+GUILE_BUILD_TAG = PREBUILD $(GUILE_TARGET)
+
+include $(top_srcdir)/am/bootstrap.am
diff --git a/prebuilt/mips-unknown-linux-gnu/Makefile.am
b/prebuilt/mips-unknown-linux-gnu/Makefile.am
new file mode 100644
index 0000000..6b56834
--- /dev/null
+++ b/prebuilt/mips-unknown-linux-gnu/Makefile.am
@@ -0,0 +1,25 @@
+## Process this file with automake to produce Makefile.in.
+##
+## Copyright (C) 2016 Free Software Foundation, Inc.
+##
+## This file is part of GNU Guile.
+##
+## GNU Guile is free software; you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as
+## published by the Free Software Foundation; either version 3, or (at
+## your option) any later version.
+##
+## GNU Guile is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with GNU Guile; see the file COPYING.LESSER. If not,
+## write to the Free Software Foundation, Inc., 51 Franklin Street,
+## Fifth Floor, Boston, MA 02110-1301 USA
+
+GUILE_TARGET = $(shell basename $(subdir))
+GUILE_BUILD_TAG = PREBUILD $(GUILE_TARGET)
+
+include $(top_srcdir)/am/bootstrap.am
diff --git a/prebuilt/x86_64-unknown-linux-gnu/Makefile.am
b/prebuilt/x86_64-unknown-linux-gnu/Makefile.am
new file mode 100644
index 0000000..6b56834
--- /dev/null
+++ b/prebuilt/x86_64-unknown-linux-gnu/Makefile.am
@@ -0,0 +1,25 @@
+## Process this file with automake to produce Makefile.in.
+##
+## Copyright (C) 2016 Free Software Foundation, Inc.
+##
+## This file is part of GNU Guile.
+##
+## GNU Guile is free software; you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as
+## published by the Free Software Foundation; either version 3, or (at
+## your option) any later version.
+##
+## GNU Guile is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with GNU Guile; see the file COPYING.LESSER. If not,
+## write to the Free Software Foundation, Inc., 51 Franklin Street,
+## Fifth Floor, Boston, MA 02110-1301 USA
+
+GUILE_TARGET = $(shell basename $(subdir))
+GUILE_BUILD_TAG = PREBUILD $(GUILE_TARGET)
+
+include $(top_srcdir)/am/bootstrap.am
- [Guile-commits] branch master updated (ee85113 -> 5fceaed), Andy Wingo, 2016/02/01
- [Guile-commits] 05/10: Dist the prebuilt .go files, Andy Wingo, 2016/02/01
- [Guile-commits] 02/10: Fix cross-compilation of immediates to targets with different word sizes, Andy Wingo, 2016/02/01
- [Guile-commits] 01/10: Fix type inference of integer division, Andy Wingo, 2016/02/01
- [Guile-commits] 10/10: Update NEWS., Andy Wingo, 2016/02/01
- [Guile-commits] 03/10: Distribute prebuilt bootstraps for common hosts,
Andy Wingo <=
- [Guile-commits] 04/10: Fix uniform vector compilation to foreign byte orders., Andy Wingo, 2016/02/01
- [Guile-commits] 07/10: Frame <binding> objects capture frame, can ref value directly, Andy Wingo, 2016/02/01
- [Guile-commits] 08/10: Better call-counting profiles in statprof, Andy Wingo, 2016/02/01
- [Guile-commits] 06/10: Remove frame-local-ref, frame-local-set!, Andy Wingo, 2016/02/01
- [Guile-commits] 09/10: Update statprof documentation; deprecate `with-statprof', Andy Wingo, 2016/02/01