diff --git a/Documentation/guides/cpp_cmake.rst b/Documentation/guides/cpp_cmake.rst index 0a6299a935..5ac464ce45 100644 --- a/Documentation/guides/cpp_cmake.rst +++ b/Documentation/guides/cpp_cmake.rst @@ -147,7 +147,7 @@ Creating the project set(AC_HW_FLAGS "${AC_HW_FLAGS} -isystem ${NUTTX_PATH}/include") set(AC_HW_FLAGS "${AC_HW_FLAGS} -pipe") - set(AC_LINKER_FLAGS "--entry=__start -nostartfiles -nodefaultlibs -T${MCU_LINKER_SCRIPT}") + set(AC_LINKER_FLAGS "--entry=__start -nostdlib -T${MCU_LINKER_SCRIPT}") * hellocpp/src/CMakeLists.txt diff --git a/arch/arm/src/arm/Toolchain.defs b/arch/arm/src/arm/Toolchain.defs index 73c10a5b3e..595c139fbc 100644 --- a/arch/arm/src/arm/Toolchain.defs +++ b/arch/arm/src/arm/Toolchain.defs @@ -113,6 +113,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) @@ -153,7 +155,6 @@ ifeq ($(CONFIG_LTO_FULL),y) NM := $(CROSSDEV)gcc-nm ARCHOPTIMIZATION += -fuse-linker-plugin ARCHOPTIMIZATION += -fno-builtin - ARCHOPTIMIZATION += -nodefaultlibs endif endif diff --git a/arch/arm/src/armv7-a/Toolchain.defs b/arch/arm/src/armv7-a/Toolchain.defs index 9942b23c61..09eb4cb6c2 100644 --- a/arch/arm/src/armv7-a/Toolchain.defs +++ b/arch/arm/src/armv7-a/Toolchain.defs @@ -144,6 +144,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) @@ -200,7 +202,6 @@ ifeq ($(CONFIG_LTO_FULL),y) NM := $(CROSSDEV)gcc-nm ARCHOPTIMIZATION += -fuse-linker-plugin ARCHOPTIMIZATION += -fno-builtin - ARCHOPTIMIZATION += -nodefaultlibs endif endif diff --git a/arch/arm/src/armv7-m/Toolchain.defs b/arch/arm/src/armv7-m/Toolchain.defs index 592f7a7cbb..deb910df49 100644 --- a/arch/arm/src/armv7-m/Toolchain.defs +++ b/arch/arm/src/armv7-m/Toolchain.defs @@ -222,7 +222,6 @@ else AR := $(CROSSDEV)gcc-ar rcs NM := $(CROSSDEV)gcc-nm ARCHOPTIMIZATION += -fno-builtin - ARCHOPTIMIZATION += -nodefaultlibs endif endif endif @@ -243,6 +242,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) diff --git a/arch/arm/src/armv7-r/Toolchain.defs b/arch/arm/src/armv7-r/Toolchain.defs index add3f6bb6c..a6c236356a 100644 --- a/arch/arm/src/armv7-r/Toolchain.defs +++ b/arch/arm/src/armv7-r/Toolchain.defs @@ -136,6 +136,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) @@ -176,7 +178,6 @@ ifeq ($(CONFIG_LTO_FULL),y) NM := $(CROSSDEV)gcc-nm ARCHOPTIMIZATION += -fuse-linker-plugin ARCHOPTIMIZATION += -fno-builtin - ARCHOPTIMIZATION += -nodefaultlibs endif endif diff --git a/arch/arm/src/armv8-m/Toolchain.defs b/arch/arm/src/armv8-m/Toolchain.defs index 0240df66c6..a64e996041 100644 --- a/arch/arm/src/armv8-m/Toolchain.defs +++ b/arch/arm/src/armv8-m/Toolchain.defs @@ -231,7 +231,6 @@ else AR := $(CROSSDEV)gcc-ar rcs NM := $(CROSSDEV)gcc-nm ARCHOPTIMIZATION += -fno-builtin - ARCHOPTIMIZATION += -nodefaultlibs endif endif endif @@ -252,6 +251,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) diff --git a/arch/arm/src/rp2040/boot2/Make.defs b/arch/arm/src/rp2040/boot2/Make.defs index eb5a207383..afbbbc3ef7 100644 --- a/arch/arm/src/rp2040/boot2/Make.defs +++ b/arch/arm/src/rp2040/boot2/Make.defs @@ -46,6 +46,6 @@ $(BOOT_STAGE2).bin: %.bin: %.elf $(OBJCOPY) -Obinary $< $@ $(BOOT_STAGE2).elf: $(BOOT2SRC) - $(CC) -nostartfiles -nodefaultlibs $(ARCHSCRIPT) $(BOOT2CFLAGS) -o $@ $< + $(CC) -nostdlib $(ARCHSCRIPT) $(BOOT2CFLAGS) -o $@ $< EXTRADELFILE = $(BOOT_STAGE2).* diff --git a/arch/arm/src/tlsr82/Toolchain.defs b/arch/arm/src/tlsr82/Toolchain.defs index b05d22efd3..10ce41e761 100644 --- a/arch/arm/src/tlsr82/Toolchain.defs +++ b/arch/arm/src/tlsr82/Toolchain.defs @@ -158,6 +158,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) diff --git a/arch/avr/src/avr/Toolchain.defs b/arch/avr/src/avr/Toolchain.defs index a1779078c6..d0013c9de0 100644 --- a/arch/avr/src/avr/Toolchain.defs +++ b/arch/avr/src/avr/Toolchain.defs @@ -112,6 +112,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # NuttX buildroot GCC toolchain under Linux or Cygwin ifeq ($(CONFIG_AVR_TOOLCHAIN),BUILDROOT) diff --git a/arch/avr/src/avr32/Toolchain.defs b/arch/avr/src/avr32/Toolchain.defs index b040c60385..e74b9894be 100644 --- a/arch/avr/src/avr32/Toolchain.defs +++ b/arch/avr/src/avr32/Toolchain.defs @@ -60,6 +60,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + CROSSDEV = avr32- ARCHCPUFLAGS = -mpart=uc3b0256 diff --git a/arch/mips/src/mips32/Toolchain.defs b/arch/mips/src/mips32/Toolchain.defs index 10a3ca9543..39c69c388c 100644 --- a/arch/mips/src/mips32/Toolchain.defs +++ b/arch/mips/src/mips32/Toolchain.defs @@ -145,7 +145,6 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),GNU_ELF) CROSSDEV ?= mips-elf- ARCHCPUFLAGS = -mlong32 -membedded-data -msoft-float -march=$(MIPS_MARCH) $(MIPS_MICROMIPS) -EL ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = mips-elf-debug.ld endif @@ -155,7 +154,6 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),PINGUINOL) CROSSDEV ?= p32- ARCHCPUFLAGS = -mlong32 -membedded-data -msoft-float -march=$(MIPS_MARCH) $(MIPS_MICROMIPS) -EL ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = pinguino-debug.ld endif @@ -165,7 +163,6 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),SOURCERY_CODEBENCH_LITE) CROSSDEV ?= mips-sde-elf- ARCHCPUFLAGS = -mlong32 -membedded-data -msoft-float -march=$(MIPS_MARCH) $(MIPS_MICROMIPS) -EL ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = sourcery-debug.ld endif @@ -174,7 +171,6 @@ endif ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPL_XC32) CROSSDEV ?= xc32- ARCHCPUFLAGS = -mprocessor=$(MIPS_MPROCESSOR) -march=$(MIPS_MARCH) -EL $(MIPS_MICROMIPS) -msmart-io=0 - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = xc32-debug.ld endif @@ -184,7 +180,6 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPL) CROSSDEV ?= pic32- ARCHCPUFLAGS = -mprocessor=$(MIPS_MPROCESSOR) $(MIPS_MICROMIPS) -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = xc32-debug.ld endif @@ -193,7 +188,6 @@ endif ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPW_XC32) CROSSDEV ?= xc32- ARCHCPUFLAGS = -mprocessor=$(MIPS_MPROCESSOR) -march=$(MIPS_MARCH) -EL $(MIPS_MICROMIPS) -msmart-io=0 - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = xc32-debug.ld endif @@ -203,7 +197,6 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPW) CROSSDEV ?= pic32- ARCHCPUFLAGS = -mprocessor=$(MIPS_MPROCESSOR) $(MIPS_MICROMIPS) -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = c32-debug.ld endif @@ -213,7 +206,6 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPL_LITE) CROSSDEV ?= pic32- ARCHCPUFLAGS = -mprocessor=$(MIPS_MPROCESSOR) $(MIPS_MICROMIPS) -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = xc32-debug.ld endif @@ -223,7 +215,6 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPW_LITE) CROSSDEV ?= pic32- ARCHCPUFLAGS = -mprocessor=$(MIPS_MPROCESSOR) $(MIPS_MICROMIPS) -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = c32-debug.ld endif @@ -233,7 +224,6 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPOPENL) CROSSDEV ?= mypic32- ARCHCPUFLAGS = -mprocessor=$(MIPS_MPROCESSOR) $(MIPS_MICROMIPS) -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = c32-debug.ld endif @@ -243,7 +233,6 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),PINGUINOW) CROSSDEV ?= p32- ARCHCPUFLAGS = -mlong32 -membedded-data -msoft-float -march=$(MIPS_MARCH) $(MIPS_MICROMIPS) -EL ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = mips-elf-debug.ld endif @@ -285,6 +274,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # Default toolchain CC = $(CROSSDEV)gcc diff --git a/arch/misoc/src/lm32/Toolchain.defs b/arch/misoc/src/lm32/Toolchain.defs index 58de1deb47..ac5f24369e 100644 --- a/arch/misoc/src/lm32/Toolchain.defs +++ b/arch/misoc/src/lm32/Toolchain.defs @@ -65,6 +65,8 @@ else ARCHOPTIMIZATION += -fomit-frame-pointer endif +LDFLAGS += -nostdlib + ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g ARCHOPTIMIZATION += -g diff --git a/arch/misoc/src/minerva/Toolchain.defs b/arch/misoc/src/minerva/Toolchain.defs index 453d25e935..4b992da31a 100644 --- a/arch/misoc/src/minerva/Toolchain.defs +++ b/arch/misoc/src/minerva/Toolchain.defs @@ -37,6 +37,8 @@ else ARCHOPTIMIZATION += -fomit-frame-pointer endif +LDFLAGS += -nostdlib + ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g ARCHOPTIMIZATION += -g diff --git a/arch/or1k/src/mor1kx/Toolchain.defs b/arch/or1k/src/mor1kx/Toolchain.defs index 0f81853e5b..6aacfef038 100644 --- a/arch/or1k/src/mor1kx/Toolchain.defs +++ b/arch/or1k/src/mor1kx/Toolchain.defs @@ -48,6 +48,8 @@ else ARCHOPTIMIZATION += -fomit-frame-pointer endif +LDFLAGS += -nostdlib + ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g ARCHOPTIMIZATION += -g @@ -79,7 +81,6 @@ endif CROSSDEV ?= or1k-elf- ARCHCPUFLAGS = -mboard=de0_nano ARCHPICFLAGS = -fpic -membedded-pic -LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = or1k-elf-debug.ld #endif diff --git a/arch/risc-v/src/common/Toolchain.defs b/arch/risc-v/src/common/Toolchain.defs index e7d7be9144..7fecc67e7e 100644 --- a/arch/risc-v/src/common/Toolchain.defs +++ b/arch/risc-v/src/common/Toolchain.defs @@ -94,6 +94,8 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) ARCHOPTIMIZATION += -ffunction-sections -fdata-sections endif +LDFLAGS += -nostdlib + # Debug link map ifeq ($(CONFIG_DEBUG_LINK_MAP),y) @@ -187,7 +189,6 @@ ifeq ($(CONFIG_LTO_FULL),y) NM := $(CROSSDEV)gcc-nm ARCHOPTIMIZATION += -fuse-linker-plugin ARCHOPTIMIZATION += -fno-builtin - ARCHOPTIMIZATION += -nodefaultlibs endif endif diff --git a/arch/sparc/src/sparc_v8/Toolchain.defs b/arch/sparc/src/sparc_v8/Toolchain.defs index e102681dc8..9280670096 100644 --- a/arch/sparc/src/sparc_v8/Toolchain.defs +++ b/arch/sparc/src/sparc_v8/Toolchain.defs @@ -89,11 +89,12 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # NuttX buildroot GCC toolchain under Linux or Cygwin ifeq ($(CONFIG_SPARC_TOOLCHAIN),BUILDROOT) CROSSDEV ?= sparc-gaisler-elf- - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = sparc-gaisler-elf-debug.ld endif @@ -101,7 +102,6 @@ endif ifeq ($(CONFIG_SPARC_TOOLCHAIN),CODEREDW) CROSSDEV ?= sparc-elf- - LDFLAGS += -nostartfiles -nodefaultlibs LDSCRIPT = sparc-elf-debug.ld endif diff --git a/arch/xtensa/src/lx6/Toolchain.defs b/arch/xtensa/src/lx6/Toolchain.defs index 863cf32cd6..5d140318b3 100644 --- a/arch/xtensa/src/lx6/Toolchain.defs +++ b/arch/xtensa/src/lx6/Toolchain.defs @@ -85,6 +85,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) diff --git a/arch/xtensa/src/lx7/Toolchain.defs b/arch/xtensa/src/lx7/Toolchain.defs index 274eeaef7c..5c650c8a50 100644 --- a/arch/xtensa/src/lx7/Toolchain.defs +++ b/arch/xtensa/src/lx7/Toolchain.defs @@ -85,6 +85,8 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +LDFLAGS += -nostdlib + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) diff --git a/arch/z80/src/ez80/Toolchain.defs b/arch/z80/src/ez80/Toolchain.defs index 27b189b78c..920460f3a7 100644 --- a/arch/z80/src/ez80/Toolchain.defs +++ b/arch/z80/src/ez80/Toolchain.defs @@ -72,6 +72,8 @@ else ARCHOPTIMIZATION += -fomit-frame-pointer endif +LDFLAGS += -nostdlib + ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) LDFLAGS += --gc-sections ARCHOPTIMIZATION += -ffunction-sections -fdata-sections diff --git a/boards/arm/eoss3/quickfeather/scripts/Make.defs b/boards/arm/eoss3/quickfeather/scripts/Make.defs index 07b033f55c..2415322210 100644 --- a/boards/arm/eoss3/quickfeather/scripts/Make.defs +++ b/boards/arm/eoss3/quickfeather/scripts/Make.defs @@ -27,13 +27,9 @@ ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT) ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 -ifeq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANG),y) - ARCHCFLAGS += -nostdlib -ffreestanding - ARCHCXXFLAGS += -nostdlib -ffreestanding -else +ifneq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANG),y) ARCHCFLAGS += -funwind-tables ARCHCXXFLAGS += -funwind-tables - endif CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe diff --git a/boards/arm/stm32/nucleo-f446re/scripts/Make.defs b/boards/arm/stm32/nucleo-f446re/scripts/Make.defs index 6fc3ce5bb1..619d5ed78d 100644 --- a/boards/arm/stm32/nucleo-f446re/scripts/Make.defs +++ b/boards/arm/stm32/nucleo-f446re/scripts/Make.defs @@ -25,12 +25,6 @@ include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs LDSCRIPT = f446re.ld ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT) - -ifeq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANG),y) - ARCHCFLAGS += -nostdlib -ffreestanding - ARCHCXXFLAGS += -nostdlib -ffreestanding -endif - ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe diff --git a/boards/arm/stm32/nucleo-f4x1re/scripts/Make.defs b/boards/arm/stm32/nucleo-f4x1re/scripts/Make.defs index 9af55224b8..df249aefa1 100644 --- a/boards/arm/stm32/nucleo-f4x1re/scripts/Make.defs +++ b/boards/arm/stm32/nucleo-f4x1re/scripts/Make.defs @@ -30,12 +30,6 @@ endif ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT) - -ifeq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANG),y) - ARCHCFLAGS += -nostdlib -ffreestanding - ARCHCXXFLAGS += -nostdlib -ffreestanding -endif - ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe diff --git a/boards/arm/stm32/stm32f4discovery/scripts/Make.defs b/boards/arm/stm32/stm32f4discovery/scripts/Make.defs index 139e5d7db8..1145555684 100644 --- a/boards/arm/stm32/stm32f4discovery/scripts/Make.defs +++ b/boards/arm/stm32/stm32f4discovery/scripts/Make.defs @@ -27,13 +27,9 @@ ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT) ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 -ifeq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANG),y) - ARCHCFLAGS += -nostdlib -ffreestanding - ARCHCXXFLAGS += -nostdlib -ffreestanding -else +ifneq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANG),y) ARCHCFLAGS += -funwind-tables ARCHCXXFLAGS += -funwind-tables - endif CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe diff --git a/boards/arm/stm32f7/stm32f746g-disco/scripts/Make.defs b/boards/arm/stm32f7/stm32f746g-disco/scripts/Make.defs index c737e40afd..6c6677c9d7 100644 --- a/boards/arm/stm32f7/stm32f746g-disco/scripts/Make.defs +++ b/boards/arm/stm32f7/stm32f746g-disco/scripts/Make.defs @@ -25,11 +25,6 @@ include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs LDSCRIPT = flash.ld ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT) -ifeq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANG),y) - ARCHCFLAGS += -nostdlib -ffreestanding - ARCHCXXFLAGS += -nostdlib -ffreestanding -endif - ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe diff --git a/boards/mips/pic32mz/chipkit-wifire/scripts/Make.defs b/boards/mips/pic32mz/chipkit-wifire/scripts/Make.defs index 17db328f18..4b9ec1299a 100644 --- a/boards/mips/pic32mz/chipkit-wifire/scripts/Make.defs +++ b/boards/mips/pic32mz/chipkit-wifire/scripts/Make.defs @@ -66,7 +66,5 @@ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) AFLAGS := $(CFLAGS) -D__ASSEMBLY__ ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32),y) - LDFLAGS = -nostdlib --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0 -else - LDFLAGS = # -no-isn32 --relax + LDFLAGS += --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0 endif diff --git a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/Make.defs b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/Make.defs index 34cb7632db..5b2716a593 100644 --- a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/Make.defs +++ b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/Make.defs @@ -66,7 +66,5 @@ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) AFLAGS := $(CFLAGS) -D__ASSEMBLY__ ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32),y) - LDFLAGS = -nostdlib --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0 -else - LDFLAGS = # -no-isn32 --relax + LDFLAGS += --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0 endif diff --git a/boards/mips/pic32mz/pic32mz-starterkit/scripts/Make.defs b/boards/mips/pic32mz/pic32mz-starterkit/scripts/Make.defs index c642c34eff..c5a5ea4620 100644 --- a/boards/mips/pic32mz/pic32mz-starterkit/scripts/Make.defs +++ b/boards/mips/pic32mz/pic32mz-starterkit/scripts/Make.defs @@ -66,7 +66,5 @@ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) AFLAGS := $(CFLAGS) -D__ASSEMBLY__ ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32),y) - LDFLAGS = -nostdlib --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0 -else - LDFLAGS = # -no-isn32 --relax + LDFLAGS += --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0 endif diff --git a/boards/sparc/bm3803/xx3803/scripts/Make.defs b/boards/sparc/bm3803/xx3803/scripts/Make.defs index 8b51f01555..aa6edef35c 100644 --- a/boards/sparc/bm3803/xx3803/scripts/Make.defs +++ b/boards/sparc/bm3803/xx3803/scripts/Make.defs @@ -38,9 +38,3 @@ CXXELFFLAGS = $(CXXFLAGS) LDELFFLAGS = -r -e main LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/boards/$(CONFIG_ARCH)/$(CONFIG_ARCH_CHIP)/$(CONFIG_ARCH_BOARD)/scripts/gnu-elf.ld) - -# Linker flags - -ifneq ($(CROSSDEV),sparc-nuttx-elf-) - LDFLAGS += -nostartfiles -nodefaultlibs -endif \ No newline at end of file