mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-25 20:59:51 +00:00
Add support for building a runtime library for LLI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@983 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c74a720204
commit
4a82271451
@ -5,3 +5,15 @@ TOOLLINKOPTS = -ldl
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
all :: $(LEVEL)/tools/Debug/RuntimeLib.bc
|
||||
|
||||
Debug/RuntimeLib.c: RuntimeLib.lc
|
||||
cp -f $< $@
|
||||
|
||||
Debug/RuntimeLib.o: Debug/RuntimeLib.c
|
||||
/home/vadve/lattner/cvs/gcc_install/bin/gcc $< -c -o $@
|
||||
|
||||
$(LEVEL)/tools/Debug/RuntimeLib.bc: Debug/RuntimeLib.o
|
||||
opt -dce $< -o $@ -f -q
|
||||
|
||||
|
||||
|
@ -5,3 +5,15 @@ TOOLLINKOPTS = -ldl
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
all :: $(LEVEL)/tools/Debug/RuntimeLib.bc
|
||||
|
||||
Debug/RuntimeLib.c: RuntimeLib.lc
|
||||
cp -f $< $@
|
||||
|
||||
Debug/RuntimeLib.o: Debug/RuntimeLib.c
|
||||
/home/vadve/lattner/cvs/gcc_install/bin/gcc $< -c -o $@
|
||||
|
||||
$(LEVEL)/tools/Debug/RuntimeLib.bc: Debug/RuntimeLib.o
|
||||
opt -dce $< -o $@ -f -q
|
||||
|
||||
|
||||
|
25
tools/lli/RuntimeLib.lc
Normal file
25
tools/lli/RuntimeLib.lc
Normal file
@ -0,0 +1,25 @@
|
||||
//===-- RuntimeLib.lc - LLVM Standard C Runtime Library -----------*- C -*-===//
|
||||
//
|
||||
// This file contains definitions of C functions that are useful to get LLVM
|
||||
// programs up and running. This library of functions is automatically linked
|
||||
// into programs loaded into LLI.
|
||||
//
|
||||
// This file is compiled by the LLVM port of GCC to get LLVM code.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Prototypes for functions exported by LLI directly.
|
||||
void exit(int Code);
|
||||
int putchar(int);
|
||||
|
||||
// The puts() function writes the string pointed to by s, followed by a
|
||||
// NEWLINE character, to the standard output stream stdout. On success the
|
||||
// number of characters written is returned; otherwise they return EOF.
|
||||
//
|
||||
int puts(const char *S) {
|
||||
const char *Str = S;
|
||||
while (*Str) putchar(*Str++);
|
||||
putchar('\n');
|
||||
return Str+1-S;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user