aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-11-17 03:32:33 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-11-17 03:32:33 +0000
commit8b2e1419cf24a33df5a87c99e367528b44dc28cf (patch)
treedfa50da1818a1e9c1d0588c060051c65583821a3
parentb2b9c20b6121a54a41ee1c583a4bff4389622da2 (diff)
Undo removal of the runtime libraries. While this may have been a bit
premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31807 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Makefile13
-rw-r--r--Makefile.config.in5
-rw-r--r--Makefile.rules8
-rw-r--r--autoconf/configure.ac16
-rwxr-xr-xconfigure88
-rw-r--r--runtime/GC/GCInterface.h48
-rw-r--r--runtime/GC/Makefile19
-rw-r--r--runtime/GC/SemiSpace/Makefile19
-rw-r--r--runtime/GC/SemiSpace/semispace.c122
-rw-r--r--runtime/GC/gc_exported_symbols.lst7
-rw-r--r--runtime/GCCLibraries/Makefile12
-rw-r--r--runtime/GCCLibraries/README.txt7
-rw-r--r--runtime/GCCLibraries/crtend/Exception.cpp54
-rw-r--r--runtime/GCCLibraries/crtend/Exception.h71
-rw-r--r--runtime/GCCLibraries/crtend/Makefile83
-rw-r--r--runtime/GCCLibraries/crtend/README.txt15
-rw-r--r--runtime/GCCLibraries/crtend/SJLJ-Exception.cpp146
-rw-r--r--runtime/GCCLibraries/crtend/SJLJ-Exception.h80
-rw-r--r--runtime/GCCLibraries/crtend/comp_genericeh.lst9
-rw-r--r--runtime/GCCLibraries/crtend/comp_main.lst3
-rw-r--r--runtime/GCCLibraries/crtend/comp_sjljeh.lst7
-rw-r--r--runtime/GCCLibraries/crtend/crtend.c16
-rw-r--r--runtime/GCCLibraries/libc/COPYING.LIB510
-rw-r--r--runtime/GCCLibraries/libc/LICENSE.TXT17
-rw-r--r--runtime/GCCLibraries/libc/LICENSES219
-rw-r--r--runtime/GCCLibraries/libc/Makefile19
-rw-r--r--runtime/GCCLibraries/libc/README.txt4
-rw-r--r--runtime/GCCLibraries/libc/atox.c118
-rw-r--r--runtime/GCCLibraries/libc/io.c18
-rw-r--r--runtime/GCCLibraries/libc/qsort.c261
-rw-r--r--runtime/GCCLibraries/libc/remove.c51
-rw-r--r--runtime/GCCLibraries/libc/string.c172
-rw-r--r--runtime/GCCLibraries/libgcc/Makefile16
-rw-r--r--runtime/GCCLibraries/libgcc/eprintf.c13
-rw-r--r--runtime/GCCLibraries/libm/Makefile16
-rw-r--r--runtime/GCCLibraries/libm/temp.c1
-rw-r--r--runtime/Makefile43
-rw-r--r--runtime/README.txt4
-rw-r--r--runtime/libdummy/Makefile19
-rw-r--r--runtime/libdummy/README.txt2
-rw-r--r--runtime/libdummy/dummylib.c144
-rw-r--r--runtime/libprofile/BasicBlockTracing.c67
-rw-r--r--runtime/libprofile/BlockProfiling.c45
-rw-r--r--runtime/libprofile/CommonProfiling.c117
-rw-r--r--runtime/libprofile/EdgeProfiling.c45
-rw-r--r--runtime/libprofile/FunctionProfiling.c42
-rw-r--r--runtime/libprofile/Makefile19
-rw-r--r--runtime/libprofile/Profiling.h31
-rw-r--r--runtime/libprofile/exported_symbols.lst5
-rw-r--r--runtime/libtrace/Makefile18
-rw-r--r--runtime/libtrace/README.txt2
-rw-r--r--runtime/libtrace/tracelib.c392
-rw-r--r--runtime/libtrace/tracelib.h40
53 files changed, 3282 insertions, 36 deletions
diff --git a/Makefile b/Makefile
index 97a738805d..c45ac976dd 100644
--- a/Makefile
+++ b/Makefile
@@ -15,23 +15,28 @@ LEVEL := .
# 3. Build VMCore, which builds the Intrinsics.inc file used by libs.
# 4. Build libs, which are needed by llvm-config.
# 5. Build llvm-config, which determines inter-lib dependencies for tools.
-# 6. Build tools, docs.
+# 6. Build tools, runtime, docs.
#
DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \
- tools docs
+ tools runtime docs
OPTIONAL_DIRS := examples projects
EXTRA_DIST := test llvm.spec include win32 Xcode
include $(LEVEL)/Makefile.config
+# llvm-gcc4 doesn't need runtime libs.
+ifeq ($(LLVMGCC_MAJVERS),4)
+ DIRS := $(filter-out runtime, $(DIRS))
+endif
+
ifeq ($(MAKECMDGOALS),libs-only)
- DIRS := $(filter-out tools docs, $(DIRS))
+ DIRS := $(filter-out tools runtime docs, $(DIRS))
OPTIONAL_DIRS :=
endif
ifeq ($(MAKECMDGOALS),tools-only)
- DIRS := $(filter-out docs, $(DIRS))
+ DIRS := $(filter-out runtime docs, $(DIRS))
OPTIONAL_DIRS :=
endif
diff --git a/Makefile.config.in b/Makefile.config.in
index f005c69412..2652db3bb9 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -207,6 +207,11 @@ OBJ_ROOT := .
#DISABLE_ASSERTIONS = 1
@DISABLE_ASSERTIONS@
+# When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug
+# symbols.
+#DEBUG_RUNTIME = 1
+@DEBUG_RUNTIME@
+
# When ENABLE_PROFILING is enabled, the llvm source base is built with profile
# information to allow gprof to be used to get execution frequencies.
#ENABLE_PROFILING = 1
diff --git a/Makefile.rules b/Makefile.rules
index a8b1b8056d..f80cc25489 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -1099,10 +1099,18 @@ $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
$(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
$(MAYBE_PIC_Compile.C) $< -o $@ -S
+
# make the C and C++ compilers strip debug info out of bytecode libraries.
+ifdef DEBUG_RUNTIME
+$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS)
+ $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
+ $(Verb) $(GCCAS) $< -o $@
+else
$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS)
$(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
$(Verb) $(GCCAS) -strip-debug $< -o $@
+endif
+
#---------------------------------------------------------
# Provide rule to build .bc files from .ll sources,
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 445e1ba911..4b9e0c31fd 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -268,6 +268,15 @@ else
AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
fi
+dnl --enable-debug-runtime : should runtime libraries have debug symbols?
+AC_ARG_ENABLE(debug-runtime,
+ AS_HELP_STRING([--enable-debug-runtime,Build runtime libs with debug symbols (default is NO)]),,enableval=no)
+if test ${enableval} = "no" ; then
+ AC_SUBST(DEBUG_RUNTIME,[[]])
+else
+ AC_SUBST(DEBUG_RUNTIME,[[DEBUG_RUNTIME=1]])
+fi
+
dnl --enable-jit: check whether they want to enable the jit
AC_ARG_ENABLE(jit,
AS_HELP_STRING(--enable-jit,
@@ -811,6 +820,7 @@ AC_CONFIG_MAKEFILE(Makefile)
AC_CONFIG_MAKEFILE(Makefile.common)
AC_CONFIG_MAKEFILE(examples/Makefile)
AC_CONFIG_MAKEFILE(lib/Makefile)
+AC_CONFIG_MAKEFILE(runtime/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile.tests)
AC_CONFIG_MAKEFILE(tools/Makefile)
@@ -823,6 +833,8 @@ AC_OUTPUT
dnl Warn loudly if llvm-gcc was not obviously working
if test "$llvm_cv_llvmgcc_sanity" = "no" ; then
AC_MSG_WARN([***** llvm-gcc/llvm-g++ was not found, or does not appear to be ])
- AC_MSG_WARN([***** working. Please make sure you have llvm-gcc and llvm-g++ ])
- AC_MSG_WARN([***** in your path before configuring LLVM.])
+ AC_MSG_WARN([***** working. Please make sure you have llvm-gcc and llvm-g++ in])
+ AC_MSG_WARN([***** your path before configuring LLVM. The runtime libraries])
+ AC_MSG_WARN([***** (llvm/runtime) will not be built but you should be able to])
+ AC_MSG_WARN([***** build the llvm tools.])
fi
diff --git a/configure b/configure
index 7de451773d..7ae686b76d 100755
--- a/configure
+++ b/configure
@@ -830,6 +830,7 @@ BUILD_EXEEXT
CVSBUILD
ENABLE_OPTIMIZED
DISABLE_ASSERTIONS
+DEBUG_RUNTIME
JIT
TARGET_HAS_JIT
ENABLE_DOXYGEN
@@ -1519,6 +1520,7 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-optimized
--enable-assertions
+ --enable-debug-runtime
--enable-jit Enable Just In Time Compiling (default is YES)
--enable-doxygen Build doxygen documentation (default is NO)
--enable-threads Use threads if available (default is YES)
@@ -4561,6 +4563,21 @@ else
fi
+# Check whether --enable-debug-runtime was given.
+if test "${enable_debug_runtime+set}" = set; then
+ enableval=$enable_debug_runtime;
+else
+ enableval=no
+fi
+
+if test ${enableval} = "no" ; then
+ DEBUG_RUNTIME=
+
+else
+ DEBUG_RUNTIME=DEBUG_RUNTIME=1
+
+fi
+
# Check whether --enable-jit was given.
if test "${enable_jit+set}" = set; then
enableval=$enable_jit;
@@ -10281,7 +10298,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10284 "configure"
+#line 10301 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12425,7 +12442,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 12428 "configure"' > conftest.$ac_ext
+ echo '#line 12445 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -14143,11 +14160,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14146: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14163: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14150: \$? = $ac_status" >&5
+ echo "$as_me:14167: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14411,11 +14428,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14414: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14431: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14418: \$? = $ac_status" >&5
+ echo "$as_me:14435: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14515,11 +14532,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14518: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14535: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14522: \$? = $ac_status" >&5
+ echo "$as_me:14539: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16967,7 +16984,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 16970 "configure"
+#line 16987 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17067,7 +17084,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 17070 "configure"
+#line 17087 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19435,11 +19452,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19438: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19455: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:19442: \$? = $ac_status" >&5
+ echo "$as_me:19459: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -19539,11 +19556,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19542: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19559: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:19546: \$? = $ac_status" >&5
+ echo "$as_me:19563: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -21109,11 +21126,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21112: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21129: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:21116: \$? = $ac_status" >&5
+ echo "$as_me:21133: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21213,11 +21230,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21216: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21233: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:21220: \$? = $ac_status" >&5
+ echo "$as_me:21237: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -23448,11 +23465,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:23451: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:23468: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:23455: \$? = $ac_status" >&5
+ echo "$as_me:23472: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -23716,11 +23733,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:23719: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:23736: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:23723: \$? = $ac_status" >&5
+ echo "$as_me:23740: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -23820,11 +23837,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:23823: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:23840: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:23827: \$? = $ac_status" >&5
+ echo "$as_me:23844: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -33414,6 +33431,9 @@ ac_config_commands="$ac_config_commands examples/Makefile"
ac_config_commands="$ac_config_commands lib/Makefile"
+ac_config_commands="$ac_config_commands runtime/Makefile"
+
+
ac_config_commands="$ac_config_commands test/Makefile"
@@ -34007,6 +34027,7 @@ do
"Makefile.common") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.common" ;;
"examples/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS examples/Makefile" ;;
"lib/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;;
+ "runtime/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS runtime/Makefile" ;;
"test/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile" ;;
"test/Makefile.tests") CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile.tests" ;;
"tools/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;;
@@ -34148,6 +34169,7 @@ BUILD_EXEEXT!$BUILD_EXEEXT$ac_delim
CVSBUILD!$CVSBUILD$ac_delim
ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
+DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
JIT!$JIT$ac_delim
TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim
ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
@@ -34170,7 +34192,6 @@ ifGNUmake!$ifGNUmake$ac_delim
LN_S!$LN_S$ac_delim
CMP!$CMP$ac_delim
CP!$CP$ac_delim
-DATE!$DATE$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -34212,6 +34233,7 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+DATE!$DATE$ac_delim
FIND!$FIND$ac_delim
MKDIR!$MKDIR$ac_delim
MV!$MV$ac_delim
@@ -34277,7 +34299,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 63; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 64; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -34688,6 +34710,8 @@ echo "$as_me: executing $ac_file commands" >&6;}
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/examples/Makefile examples/Makefile ;;
"lib/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile`
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/Makefile lib/Makefile ;;
+ "runtime/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname runtime/Makefile`
+ ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/runtime/Makefile runtime/Makefile ;;
"test/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile`
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/test/Makefile test/Makefile ;;
"test/Makefile.tests":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile.tests`
@@ -34909,8 +34933,12 @@ fi
if test "$llvm_cv_llvmgcc_sanity" = "no" ; then
{ echo "$as_me:$LINENO: WARNING: ***** llvm-gcc/llvm-g++ was not found, or does not appear to be " >&5
echo "$as_me: WARNING: ***** llvm-gcc/llvm-g++ was not found, or does not appear to be " >&2;}
- { echo "$as_me:$LINENO: WARNING: ***** working. Please make sure you have llvm-gcc and llvm-g++ " >&5
-echo "$as_me: WARNING: ***** working. Please make sure you have llvm-gcc and llvm-g++ " >&2;}
- { echo "$as_me:$LINENO: WARNING: ***** in your path before configuring LLVM." >&5
-echo "$as_me: WARNING: ***** in your path before configuring LLVM." >&2;}
+ { echo "$as_me:$LINENO: WARNING: ***** working. Please make sure you have llvm-gcc and llvm-g++ in" >&5
+echo "$as_me: WARNING: ***** working. Please make sure you have llvm-gcc and llvm-g++ in" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ***** your path before configuring LLVM. The runtime libraries" >&5
+echo "$as_me: WARNING: ***** your path before configuring LLVM. The runtime libraries" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ***** (llvm/runtime) will not be built but you should be able to" >&5
+echo "$as_me: WARNING: ***** (llvm/runtime) will not be built but you should be able to" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ***** build the llvm tools." >&5
+echo "$as_me: WARNING: ***** build the llvm tools." >&2;}
fi
diff --git a/runtime/GC/GCInterface.h b/runtime/GC/GCInterface.h
new file mode 100644
index 0000000000..4eb48183bc
--- /dev/null
+++ b/runtime/GC/GCInterface.h
@@ -0,0 +1,48 @@
+/*===-- GCInterface.h - Public interface exposed by garbage collectors ----===*\
+|*
+|* The LLVM Compiler Infrastructure
+|*
+|* This file was developed by the LLVM research group and is distributed under
+|* the University of Illinois Open Source License. See LICENSE.TXT for details.
+|*
+|*===----------------------------------------------------------------------===*|
+|*
+|* This file defines the common public interface that must be exposed by all
+|* LLVM garbage collectors.
+|*
+\*===----------------------------------------------------------------------===*/
+
+#ifndef GCINTERFACE_H
+#define GCINTERFACE_H
+
+/* llvm_cg_walk_gcroots - This function is exposed by the LLVM code generator,
+ * and allows us to traverse the roots on the stack.
+ */
+void llvm_cg_walk_gcroots(void (*FP)(void **Root, void *Meta));
+
+
+/* llvm_gc_initialize - This function is called to initalize the garbage
+ * collector.
+ */
+void llvm_gc_initialize(unsigned InitialHeapSize);
+
+/* llvm_gc_allocate - This function allocates Size bytes from the heap and
+ * returns a pointer to it.
+ */
+void *llvm_gc_allocate(unsigned Size);
+
+/* llvm_gc_collect - This function forces a garbage collection cycle.
+ */
+void llvm_gc_collect();
+
+/* llvm_gc_read - This function should be implemented to include any read
+ * barrier code that is needed by the garbage collector.
+ */
+void *llvm_gc_read(void *ObjPtr, void **FieldPtr);
+
+/* llvm_gc_write - This function should be implemented to include any write
+ * barrier code that is needed by the garbage collector.
+ */
+void llvm_gc_write(void *V, void *ObjPtr, void **FieldPtr);
+
+#endif
diff --git a/runtime/GC/Makefile b/runtime/GC/Makefile
new file mode 100644
index 0000000000..b57dc85907
--- /dev/null
+++ b/runtime/GC/Makefile
@@ -0,0 +1,19 @@
+##===- runtime/GC/Makefile ---------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file was developed by the LLVM research group and is distributed under
+# the University of Illinois Open Source License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../..
+PARALLEL_DIRS := SemiSpace
+EXTRA_DIST := gc_exported_symbols.lst
+include $(LEVEL)/Makefile.common
+
+# Install target for libraries: Copy into $LLVMGCCDIR/bytecode-libs
+#
+install::
+
+clean::
diff --git a/runtime/GC/SemiSpace/Makefile b/runtime/GC/SemiSpace/Makefile
new file mode 100644
index 0000000000..6f8e54ce27
--- /dev/null
+++ b/runtime/GC/SemiSpace/Makefile
@@ -0,0 +1,19 @@
+##===- runtime/GC/SemiSpace/Makefile -----------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file was developed by the LLVM research group and is distributed under
+# the University of Illinois Open Source License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../../..
+BYTECODE_LIBRARY = 1
+LIBRARYNAME = gcsemispace
+BYTECODE_DESTINATION = $(CFERuntimeLibDir)
+EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/../gc_exported_symbols.lst
+
+include $(LEVEL)/Makefile.common
+
+CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts))
+CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts))
diff --git a/runtime/GC/SemiSpace/semispace.c b/runtime/GC/SemiSpace/semispace.c
new file mode 100644
index 0000000000..cb5864b0bd
--- /dev/null
+++ b/runtime/GC/SemiSpace/semispace.c
@@ -0,0 +1,122 @@
+/*===-- semispace.c - Simple semi-space copying garbage collector ---------===*\
+|*
+|* The LLVM Compiler Infrastructure
+|*
+|* This file was developed by the LLVM research group and is distributed under
+|* the University of Illinois Open Source License. See LICENSE.TXT for details.
+|*
+|*===----------------------------------------------------------------------===*|
+|*
+|* This garbage collector is an extremely simple copying collector. It splits
+|* the managed region of memory into two pieces: the current space to allocate
+|* from, and the copying space. When the portion being allocated from fills up,
+|* a garbage collection cycle happens, which copies all live blocks to the other
+|* half of the managed space.
+|*
+\*===----------------------------------------------------------------------===*/
+
+#include "../GCInterface.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* AllocPtr - This points to the next byte that is available for allocation.
+ */
+static char *AllocPtr;
+
+/* AllocEnd - This points to the first byte not available for allocation. When
+ * AllocPtr passes this, we have run out of space.
+ */
+static char *AllocEnd;
+
+/* CurSpace/OtherSpace - These pointers point to the two regions of memory that
+ * we switch between. The unallocated portion of the CurSpace is known to be
+ * zero'd out, but the OtherSpace contains junk.
+ */
+static void *CurSpace, *OtherSpace;
+
+/* SpaceSize - The size of each space. */
+static unsigned SpaceSize;
+
+/* llvm_gc_initialize - Allocate the two spaces that we plan to switch between.
+ */
+void llvm_gc_initialize(unsigned InitialHeapSize) {
+ SpaceSize = InitialHeapSize/2;
+ CurSpace = AllocPtr = calloc(1, SpaceSize);
+ OtherSpace = malloc(SpaceSize);
+ AllocEnd = AllocPtr + SpaceSize;
+}
+
+/* We always want to inline the fast path, but never want to inline the slow
+ * path.