Merged in mekanix/nuttx/feature/clang (pull request #632)

Add clang support to stm32f746g-disco board

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Goran Mekić 2018-04-24 22:46:03 +00:00 committed by Gregory Nutt
parent 5fae6f8da6
commit f6e087a05c
2 changed files with 33 additions and 10 deletions

View File

@ -65,19 +65,39 @@ NM = $(ARCROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump OBJDUMP = $(CROSSDEV)objdump
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -g
endif
ifneq ($(CONFIG_DEBUG_NOOPT),y) ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif endif
ARCHCFLAGS = -fno-builtin ARCHCFLAGS = -fno-builtin
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANGL),y)
ARCHCCVERSION = {shell $(CC) -v 2>&1 | sed -n '/clang version/p' | sed -e 's/.* clang version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g'}
HOSTCC = clang
CC = clang
CXX = clang++
CPP = clang -E
ARCHCFLAGS += -nostdlib -ffreestanding -target arm-none-eabi -march=armv7-m -mcpu=cortex-m7
ARCHCXXFLAGS += -nostdlib -ffreestanding -target arm-none-eabi -march=armv7-m -mcpu=cortex-m7 -DCONFIG_WCHAR_BUILTIN
else
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
HOSTCC = gcc
CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
ARCHCXXFLAGS += -fno-rtti
ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += -fno-strength-reduce
endif
endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -g
endif
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHDEFINES = ARCHDEFINES =
@ -107,8 +127,6 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
endif endif
HOSTCC = gcc
HOSTINCLUDES = -I. HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
HOSTLDFLAGS = HOSTLDFLAGS =

View File

@ -325,4 +325,9 @@ fi
echo " Refreshing..." echo " Refreshing..."
cd ${TOPDIR} || { echo "Failed to cd to ${TOPDIR}"; exit 1; } cd ${TOPDIR} || { echo "Failed to cd to ${TOPDIR}"; exit 1; }
make olddefconfig 1>/dev/null MAKE_BIN=make
if [ ! -z `which gmake` ]; then
MAKE_BIN=gmake
fi
${MAKE_BIN} olddefconfig 1>/dev/null