summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/ChangeLog.melt4
-rw-r--r--contrib/cold-basilys.lisp4
-rw-r--r--gcc/ChangeLog.melt9
-rw-r--r--gcc/Makefile.in32
-rw-r--r--gcc/melt-cc-script.proto12
-rw-r--r--gcc/run-basilys.h26
6 files changed, 65 insertions, 22 deletions
diff --git a/contrib/ChangeLog.melt b/contrib/ChangeLog.melt
new file mode 100644
index 00000000000..fa46a65c551
--- /dev/null
+++ b/contrib/ChangeLog.melt
@@ -0,0 +1,4 @@
+
+2008-03-20 Basile Starynkevitch <basile@starynkevitch.net>
+ * cold-basilys.lisp: removed invocation if indent & basilys-gcc programs.
+ (output_ccode) added newline emission after outputting preprocessor directives.
diff --git a/contrib/cold-basilys.lisp b/contrib/cold-basilys.lisp
index b2766c781ee..18402f452d1 100644
--- a/contrib/cold-basilys.lisp
+++ b/contrib/cold-basilys.lisp
@@ -3698,7 +3698,7 @@ nil)
(format str " const char xargdescr_[],~%")
(format str " union basilysparam_un* xargtab_,~%")
(format str " const char xresdescr_[],~%")
- (format str " union basilysparam_un* xrestab_)~%{")
+ (format str " union basilysparam_un* xrestab_)~%{~%")
(format str "#if ENABLE_CHECKING~%")
(format str " static long thiscallcounter__;~%")
(format str " long callcount_ = ++thiscallcounter__;~%")
@@ -3743,7 +3743,7 @@ nil)
(format str "/* body ~d end */~%" rk)
(format str " lab_endrout:~%")
(format str "basilys_check_call_frames(BASILYS_ANYWHERE, \"end ~a\");~%" (routinecname obj))
- (format str " basilys_topframe= (void*)(curfram__.prev); return curfram__.varptr[0];")
+ (format str " basilys_topframe= (void*)(curfram__.prev); return curfram__.varptr[0];~%")
(format str "#undef callcount~%")
(format str "} /* end rout_~d */~%~%" rk)
(setf (compilation-currout this_compilation) oldcurout)
diff --git a/gcc/ChangeLog.melt b/gcc/ChangeLog.melt
index eede9775a32..08b0ff4734d 100644
--- a/gcc/ChangeLog.melt
+++ b/gcc/ChangeLog.melt
@@ -1,5 +1,14 @@
2008-03-20 Basile Starynkevitch <basile@starynkevitch.net>
+ * Makefile.in: added @DEFS@ to MELT_CFLAGS. Better run-basilys.d
+ target (still specific to some systems like linux; depcomp should
+ be used...). Added ugly temporary kludge to build
+ coldbuilt-warm-basilys.c & coldbuilt-warm-basilys.so on Linux thru
+ clisp & contrib/coldbasilys.lisp. built-melt-cc-script better built.
+ * melt-cc-script.proto: corrected typos.
+ * run-basilys.h: working at last.
+
+2008-03-20 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r133366.
* basilys.c: pass_basilys is now a gimple_opt_pass.
* tree-pass.h: pass_basilys is now a gimple_opt_pass.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 2780de4c29a..f37d9bfb477 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -4552,7 +4552,7 @@ melt_build_include_dir= melt-private-build-include
## the C flags (without any gcc -I...stuff) to be included in
## compilation of MELT generated C code thru the melt-cc-script
## do not put $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) there!
-MELT_CFLAGS= $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
+MELT_CFLAGS= $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) $(INTERNAL_CFLAGS) @DEFS@
# we want to generate all the direct (non system) dependencies of run-basilys.h
# the following should work if $(CC) is some recent version of GCC (probably >= 4.x)
@@ -4570,7 +4570,7 @@ run-basilys.d: run-basilys.h \
tree-pass.h basilys.h gt-basilys.h
## perhaps this should really use depcomp, because this works only if
## CC is some gcc 4.x since it use the precompiled headers feature
- $(CC) -MT run-basilys-deps -MMD $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< -o run-basilys.h.gch
+ $(CC) -MT run-basilys-deps -MMD -MF $@ $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< -o run-basilys.h.gch
.PHONY: run-basilys-deps
## the include below defines the dependencies of run-basilys-deps
@@ -4599,8 +4599,27 @@ run-basilys-deps:
## we have to invoke make recursively, because run-basilys.d is a -include-d dependency file
melt.encap: run-basilys.d
echo '***' IN melt.encap TARGET '***'
- $(MAKE) run-basilys-deps built-melt-cc-script
-
+ $(MAKE) run-basilys-deps built-melt-cc-script
+## !!! TEMPORARY KLUDGE !!!
+# this is a ugly temporary hack, working probably only on Linux machines (hosts) with CLISP
+ $(MAKE) coldbuilt-warm-basilys.so
+
+## !!! TEMPORARY KLUDGE !!! WARNING: the warm-basilys.c file should
+## really be generated by bootstrapping in the following sense:
+## warm-basilys.c is made from melt/warm-basilys.bysl by "itself",
+## more precisely by the dynamically loadable stuff (like
+## warm-basilys.so on Linux) with a basilys/MELT enabled cc1 compiler.
+## However in march 2008 this self-generation was buggy, so we still
+## use the contrib/cold-basilys.lisp code to (temporarily) generated
+## warm-basilys.c from melt/warm-basilys.bysl. When this shall be
+## debugged, we'll drop the use of our clisp cold-basilys.lisp code
+
+coldbuilt-warm-basilys.so: built-melt-cc-script coldbuilt-warm-basilys.c
+ sh $^ $@
+coldbuilt-warm-basilys.c: $(srcdir)/../contrib/cold-basilys.lisp $(srcdir) melt/warm-basilys.bysl
+ clisp -C -x "(load \"$(srcdir)/../contrib/cold-basilys.lisp\")" \
+ -x "(handle-source-file \"$(srcdir)/melt/warm-basilys.bysl\" \"tmp-$@\")"
+ $(SHELL) $(srcdir)/../move-if-change tmp-$@ $@
.PHONY: install-melt-headers
@@ -4635,17 +4654,18 @@ install-melt-headers-cp: install-melt-include-dir
.PHONY: install-melt-cc-script
## this file is actually built
-built-melt-cc-script: melt-cc-script.proto
+built-melt-cc-script: melt-cc-script.proto run-basilys-deps
## the #:! lines should be removed, and in first twenty lines :MELT_GCC:
## :MELT_CFLAGS: :MELT_HEADERDIR: :MELT_SCRIPT: should be substituted
sed -e s/^.:!.*// -e '1,30s/:MELT_CC:/$(CC)/' \
-e '1,30s/:MELT_CFLAGS:/$(MELT_CFLAGS)/' \
-e '1,30s/:MELT_SCRIPT:/built-melt-cc-script/' \
-e '1,30s/:MELT_HEADERDIR:/$(melt_build_include_dir)/' \
- < $^ > tmp-built-melt-cc-script
+ < $< > tmp-built-melt-cc-script
$(SHELL) $(srcdir)/../move-if-change tmp-built-melt-cc-script built-melt-cc-script
chmod u+x built-melt-cc-script
+
# Create or recreate the gcc melt private include file directory.
install-melt-include-dir: installdirs
$(mkinstalldirs) $(DESTDIR)$(melt_private_include_dir)
diff --git a/gcc/melt-cc-script.proto b/gcc/melt-cc-script.proto
index a143824a0b6..f1eec90ef9d 100644
--- a/gcc/melt-cc-script.proto
+++ b/gcc/melt-cc-script.proto
@@ -21,6 +21,8 @@
# <http://www.gnu.org/licenses/>.
#:! :MELT_CC: & :MELT_CFLAGS: &:MELT_HEADERDIR: are substituted in the first 30 lines
+set -x
+
melt_cc=":MELT_CC:"
melt_cflags=":MELT_CFLAGS:"
melt_headerdir=":MELT_HEADERDIR:"
@@ -29,9 +31,9 @@ melt_headerdir=":MELT_HEADERDIR:"
## and the naked (without suffix) dynamically-loadable stuff to generate
csource=$1
-nakedynstuff=$2
+nakedynstuff=`basename $2`
datf=`tempfile -p bdat`
-if { -z "$datf" ]; then
+if [ -z "$datf" ]; then
datf=/tmp/bdat$$
fi
# generate the temporary timestamp & md5s file
@@ -43,11 +45,11 @@ date "+const char basilys_compiled_timestamp[]=\"$csource %c\";" > $datf.c
echo "const char basilys_md5[]=\"$md5src\";" >> $datf.c
case `uname` in
Linux|SunOS|Solaris)
- $melt_cc -fPIC -shared $melt_cflags -I "$melt_headerdir" $csource $datf.c -o $makedynstuff.so;;
+ $melt_cc -fPIC -shared $melt_cflags -I "$melt_headerdir" $csource $datf.c -o $nakedynstuff.so;;
*)
- libtool --mode=compile -prefer-pic $melt_cc $csource -I "$melt_headerdir" -o $makedynstuff.lo;
+ libtool --mode=compile -prefer-pic $melt_cc $csource -I "$melt_headerdir" -o $nakedynstuff.lo;
libtool --mode=compile -prefer-pic $melt_cc $datf.c -o $datf.lo
- libtool --mode=link -module $melt_cc $makedynstuff.lo $datf.lo -o $makedynstuff.la
+ libtool --mode=link -module $melt_cc $makedynstuff.lo $datf.lo -o $nakedynstuff.la
rm -f $datf.*
;;
esac
diff --git a/gcc/run-basilys.h b/gcc/run-basilys.h
index ab65e65725c..10ea7a660b2 100644
--- a/gcc/run-basilys.h
+++ b/gcc/run-basilys.h
@@ -23,23 +23,31 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-/* usual GCC middle-end includes, copied from ipa-cp.c */
+/* usual GCC middle-end includes, copied from basilys.c */
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "real.h"
+#include "obstack.h"
+#include "tm.h"
#include "tree.h"
-#include "target.h"
-#include "cgraph.h"
-#include "ipa-prop.h"
-#include "tree-flow.h"
+#include "filenames.h"
#include "tree-pass.h"
-#include "flags.h"
+#include "tree-dump.h"
+#include "basic-block.h"
#include "timevar.h"
+#include "errors.h"
+#include "ggc.h"
+#include "cgraph.h"
#include "diagnostic.h"
-#include "tree-dump.h"
-#include "tree-inline.h"
+#include "flags.h"
+#include "toplev.h"
+#include "options.h"
+#include "params.h"
+#include "real.h"
+#include "prefix.h"
+#include "md5.h"
+#include "cppdefault.h"
/* basilys or MELT specific includes */