diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 23 | ||||
| -rw-r--r-- | src/comp/glue.rc | 37 | ||||
| -rw-r--r-- | src/comp/glue/glue.rs | 11 | ||||
| -rw-r--r-- | src/comp/middle/trans.rs | 2 |
4 files changed, 6 insertions, 67 deletions
diff --git a/src/Makefile b/src/Makefile index cafd8d18..a239329f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -90,7 +90,6 @@ ifdef CFG_WINDOWSY CFG_EXE_SUFFIX := .exe CFG_BOOT := ./rustboot.exe CFG_RUSTC := ./rustc.exe - CFG_GLUE := ./glue.exe CFG_GCC_CFLAGS += -march=i686 CFG_GCC_LINK_FLAGS += -shared -fPIC CFG_RUN_TARG = $(1) @@ -102,7 +101,6 @@ ifdef CFG_UNIXY CFG_INFO := $(info cfg: unix-y environment) CFG_BOOT := ./rustboot CFG_RUSTC := ./rustc - CFG_GLUE := ./glue CFG_OBJ_SUFFIX := .o CFG_RUN_TARG = LD_LIBRARY_PATH=. $(CFG_VALGRIND) $(1) CFG_GCC := 1 @@ -113,7 +111,6 @@ ifdef CFG_UNIXY CFG_RUNTIME := rustrt.dll CFG_STDLIB := std.dll CFG_RUSTC := ./rustc.exe - CFG_GLUE := ./glue ifdef CFG_VALGRIND CFG_VALGRIND += wine endif @@ -311,13 +308,11 @@ RUNTIME_LIBS := $(CFG_RUNTIME_LIBS) STDLIB_CRATE := lib/std.rc STDLIB_INPUTS := $(wildcard lib/*.rc lib/*.rs lib/*/*.rs) COMPILER_CRATE := comp/rustc.rc -COMPILER_INPUTS := $(wildcard comp/rustc.rc comp/*.rs comp/*/*.rs) -GLUE_CRATE := comp/glue.rc -GLUE_INPUTS := $(wildcard comp/glue.rc comp/*.rs comp/*/*.rs) +COMPILER_INPUTS := $(wildcard comp/*.rc comp/*.rs comp/*/*.rs) GENERATED := boot/fe/lexer.ml boot/util/version.ml -all: $(CFG_RUSTC) $(CFG_GLUE) $(MKFILES) $(GENERATED) glue.o +all: $(CFG_RUSTC) $(MKFILES) $(GENERATED) boot/util/version.ml: Makefile $(CFG_QUIET)git log -1 \ @@ -373,16 +368,6 @@ $(CFG_RUSTC): $(COMPILER_INPUTS) $(CFG_BOOT) $(CFG_RUNTIME) $(CFG_STDLIB) $(BOOT) -minimal -o $@ $< $(CFG_QUIET)chmod 0755 $@ -$(CFG_GLUE): $(GLUE_INPUTS) $(CFG_BOOT) $(CFG_RUNTIME) $(CFG_STDLIB) - @$(call CFG_ECHO, compile: $<) - $(BOOT) -minimal -o $@ $< - $(CFG_QUIET)chmod 0755 $@ - -glue.o: glue.s - -glue.s: $(CFG_GLUE) - $(CFG_GLUE) > $@ - self: $(CFG_RUSTC) @$(call CFG_ECHO, compile: $<) $(RUSTC) $(COMPILER_CRATE) @@ -778,9 +763,9 @@ test/bench/shootout/%.boot$(CFG_EXE_SUFFIX): \ @$(call CFG_ECHO, assemble [llvm]: $<) $(CFG_QUIET)gcc $(CFG_GCC_CFLAGS) -o $@ -c $< -%.rustc$(CFG_EXE_SUFFIX): %.o $(CFG_RUNTIME) glue.o +%.rustc$(CFG_EXE_SUFFIX): %.o $(CFG_RUNTIME) @$(call CFG_ECHO, link [llvm]: $<) - $(CFG_QUIET)gcc $(CFG_GCC_CFLAGS) glue.o -o $@ $< -L. -lrustrt + $(CFG_QUIET)gcc $(CFG_GCC_CFLAGS) -o $@ $< -L. -lrustrt @# dsymutil sometimes fails or prints a warning, but the @# program still runs. Since it simplifies debugging other @# programs, I\'ll live with the noise. diff --git a/src/comp/glue.rc b/src/comp/glue.rc deleted file mode 100644 index 1048341a..00000000 --- a/src/comp/glue.rc +++ /dev/null @@ -1,37 +0,0 @@ -// -*- rust -*- - -use std; - -mod front { - mod ast; -} - -mod middle { - mod ty; -} - -mod driver { - mod session; -} - -mod glue { - mod glue; -} - -mod back { - mod abi; - mod x86; -} - -mod util { - mod common; -} - - -// Local Variables: -// fill-column: 78; -// indent-tabs-mode: nil -// c-basic-offset: 4 -// buffer-file-coding-system: utf-8-unix -// compile-command: "make -k -C .. 2>&1 | sed -e 's/\\/x\\//x:\\//g'"; -// End: diff --git a/src/comp/glue/glue.rs b/src/comp/glue/glue.rs deleted file mode 100644 index 96bdba76..00000000 --- a/src/comp/glue/glue.rs +++ /dev/null @@ -1,11 +0,0 @@ -import back.x86; -import std._str; -import std._vec; -import std.os.libc; - -fn main(vec[str] args) { - auto module_asm = x86.get_module_asm() + "\n"; - auto bytes = _str.bytes(module_asm); - auto b = _vec.buf[u8](bytes); - libc.write(1, b, _vec.len[u8](bytes)); -} diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index e4512a47..7457a532 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -5708,6 +5708,8 @@ fn trans_crate(session.session sess, @ast.crate crate, str output, let ValueRef crate_ptr = llvm.LLVMAddGlobal(llmod, T_crate(tn), _str.buf("rust_crate")); + llvm.LLVMSetModuleInlineAsm(llmod, _str.buf(x86.get_module_asm())); + auto intrinsics = declare_intrinsics(llmod); auto glues = make_glues(llmod, tn); |