sim: Remove cxxtest specifial Make.defs
since the special c++ setup doesn't need anymore Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
6aee468d72
commit
e5ab2e56f8
@ -1,144 +0,0 @@
|
||||
############################################################################
|
||||
# boards/sim/sim/sim/configs/cxxtest/Make.defs
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership. The
|
||||
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance with the
|
||||
# License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include $(TOPDIR)/.config
|
||||
include $(TOPDIR)/tools/Config.mk
|
||||
|
||||
HOSTOS = ${shell uname -o 2>/dev/null || uname -s 2>/dev/null || echo "Other"}
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
ARCHOPTIMIZATION = -g
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += -O2 -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
ARCHCPUFLAGS = -fno-builtin
|
||||
ifeq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCPUFLAGSXX = -fno-builtin
|
||||
else
|
||||
ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fcheck-new
|
||||
endif
|
||||
ARCHPICFLAGS = -fpic
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
|
||||
|
||||
# Add -fno-common because macOS "ld -r" doesn't seem to pick objects
|
||||
# for common symbols.
|
||||
ARCHCPUFLAGS += -fno-common
|
||||
ARCHCPUFLAGSXX += -fno-common
|
||||
|
||||
ifeq ($(CONFIG_SIM_M32),y)
|
||||
ARCHCPUFLAGS += -m32
|
||||
ARCHCPUFLAGSXX += -m32
|
||||
endif
|
||||
|
||||
CC = $(CROSSDEV)cc
|
||||
CXX = $(CROSSDEV)c++
|
||||
CPP = $(CROSSDEV)cc -E
|
||||
LD = $(CROSSDEV)ld
|
||||
ifeq ($(CONFIG_HOST_MACOS),y)
|
||||
STRIP = $(CROSSDEV)strip
|
||||
AR = $(TOPDIR)/tools/macar-rcs.sh
|
||||
else
|
||||
STRIP = $(CROSSDEV)strip --strip-unneeded
|
||||
AR = $(CROSSDEV)ar rcs
|
||||
endif
|
||||
NM = $(CROSSDEV)nm
|
||||
OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
CFLAGS := $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
||||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
|
||||
CXXFLAGS := $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
|
||||
$(ARCHCPUFLAGSXX) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
|
||||
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
|
||||
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
|
||||
|
||||
# Loadable module definitions
|
||||
|
||||
CMODULEFLAGS = $(CFLAGS)
|
||||
# -fno-pic to avoid GOT relocations
|
||||
CMODULEFLAGS += -fno-pic
|
||||
ifeq ($(CONFIG_LIBC_ARCH_ELF_64BIT),y)
|
||||
# For amd64:
|
||||
# It seems macOS/x86_64 loads the program text around 00000001_xxxxxxxx.
|
||||
# The gcc default (-mcmodel=small) would produce out-of-range 32-bit
|
||||
# relocations.
|
||||
# Even on Linux, NuttX modules are loaded into the NuttX heap, which
|
||||
# can be out of range with -mcmodel=small.
|
||||
CMODULEFLAGS += -mcmodel=large
|
||||
endif
|
||||
# On Linux, we (ab)use the host compiler to compile binaries for NuttX.
|
||||
# Explicitly disable features which might be default on the host while
|
||||
# not available on NuttX.
|
||||
CMODULEFLAGS += -fno-stack-protector
|
||||
|
||||
LDMODULEFLAGS = -r -e module_initialize
|
||||
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
||||
LDMODULEFLAGS += -T "${shell cygpath -w $(TOPDIR)/libs/libc/modlib/gnu-elf.ld}"
|
||||
else
|
||||
LDMODULEFLAGS += -T $(TOPDIR)/libs/libc/modlib/gnu-elf.ld
|
||||
endif
|
||||
|
||||
# NuttX modules are ELF binaries.
|
||||
# Non-ELF platforms like macOS need to use a separate ELF toolchain.
|
||||
ifeq ($(CONFIG_HOST_MACOS),y)
|
||||
# eg. brew install x86_64-elf-gcc
|
||||
MODULECC = x86_64-elf-gcc
|
||||
MODULELD = x86_64-elf-ld
|
||||
MODULESTRIP = x86_64-elf-strip --strip-unneeded
|
||||
endif
|
||||
|
||||
# ELF module definitions
|
||||
|
||||
CELFFLAGS = $(CFLAGS)
|
||||
CXXELFFLAGS = $(CXXFLAGS)
|
||||
# -fno-pic to avoid GOT relocations
|
||||
CELFFLAGS += -fno-pic
|
||||
CXXELFFLAGS += -fno-pic
|
||||
|
||||
LDELFFLAGS = -r -e main
|
||||
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
||||
LDELFFLAGS += -T "${shell cygpath -w $(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld}"
|
||||
else
|
||||
LDELFFLAGS += -T $(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld
|
||||
endif
|
||||
|
||||
LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD)
|
||||
CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC)
|
||||
LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
CCLINKFLAGS += -g
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIM_M32),y)
|
||||
LDLINKFLAGS += -melf_i386
|
||||
CCLINKFLAGS += -m32
|
||||
LDFLAGS += -m32
|
||||
LDMODULEFLAGS += -melf_i386
|
||||
LDELFFLAGS += -melf_i386
|
||||
HOSTLDFLAGS += -m32
|
||||
endif
|
||||
|
||||
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
||||
$(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
|
Loading…
Reference in New Issue
Block a user