software: compile compiler-rt ourselves
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 10 Jan 2013 16:59:00 +0000 (17:59 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 10 Jan 2013 16:59:00 +0000 (17:59 +0100)
README
software/bios/Makefile
software/libcompiler-rt/Makefile [new file with mode: 0644]

diff --git a/README b/README
index eff63f5135854c41c4c79fe1fac8451230778376..442dbfa58e7b7995f22b5dfae65e5c698c04bef4 100644 (file)
--- a/README
+++ b/README
@@ -7,7 +7,7 @@ introducing two key innovations:
  * Increased system memory performance thanks to a new architecture
    (ASMI) containing a transaction-reordering and superscalar controller.
 
-The Milkymist-NG SoC supports the Milkymist One board. Obtain yours from:
+The Milkymist-NG SoC supports the Milkymist One board. Obtain yours at:
   http://milkymist.org
 
 Note that the -NG version is still experimental work in progress. For the
@@ -31,15 +31,12 @@ production version of Milkymist SoC, visit:
   make
   make install
 
-3. Build compiler-rt.
-  git clone git://github.com/milkymist/compiler-rt-lm32.git
-  cd compiler-rt-lm32
-  make lm32
+3. Obtain compiler-rt and set the CRTDIR environment variable to the root of 
+   its source tree.
+  svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
+  export CRTDIR=/path_to/compiler-rt
 
-4. Set the CRTDIR environment variable to where libcompiler_rt.a is.
-  export CRTDIR=/path_to/compiler-rt-lm32/lm32/lm32
-
-5. Build and flash the BIOS (part of this source distribution).
+4. Build and flash the BIOS (part of this source distribution).
   cd software/bios
   make
   make flash
index 0e2fa364fcc7f6e46c0038108a5952079e3cb4b5..02fe4af1666985ad9bd39cad86effec89ed011f2 100644 (file)
@@ -20,8 +20,8 @@ bios-rescue.elf: linker-rescue.ld $(OBJECTS) libs
 %.elf:
        $(LD) $(LDFLAGS) -T $< -N -o $@ $(OBJECTS) \
                -L$(M2DIR)/software/libbase \
-               -L$(CRTDIR) \
-               -lbase -lcompiler_rt
+               -L$(M2DIR)/software/libcompiler-rt \
+               -lbase -lcompiler-rt
        chmod -x $@
 
 %.o: %.c
@@ -31,6 +31,7 @@ bios-rescue.elf: linker-rescue.ld $(OBJECTS) libs
        $(assemble)
 
 libs:
+       make -C $(M2DIR)/software/libcompiler-rt
        make -C $(M2DIR)/software/libbase
 
 flash: bios.bin
diff --git a/software/libcompiler-rt/Makefile b/software/libcompiler-rt/Makefile
new file mode 100644 (file)
index 0000000..d1f83ad
--- /dev/null
@@ -0,0 +1,24 @@
+M2DIR=../..
+include $(M2DIR)/software/common.mak
+
+CFLAGS+=-D_YUGA_LITTLE_ENDIAN=0 -D_YUGA_BIG_ENDIAN=1 -Wno-missing-prototypes
+
+OBJECTS=divsi3.o modsi3.o comparedf2.o negsf2.o negdf2.o addsf3.o subsf3.o mulsf3.o divsf3.o lshrdi3.o muldi3.o divdi3.o ashldi3.o ashrdi3.o udivmoddi4.o \
+  floatsisf.o floatunsisf.o fixsfsi.o fixunssfsi.o adddf3.o subdf3.o muldf3.o divdf3.o floatsidf.o floatunsidf.o floatdidf.o fixdfsi.o fixunsdfsi.o
+
+all: libcompiler-rt.a
+
+# pull in dependency info for *existing* .o files
+-include $(OBJECTS:.o=.d)
+
+libcompiler-rt.a: $(OBJECTS)
+       $(AR) clr libcompiler-rt.a $(OBJECTS)
+       $(RANLIB) libcompiler-rt.a
+
+%.o: $(CRTDIR)/lib/%.c
+       $(compile-dep)
+
+.PHONY: clean
+
+clean:
+       rm -f $(OBJECTS) $(OBJECTS:.o=.d) libcompiler-rt.a .*~ *~