add LLVM/clang-3.5+ support
This commit is contained in:
parent
529b9596e5
commit
52d573e68a
7
README
7
README
@ -86,6 +86,13 @@ OR
|
||||
6 handin your code
|
||||
$make handin
|
||||
|
||||
OPTION
|
||||
==============
|
||||
Now, ucore suuport LLVM/Clang-3.5 +
|
||||
in step4:
|
||||
$ USELLVM=1 make
|
||||
then you will use clang to compile ucore
|
||||
|
||||
GRADE/RANK
|
||||
==========
|
||||
Superman: Finish all OS labs in one month by yourself
|
||||
|
@ -4,7 +4,8 @@ SPACE := $(EMPTY) $(EMPTY)
|
||||
SLASH := /
|
||||
|
||||
V := @
|
||||
|
||||
#need llvm/cang-3.5+
|
||||
#USELLVM := 1
|
||||
# try to infer the correct GCCPREFX
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX := $(shell if i386-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \
|
||||
@ -23,10 +24,12 @@ endif
|
||||
|
||||
# try to infer the correct QEMU
|
||||
ifndef QEMU
|
||||
QEMU := $(shell if which qemu > /dev/null; \
|
||||
then echo 'qemu'; exit; \
|
||||
QEMU := $(shell if which qemu-system-i386 > /dev/null; \
|
||||
then echo 'qemu-system-i386'; exit; \
|
||||
elif which i386-elf-qemu > /dev/null; \
|
||||
then echo 'i386-elf-qemu'; exit; \
|
||||
elif which qemu > /dev/null; \
|
||||
then echo 'qemu'; exit; \
|
||||
else \
|
||||
echo "***" 1>&2; \
|
||||
echo "*** Error: Couldn't find a working QEMU executable." 1>&2; \
|
||||
@ -41,13 +44,20 @@ endif
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# define compiler and flags
|
||||
|
||||
ifndef USELLVM
|
||||
HOSTCC := gcc
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
|
||||
CC := $(GCCPREFIX)gcc
|
||||
CFLAGS := -fno-builtin -Wall -ggdb -m32 -gstabs -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
else
|
||||
HOSTCC := clang
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
CC := $(GCCPREFIX)clang
|
||||
CFLAGS := -fno-builtin -Wall -g -m32 -mno-sse -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
endif
|
||||
|
||||
CTYPE := c S
|
||||
|
||||
LD := $(GCCPREFIX)ld
|
||||
|
@ -4,7 +4,8 @@ SPACE := $(EMPTY) $(EMPTY)
|
||||
SLASH := /
|
||||
|
||||
V := @
|
||||
|
||||
#need llvm/cang-3.5+
|
||||
#USELLVM := 1
|
||||
# try to infer the correct GCCPREFX
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX := $(shell if i386-ucore-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \
|
||||
@ -23,10 +24,12 @@ endif
|
||||
|
||||
# try to infer the correct QEMU
|
||||
ifndef QEMU
|
||||
QEMU := $(shell if which qemu > /dev/null; \
|
||||
QEMU := $(shell if which qemu-system-i386 > /dev/null; \
|
||||
then echo 'qemu-system-i386'; exit; \
|
||||
elif which i386-elf-qemu > /dev/null; \
|
||||
then echo 'i386-elf-qemu'; exit; \
|
||||
elif which qemu > /dev/null; \
|
||||
then echo 'qemu'; exit; \
|
||||
elif which i386-ucore-elf-qemu > /dev/null; \
|
||||
then echo 'i386-ucore-elf-qemu'; exit; \
|
||||
else \
|
||||
echo "***" 1>&2; \
|
||||
echo "*** Error: Couldn't find a working QEMU executable." 1>&2; \
|
||||
@ -41,15 +44,21 @@ endif
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# define compiler and flags
|
||||
|
||||
ifndef USELLVM
|
||||
HOSTCC := gcc
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
|
||||
CC := $(GCCPREFIX)gcc
|
||||
CFLAGS := -fno-builtin -Wall -ggdb -m32 -gstabs -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
else
|
||||
HOSTCC := clang
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
CC := $(GCCPREFIX)clang
|
||||
CFLAGS := -fno-builtin -Wall -g -m32 -mno-sse -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
endif
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
CTYPE := c S
|
||||
|
||||
LD := $(GCCPREFIX)ld
|
||||
|
@ -4,7 +4,8 @@ SPACE := $(EMPTY) $(EMPTY)
|
||||
SLASH := /
|
||||
|
||||
V := @
|
||||
|
||||
#need llvm/cang-3.5+
|
||||
#USELLVM := 1
|
||||
# try to infer the correct GCCPREFX
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX := $(shell if i386-ucore-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \
|
||||
@ -23,10 +24,12 @@ endif
|
||||
|
||||
# try to infer the correct QEMU
|
||||
ifndef QEMU
|
||||
QEMU := $(shell if which qemu > /dev/null; \
|
||||
QEMU := $(shell if which qemu-system-i386 > /dev/null; \
|
||||
then echo 'qemu-system-i386'; exit; \
|
||||
elif which i386-elf-qemu > /dev/null; \
|
||||
then echo 'i386-elf-qemu'; exit; \
|
||||
elif which qemu > /dev/null; \
|
||||
then echo 'qemu'; exit; \
|
||||
elif which i386-ucore-elf-qemu > /dev/null; \
|
||||
then echo 'i386-ucore-elf-qemu'; exit; \
|
||||
else \
|
||||
echo "***" 1>&2; \
|
||||
echo "*** Error: Couldn't find a working QEMU executable." 1>&2; \
|
||||
@ -41,15 +44,21 @@ endif
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# define compiler and flags
|
||||
|
||||
ifndef USELLVM
|
||||
HOSTCC := gcc
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
|
||||
CC ?= $(GCCPREFIX)gcc
|
||||
CC := $(GCCPREFIX)gcc
|
||||
CFLAGS := -fno-builtin -Wall -ggdb -m32 -gstabs -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
else
|
||||
HOSTCC := clang
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
CC := $(GCCPREFIX)clang
|
||||
CFLAGS := -fno-builtin -Wall -g -m32 -mno-sse -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
endif
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
CTYPE := c S
|
||||
|
||||
LD := $(GCCPREFIX)ld
|
||||
|
@ -4,7 +4,8 @@ SPACE := $(EMPTY) $(EMPTY)
|
||||
SLASH := /
|
||||
|
||||
V := @
|
||||
|
||||
#need llvm/cang-3.5+
|
||||
#USELLVM := 1
|
||||
# try to infer the correct GCCPREFX
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX := $(shell if i386-ucore-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \
|
||||
@ -23,10 +24,12 @@ endif
|
||||
|
||||
# try to infer the correct QEMU
|
||||
ifndef QEMU
|
||||
QEMU := $(shell if which qemu > /dev/null; \
|
||||
QEMU := $(shell if which qemu-system-i386 > /dev/null; \
|
||||
then echo 'qemu-system-i386'; exit; \
|
||||
elif which i386-elf-qemu > /dev/null; \
|
||||
then echo 'i386-elf-qemu'; exit; \
|
||||
elif which qemu > /dev/null; \
|
||||
then echo 'qemu'; exit; \
|
||||
elif which i386-ucore-elf-qemu > /dev/null; \
|
||||
then echo 'i386-ucore-elf-qemu'; exit; \
|
||||
else \
|
||||
echo "***" 1>&2; \
|
||||
echo "*** Error: Couldn't find a working QEMU executable." 1>&2; \
|
||||
@ -41,15 +44,21 @@ endif
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# define compiler and flags
|
||||
|
||||
ifndef USELLVM
|
||||
HOSTCC := gcc
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
|
||||
CC ?= $(GCCPREFIX)gcc
|
||||
CC := $(GCCPREFIX)gcc
|
||||
CFLAGS := -fno-builtin -Wall -ggdb -m32 -gstabs -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
else
|
||||
HOSTCC := clang
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
CC := $(GCCPREFIX)clang
|
||||
CFLAGS := -fno-builtin -Wall -g -m32 -mno-sse -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
endif
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
CTYPE := c S
|
||||
|
||||
LD := $(GCCPREFIX)ld
|
||||
|
@ -4,7 +4,8 @@ SPACE := $(EMPTY) $(EMPTY)
|
||||
SLASH := /
|
||||
|
||||
V := @
|
||||
|
||||
#need llvm/cang-3.5+
|
||||
#USELLVM := 1
|
||||
# try to infer the correct GCCPREFX
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX := $(shell if i386-ucore-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \
|
||||
@ -23,10 +24,12 @@ endif
|
||||
|
||||
# try to infer the correct QEMU
|
||||
ifndef QEMU
|
||||
QEMU := $(shell if which qemu > /dev/null; \
|
||||
QEMU := $(shell if which qemu-system-i386 > /dev/null; \
|
||||
then echo 'qemu-system-i386'; exit; \
|
||||
elif which i386-elf-qemu > /dev/null; \
|
||||
then echo 'i386-elf-qemu'; exit; \
|
||||
elif which qemu > /dev/null; \
|
||||
then echo 'qemu'; exit; \
|
||||
elif which i386-ucore-elf-qemu > /dev/null; \
|
||||
then echo 'i386-ucore-elf-qemu'; exit; \
|
||||
else \
|
||||
echo "***" 1>&2; \
|
||||
echo "*** Error: Couldn't find a working QEMU executable." 1>&2; \
|
||||
@ -41,15 +44,21 @@ endif
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# define compiler and flags
|
||||
|
||||
ifndef USELLVM
|
||||
HOSTCC := gcc
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
|
||||
CC ?= $(GCCPREFIX)gcc
|
||||
CC := $(GCCPREFIX)gcc
|
||||
CFLAGS := -fno-builtin -Wall -ggdb -m32 -gstabs -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
else
|
||||
HOSTCC := clang
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
CC := $(GCCPREFIX)clang
|
||||
CFLAGS := -fno-builtin -Wall -g -m32 -mno-sse -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
endif
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
CTYPE := c S
|
||||
|
||||
LD := $(GCCPREFIX)ld
|
||||
|
@ -4,7 +4,8 @@ SPACE := $(EMPTY) $(EMPTY)
|
||||
SLASH := /
|
||||
|
||||
V := @
|
||||
|
||||
#need llvm/cang-3.5+
|
||||
#USELLVM := 1
|
||||
# try to infer the correct GCCPREFX
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX := $(shell if i386-ucore-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \
|
||||
@ -23,10 +24,12 @@ endif
|
||||
|
||||
# try to infer the correct QEMU
|
||||
ifndef QEMU
|
||||
QEMU := $(shell if which qemu > /dev/null; \
|
||||
QEMU := $(shell if which qemu-system-i386 > /dev/null; \
|
||||
then echo 'qemu-system-i386'; exit; \
|
||||
elif which i386-elf-qemu > /dev/null; \
|
||||
then echo 'i386-elf-qemu'; exit; \
|
||||
elif which qemu > /dev/null; \
|
||||
then echo 'qemu'; exit; \
|
||||
elif which i386-ucore-elf-qemu > /dev/null; \
|
||||
then echo 'i386-ucore-elf-qemu'; exit; \
|
||||
else \
|
||||
echo "***" 1>&2; \
|
||||
echo "*** Error: Couldn't find a working QEMU executable." 1>&2; \
|
||||
@ -41,15 +44,21 @@ endif
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# define compiler and flags
|
||||
|
||||
ifndef USELLVM
|
||||
HOSTCC := gcc
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
|
||||
CC ?= $(GCCPREFIX)gcc
|
||||
CC := $(GCCPREFIX)gcc
|
||||
CFLAGS := -fno-builtin -Wall -ggdb -m32 -gstabs -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
else
|
||||
HOSTCC := clang
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
CC := $(GCCPREFIX)clang
|
||||
CFLAGS := -fno-builtin -Wall -g -m32 -mno-sse -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
endif
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
CTYPE := c S
|
||||
|
||||
LD := $(GCCPREFIX)ld
|
||||
|
@ -4,7 +4,8 @@ SPACE := $(EMPTY) $(EMPTY)
|
||||
SLASH := /
|
||||
|
||||
V := @
|
||||
|
||||
#need llvm/cang-3.5+
|
||||
#USELLVM := 1
|
||||
# try to infer the correct GCCPREFX
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX := $(shell if i386-ucore-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \
|
||||
@ -23,10 +24,12 @@ endif
|
||||
|
||||
# try to infer the correct QEMU
|
||||
ifndef QEMU
|
||||
QEMU := $(shell if which qemu > /dev/null; \
|
||||
QEMU := $(shell if which qemu-system-i386 > /dev/null; \
|
||||
then echo 'qemu-system-i386'; exit; \
|
||||
elif which i386-elf-qemu > /dev/null; \
|
||||
then echo 'i386-elf-qemu'; exit; \
|
||||
elif which qemu > /dev/null; \
|
||||
then echo 'qemu'; exit; \
|
||||
elif which i386-ucore-elf-qemu > /dev/null; \
|
||||
then echo 'i386-ucore-elf-qemu'; exit; \
|
||||
else \
|
||||
echo "***" 1>&2; \
|
||||
echo "*** Error: Couldn't find a working QEMU executable." 1>&2; \
|
||||
@ -41,15 +44,21 @@ endif
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# define compiler and flags
|
||||
|
||||
ifndef USELLVM
|
||||
HOSTCC := gcc
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
|
||||
CC ?= $(GCCPREFIX)gcc
|
||||
CC := $(GCCPREFIX)gcc
|
||||
CFLAGS := -fno-builtin -Wall -ggdb -m32 -gstabs -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
else
|
||||
HOSTCC := clang
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
CC := $(GCCPREFIX)clang
|
||||
CFLAGS := -fno-builtin -Wall -g -m32 -mno-sse -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
endif
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
CTYPE := c S
|
||||
|
||||
LD := $(GCCPREFIX)ld
|
||||
|
@ -4,7 +4,8 @@ SPACE := $(EMPTY) $(EMPTY)
|
||||
SLASH := /
|
||||
|
||||
V := @
|
||||
|
||||
#need llvm/cang-3.5+
|
||||
#USELLVM := 1
|
||||
# try to infer the correct GCCPREFX
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX := $(shell if i386-ucore-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \
|
||||
@ -23,10 +24,12 @@ endif
|
||||
|
||||
# try to infer the correct QEMU
|
||||
ifndef QEMU
|
||||
QEMU := $(shell if which qemu > /dev/null; \
|
||||
QEMU := $(shell if which qemu-system-i386 > /dev/null; \
|
||||
then echo 'qemu-system-i386'; exit; \
|
||||
elif which i386-elf-qemu > /dev/null; \
|
||||
then echo 'i386-elf-qemu'; exit; \
|
||||
elif which qemu > /dev/null; \
|
||||
then echo 'qemu'; exit; \
|
||||
elif which i386-ucore-elf-qemu > /dev/null; \
|
||||
then echo 'i386-ucore-elf-qemu'; exit; \
|
||||
else \
|
||||
echo "***" 1>&2; \
|
||||
echo "*** Error: Couldn't find a working QEMU executable." 1>&2; \
|
||||
@ -41,15 +44,21 @@ endif
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# define compiler and flags
|
||||
|
||||
ifndef USELLVM
|
||||
HOSTCC := gcc
|
||||
HOSTCFLAGS := -g -Wall -O2 -D_FILE_OFFSET_BITS=64
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
|
||||
CC ?= $(GCCPREFIX)gcc
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
CC := $(GCCPREFIX)gcc
|
||||
CFLAGS := -fno-builtin -Wall -ggdb -m32 -gstabs -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
else
|
||||
HOSTCC := clang
|
||||
HOSTCFLAGS := -g -Wall -O2
|
||||
CC := $(GCCPREFIX)clang
|
||||
CFLAGS := -fno-builtin -Wall -g -m32 -mno-sse -nostdinc $(DEFS)
|
||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||
endif
|
||||
|
||||
GDB := $(GCCPREFIX)gdb
|
||||
CTYPE := c S
|
||||
|
||||
LD := $(GCCPREFIX)ld
|
||||
|
Loading…
Reference in New Issue
Block a user