Skip to content

Commit

Permalink
software: go back to GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed Feb 16, 2013
1 parent c56c916 commit 20003f0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 31 deletions.
1 change: 0 additions & 1 deletion .gitignore
@@ -1,7 +1,6 @@
__pycache__
build/*
*.o
*.ts
*.d
*.a
*.bin
Expand Down
19 changes: 8 additions & 11 deletions README
Expand Up @@ -17,17 +17,15 @@ production version of Milkymist SoC, visit:
[> Instructions (software)
--------------------------
1. Compile and install binutils. Take the latest version from GNU.
./configure --target=lm32-elf
mkdir build && cd build
../configure --target=lm32-elf
make
make install

2. Compile and install LLVM and Clang.
git clone git://github.com/milkymist/llvm-lm32.git
cd llvm-lm32/tools
git clone git://github.com/milkymist/clang-lm32.git clang
cd ..
mkdir build
cmake ..
2. Compile and install GCC 4.5. Take gcc-core and gcc-g++ from GNU.
rm -rf libstdc++-v3
mkdir build && cd build
../configure --target=lm32-elf --enable-languages="c,c++" --disable-libgcc --disable-libssp
make
make install

Expand All @@ -42,8 +40,7 @@ production version of Milkymist SoC, visit:
make flash

The second command requires m1nor, FJMEM and UrJTAG.
These tools can be found respectively at:
http://projects.qi-hardware.com/index.php/p/wernermisc/
These tools can be found at:
https://github.com/milkymist/fjmem-m1
http://urjtag.org

Expand Down Expand Up @@ -84,7 +81,7 @@ The authors grant the additional permissions that the code can be used in
conjunction with the LatticeMico32 CPU core from Lattice.

Unless otherwise noted, Milkymist-NG's source code is copyright (C)
2011-2012 Sebastien Bourdeauducq. Other authors retain ownership of their
2011-2013 Sebastien Bourdeauducq. Other authors retain ownership of their
contributions. If a submission can reasonably be considered independently
copyrightable, it's yours and I encourage you to claim it with
appropriate copyright notices. This submission then falls under the
Expand Down
35 changes: 17 additions & 18 deletions software/common.mak
@@ -1,19 +1,18 @@
TARGET_PREFIX=lm32-elf
CLANG=clang -target lm32
TARGET_PREFIX=lm32-elf-

CC_normal := $(CLANG)
AS_normal := $(TARGET_PREFIX)-as
AR_normal := $(TARGET_PREFIX)-ar
LD_normal := $(TARGET_PREFIX)-ld
OBJCOPY_normal := $(TARGET_PREFIX)-objcopy
RANLIB_normal := $(TARGET_PREFIX)-ranlib
CC_normal := $(TARGET_PREFIX)gcc
AS_normal := $(TARGET_PREFIX)as
AR_normal := $(TARGET_PREFIX)ar
LD_normal := $(TARGET_PREFIX)ld
OBJCOPY_normal := $(TARGET_PREFIX)objcopy
RANLIB_normal := $(TARGET_PREFIX)ranlib

CC_quiet = @echo " CC " $@ && $(CLANG)
AS_quiet = @echo " AS " $@ && $(TARGET_PREFIX)-as
AR_quiet = @echo " AR " $@ && $(TARGET_PREFIX)-ar
LD_quiet = @echo " LD " $@ && $(TARGET_PREFIX)-ld
OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)-objcopy
RANLIB_quiet = @echo " RANLIB " $@ && $(TARGET_PREFIX)-ranlib
CC_quiet = @echo " CC " $@ && $(TARGET_PREFIX)gcc
AS_quiet = @echo " AS " $@ && $(TARGET_PREFIX)as
AR_quiet = @echo " AR " $@ && $(TARGET_PREFIX)ar
LD_quiet = @echo " LD " $@ && $(TARGET_PREFIX)ld
OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)objcopy
RANLIB_quiet = @echo " RANLIB " $@ && $(TARGET_PREFIX)ranlib

ifeq ($(V),1)
CC = $(CC_normal)
Expand All @@ -34,22 +33,22 @@ endif
# Toolchain options
#
INCLUDES = -I$(M2DIR)/software/include/base -I$(M2DIR)/software/include -I$(M2DIR)/common
CFLAGS = -O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wshadow \
-Wmissing-prototypes -nostdinc $(INCLUDES)
CFLAGS = -O3 -mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled -msign-extend-enabled \
-Wall -Wstrict-prototypes -Wold-style-definition -Wshadow \
-Wmissing-prototypes -fno-builtin -nostdinc $(INCLUDES)
LDFLAGS = -nostdlib -nodefaultlibs

# compile and generate dependencies, based on
# http://scottmcpeak.com/autodepend/autodepend.html

define compile-dep
$(CC) -c $(CFLAGS) $< -o $*.ts -S
$(CC) -c $(CFLAGS) $< -o $*.o
@$(CC_normal) -MM $(CFLAGS) $< > $*.d
@mv -f $*.d $*.d.tmp
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
@rm -f $*.d.tmp
@$(AS_normal) -o $*.o $*.ts
endef

define assemble
Expand Down
2 changes: 1 addition & 1 deletion software/libcompiler-rt/Makefile
Expand Up @@ -4,7 +4,7 @@ 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
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 clzsi2.o

all: libcompiler-rt.a

Expand Down

0 comments on commit 20003f0

Please sign in to comment.