build: Move the toolchain library setting to the common place
so all boards support C++ automatically
This commit is contained in:
parent
f5311de6b4
commit
4910d43ab0
@ -127,9 +127,6 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
GCC_LIBDIR := ${shell dirname $(LIBGCC)}
|
||||
|
||||
VPATH += chip
|
||||
VPATH += common
|
||||
VPATH += $(ARCH_SUBDIR)
|
||||
@ -168,7 +165,7 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT)
|
||||
$(Q) echo "LD: nuttx"
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -87,3 +87,18 @@ ifeq ($(CONFIG_ARM_TOOLCHAIN),GNU_EABI)
|
||||
ARCROSSDEV ?= arm-none-eabi-
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L ${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L ${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += lsupc++
|
||||
EXTRA_LIBPATHS += -L ${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}
|
||||
endif
|
||||
|
@ -81,3 +81,18 @@ endif
|
||||
# optimization level will be set to -Os
|
||||
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -105,3 +105,18 @@ ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),GNU_EABI)
|
||||
ARCROSSDEV ?= $(TARGET_ARCH)-none-eabi-
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -141,3 +141,18 @@ ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CLANG)
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) -mthumb $(TOOLCHAIN_MFLOAT)
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -87,3 +87,18 @@ ifeq ($(CONFIG_ARMV7R_TOOLCHAIN),GNU_EABI)
|
||||
ARCROSSDEV ?= $(TARGET_ARCH)-none-eabi-
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -131,3 +131,18 @@ ifeq ($(CONFIG_ARMV8M_TOOLCHAIN),CLANG)
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) -mthumb $(TOOLCHAIN_MFLOAT)
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -99,8 +99,6 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
|
||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||
|
||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||
@ -121,8 +119,9 @@ board/libboard$(LIBEXT):
|
||||
|
||||
nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT)
|
||||
@echo "LD: nuttx"
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -125,3 +125,18 @@ ifeq ($(CONFIG_AVR_TOOLCHAIN),WINAVR)
|
||||
MAXOPTIMIZATION ?= -O2
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -50,3 +50,18 @@ CROSSDEV = avr32-
|
||||
ARCHCPUFLAGS = -mpart=uc3b0256
|
||||
|
||||
# AVR Tools or avr32-toolchain from https://github.com/jsnyder/avr32-toolchain
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -100,7 +100,20 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||
|
||||
@ -121,8 +134,9 @@ board/libboard$(LIBEXT):
|
||||
|
||||
nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT)
|
||||
$(Q) echo "LD: nuttx"
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX) $(HEAD_OBJ) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -97,8 +97,6 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
|
||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||
|
||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||
@ -119,8 +117,9 @@ board/libboard$(LIBEXT):
|
||||
|
||||
nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT)
|
||||
@echo "LD: nuttx"
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -258,3 +258,13 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),PINGUINOW)
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
LDSCRIPT = mips-elf-debug.ld
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}
|
||||
endif
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}
|
||||
endif
|
||||
|
@ -101,8 +101,6 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
|
||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||
|
||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||
@ -122,8 +120,9 @@ board/libboard$(LIBEXT):
|
||||
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)"
|
||||
|
||||
nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT)
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -91,3 +91,18 @@ ifeq ($(CONFIG_LM32_TOOLCHAIN),GNUL)
|
||||
ARCROSSDEV ?= lm32-elf-
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -42,3 +42,18 @@ ARCHCPUFLAGS = -march=rv32i
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),)
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -118,9 +118,6 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
GCC_LIBDIR := ${shell dirname $(LIBGCC)}
|
||||
|
||||
VPATH += chip
|
||||
VPATH += common
|
||||
VPATH += $(ARCH_SUBDIR)
|
||||
@ -161,7 +158,7 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT)
|
||||
$(Q) echo "LD: nuttx"
|
||||
$(Q) $(LD) --entry=0x100 $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -69,3 +69,18 @@ ARCHPICFLAGS = -fpic -membedded-pic
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
LDSCRIPT = or1k-elf-debug.ld
|
||||
#endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -93,7 +93,20 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
||||
VPATH = chip:common
|
||||
|
||||
@ -115,8 +128,9 @@ board/libboard$(LIBEXT):
|
||||
|
||||
nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT)
|
||||
@echo "LD: nuttx"
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX) $(HEAD_OBJ) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -122,9 +122,6 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
GCC_LIBDIR := ${shell dirname $(LIBGCC)}
|
||||
|
||||
VPATH += chip
|
||||
VPATH += common
|
||||
VPATH += $(ARCH_SUBDIR)
|
||||
@ -158,7 +155,7 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT)
|
||||
$(Q) echo "LD: nuttx"
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -103,3 +103,18 @@ endif
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),)
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -83,3 +83,18 @@ endif
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),)
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -97,14 +97,19 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
# Add the builtin library
|
||||
|
||||
ifeq ($(HOSTOS),FreeBSD)
|
||||
HOST_ARCH = ${shell uname -m 2>/dev/null || echo "Other"}
|
||||
ifeq ($(HOST_ARCH),amd64)
|
||||
LDFLAGS += -melf_i386
|
||||
LIBGCC = "/usr/lib32/libgcc.a"
|
||||
endif
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||
@ -127,8 +132,9 @@ board/libboard$(LIBEXT):
|
||||
|
||||
nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT)
|
||||
@echo "LD: nuttx$(EXEEXT)"
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -84,10 +84,19 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
# Add the builtin library
|
||||
|
||||
ifeq ($(HOSTOS),FreeBSD)
|
||||
HOST_ARCH = ${shell uname -m 2>/dev/null || echo "Other"}
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||
@ -118,8 +127,9 @@ board/libboard$(LIBEXT):
|
||||
|
||||
nuttx$(EXEEXT): board/libboard$(LIBEXT)
|
||||
@echo "LD: nuttx$(EXEEXT)"
|
||||
$(Q) $(LD) $(LDFLAGS) $(LIBPATHS) -o $(NUTTX) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LIBGCC) --whole-archive --no-relax $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
$(Q) $(LD) $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(EXTRA_LIBS) --whole-archive --no-relax $(LDLIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -98,8 +98,6 @@ ifeq ($(BOARDMAKE),y)
|
||||
LDLIBS += -lboard
|
||||
endif
|
||||
|
||||
LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||
|
||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||
|
||||
all: $(STARTUP_OBJS) libarch$(LIBEXT)
|
||||
@ -120,8 +118,9 @@ board/libboard$(LIBEXT):
|
||||
|
||||
nuttx$(EXEEXT): $(STARTUP_OBJS) board/libboard$(LIBEXT)
|
||||
@echo "LD: nuttx"
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX) $(STARTUP_OBJS) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) $(LDENDGROUP)
|
||||
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
|
||||
-o $(NUTTX) $(STARTUP_OBJS) $(EXTRA_OBJS) \
|
||||
$(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
$(Q) $(NM) $(NUTTX) | \
|
||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
|
@ -57,3 +57,18 @@ ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
|
||||
else
|
||||
MAXOPTIMIZATION := -Os
|
||||
endif
|
||||
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
endif
|
||||
|
@ -74,10 +74,6 @@ BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||
|
||||
VPATH = chip:common:board
|
||||
|
||||
# Libraries
|
||||
|
||||
LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}
|
||||
|
||||
# Targets
|
||||
|
||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||
|
@ -74,10 +74,6 @@ BOARDDIR = $(TOPDIR)\arch\$(CONFIG_ARCH)\src\board
|
||||
|
||||
VPATH = chip:common:board
|
||||
|
||||
# Libraries
|
||||
|
||||
LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}
|
||||
|
||||
# Targets
|
||||
|
||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||
|
@ -54,10 +54,6 @@ else
|
||||
LDSCRIPT = flash-ocram.ld
|
||||
endif
|
||||
|
||||
LIBSUPXX = ${shell $(CC) $(CXXFLAGS) --print-file-name=libsupc++.a}
|
||||
EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
|
||||
EXTRA_LIBS = -lsupc++
|
||||
|
||||
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)}"
|
||||
else
|
||||
|
@ -54,10 +54,6 @@ else
|
||||
LDSCRIPT = flash-ocram.ld
|
||||
endif
|
||||
|
||||
LIBSUPXX = ${shell $(CC) $(CXXFLAGS) --print-file-name=libsupc++.a}
|
||||
EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
|
||||
EXTRA_LIBS = -lsupc++
|
||||
|
||||
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)}"
|
||||
else
|
||||
|
@ -135,5 +135,5 @@ endif
|
||||
# NEVER use 'override' variables
|
||||
# NUTTX_EXTRA_LIBS and NUTTX_EXTRA_LIBPATHS are defined by out-of-repository
|
||||
|
||||
EXTRA_LIBS := $(NUTTX_EXTRA_LIBS) $(ARCH_LIBS)
|
||||
EXTRA_LIBPATHS := $(NUTTX_EXTRA_LIBPATHS) $(ARCH_LIBPATHS)
|
||||
EXTRA_LIBS += $(NUTTX_EXTRA_LIBS) $(ARCH_LIBS)
|
||||
EXTRA_LIBPATHS += $(NUTTX_EXTRA_LIBPATHS) $(ARCH_LIBPATHS)
|
||||
|
@ -33,10 +33,6 @@ OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
LDSCRIPT = ld.script
|
||||
LIBSUPXX = ${shell $(CC) $(CXXFLAGS) --print-file-name=libsupc++.a}
|
||||
EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
|
||||
EXTRA_LIBS = -lsupc++
|
||||
|
||||
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)}"
|
||||
else
|
||||
|
@ -49,10 +49,6 @@ OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
LDSCRIPT = ld.script
|
||||
LIBSUPXX = ${shell $(CC) $(CXXFLAGS) --print-file-name=libsupc++.a}
|
||||
EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
|
||||
EXTRA_LIBS = -lsupc++
|
||||
|
||||
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
||||
ARCHSCRIPT = -T "${shell cygpath -w \
|
||||
$(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)}"
|
||||
|
@ -68,12 +68,6 @@ ifeq ($(CONFIG_LIBCXX),y)
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
CXXFLAGS += -fno-exceptions -fno-rtti -fcheck-new -D_LIBCPP_NO_EXCEPTIONS
|
||||
endif
|
||||
|
||||
# supc++ is always needed with libcxx
|
||||
|
||||
LIBSUPXX = ${shell $(CC) $(CFLAGS) --print-file-name=libsupc++.a}
|
||||
EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
|
||||
EXTRA_LIBS = -lsupc++
|
||||
endif
|
||||
|
||||
NXFLATLDFLAGS1 = -r -d -warn-common
|
||||
|
@ -127,10 +127,6 @@ LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD)
|
||||
CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC)
|
||||
LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS
|
||||
|
||||
LIBSUPXX = ${shell $(CC) $(CXXFLAGS) --print-file-name=libsupc++.a}
|
||||
EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
|
||||
EXTRA_LIBS = -lsupc++
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
CCLINKFLAGS += -g
|
||||
endif
|
||||
|
@ -282,7 +282,6 @@ if [ "X${USRONLY}" != "Xy" ]; then
|
||||
echo "LDENDGROUP = ${LDENDGROUP}" >>"${EXPORTDIR}/scripts/Make.defs"
|
||||
echo "LDFLAGS = ${LDFLAGS}" >>"${EXPORTDIR}/scripts/Make.defs"
|
||||
echo "LDSTARTGROUP = ${LDSTARTGROUP}" >>"${EXPORTDIR}/scripts/Make.defs"
|
||||
echo "LIBGCC = ${LIBGCC}" >>"${EXPORTDIR}/scripts/Make.defs"
|
||||
fi
|
||||
|
||||
# Copy the system map file(s)
|
||||
|
Loading…
Reference in New Issue
Block a user