Skip to content
Snippets Groups Projects
Commit c1da7c1d authored by Henrik Tjäder's avatar Henrik Tjäder
Browse files

Update to latest LLVM 9 and working with KLEE 2

parent c6adb653
No related branches found
No related tags found
No related merge requests found
Pipeline #227 canceled
...@@ -63,7 +63,15 @@ endif ...@@ -63,7 +63,15 @@ endif
# Optimize for size # Optimize for size
#OPTIMIZE = -Os #OPTIMIZE = -Os
# No optimization at all # No optimization at all
ifeq "$(MAKECMDGOALS)" "rel"
# GCC
OPTIMIZE = -O0
else ifeq "$(MAKECMDGOALS)" "wcet"
OPTIMIZE = -O0
else
# CLANG
OPTIMIZE = -O0 -Xclang -disable-O0-optnone OPTIMIZE = -O0 -Xclang -disable-O0-optnone
endif
#INCSEARCH = include #INCSEARCH = include
#SRCIGNORE =! -iname 'tiny_printf.c' #SRCIGNORE =! -iname 'tiny_printf.c'
...@@ -91,16 +99,34 @@ else ...@@ -91,16 +99,34 @@ else
# Start of the CLANG block # Start of the CLANG block
# CLANG # CLANG
CLANGMCFLAGS =-target $(TARGETTRIPLE) # -fno-integrated-as CLANGMCFLAGS = #-target $(TARGETTRIPLE) # -fno-integrated-as
# MCU Specific flags # MCU Specific flags
MCFLAGS = -mcpu=$(MCU) -mlittle-endian -mthumb -ffreestanding \ #MCFLAGS = -mcpu=$(MCU) -mlittle-endian -mthumb -ffreestanding \
-fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fshort-enums \ #-fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fshort-enums \
-g3 -std=gnu11 -Wall -Wextra #-g3 -std=gnu11 -Wall -Wextra
ifeq "$(MAKECMDGOALS)" "rel"
TARGETHWFLAGS = -target $(TARGETTRIPLE) -mcpu=$(MCU) -mlittle-endian -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard
TARGETHWLDFLAGS =
else ifeq "$(MAKECMDGOALS)" "wcet"
TARGETHWFLAGS = -target $(TARGETTRIPLE) -mcpu=$(MCU) -mlittle-endian -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard
TARGETHWLDFLAGS =
else
TARGETHWFLAGS =
# Link for some triple, not really used, but needed for linking with interrupt vectors
TARGETHWLDFLAGS = -mtriple=$(TARGETTRIPLE) -march=thumb -mcpu=$(MCU) -float-abi=hard
endif
MCFLAGS = -ffreestanding \
-fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections \
-fshort-enums -g3 -std=gnu11 -Wall -Wextra
# For creating object file from LLVM IR # For creating object file from LLVM IR
LLCFLAGS = -mtriple=$(TARGETTRIPLE) -march=thumb -mcpu=$(MCU) -filetype=obj -float-abi=hard LLCFLAGS = $(TARGETHWLDFLAGS) -filetype=obj
# Assembler flags # Assembler flags (unnused)
ASFLAGS = -mcpu=$(MCU) -mlittle-endian -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard ASFLAGS = -mcpu=$(MCU) -mlittle-endian -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard
...@@ -110,11 +136,11 @@ LDFLAGS = --specs=nosys.specs -Wl,-T "ldscripts/flash.ld" -nostartfiles -Wl,-no ...@@ -110,11 +136,11 @@ LDFLAGS = --specs=nosys.specs -Wl,-T "ldscripts/flash.ld" -nostartfiles -Wl,-no
# Not used: # Not used:
#--specs=nano.specs --specs=nosys.specs -lc -lnosys #--specs=nano.specs --specs=nosys.specs -lc -lnosys
CLANGLDFLAGS = -flto -target $(TARGETTRIPLE) -mfloat-abi=hard # -save-temps=obj CLANGLDFLAGS = -flto
#or if you want .bc in objects -save-temps=obj #or if you want .bc for each object: -save-temps=obj
# Build the compile command # Build the compile command
CFLAGS = $(CLANGMCFLAGS) $(MCFLAGS) $(OPTIMIZE) $(DEFS) CFLAGS = $(CLANGMCFLAGS) $(TARGETHWFLAGS) $(MCFLAGS) $(OPTIMIZE) $(DEFS)
# Recursively add all .c files # Recursively add all .c files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment