summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/vars.mk4
-rw-r--r--target/config/Config.in.binfmt5
-rw-r--r--target/frosted/Config.in14
-rw-r--r--toolchain/Makefile2
-rw-r--r--toolchain/gcc/Makefile10
-rw-r--r--toolchain/newlib/Makefile8
6 files changed, 14 insertions, 29 deletions
diff --git a/mk/vars.mk b/mk/vars.mk
index ddc015fff..850a45a72 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -180,7 +180,7 @@ TARGET_CXXFLAGS+= -m$(ADK_TARGET_FLOAT)-float
endif
endif
-ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
+ifeq ($(ADK_TARGET_BINFMT_FLAT)$(ADK_TARGET_OS_FROSTED),y)
TARGET_LDFLAGS+= -Wl,-elf2flt
TARGET_CFLAGS+= -Wl,-elf2flt
TARGET_CXXFLAGS+= -Wl,-elf2flt
@@ -241,7 +241,7 @@ endif
# special operating system flags
ifeq ($(ADK_TARGET_OS_FROSTED),y)
-TARGET_CFLAGS+= -mlong-calls -fno-common -msingle-pic-base -mno-pic-data-is-text-relative
+TARGET_CFLAGS+= -fPIC -mlong-calls -fno-common -msingle-pic-base -mno-pic-data-is-text-relative
endif
# special architecture optimization flags
diff --git a/target/config/Config.in.binfmt b/target/config/Config.in.binfmt
index 9257fe69d..7567b07bc 100644
--- a/target/config/Config.in.binfmt
+++ b/target/config/Config.in.binfmt
@@ -26,11 +26,6 @@ config ADK_TARGET_BINFMT_DSBT
endchoice
-config ADK_TARGET_BINFMT_FLAT
- bool
- depends on ADK_TARGET_OS_FROSTED
- default y
-
# Set up flat binary type
choice
prompt "FLAT Binary type"
diff --git a/target/frosted/Config.in b/target/frosted/Config.in
index 3ed716f71..074826250 100644
--- a/target/frosted/Config.in
+++ b/target/frosted/Config.in
@@ -292,39 +292,30 @@ endif
choice
prompt "Board"
- default FROSTED_MACH_STM32F407Discovery
config FROSTED_MACH_STM32F746Discovery
bool "STM32F746 Discovery"
depends on (FROSTED_ARCH_STM32F746)
- default y
config FROSTED_MACH_STM32F769Discovery
bool "STM32F769 Discovery"
depends on (FROSTED_ARCH_STM32F769)
- default y
config FROSTED_MACH_STM32F746Nucleo144
bool "STM32F746 Nucleo-144"
depends on (FROSTED_ARCH_STM32F746)
- default y
config FROSTED_MACH_STM32F407Discovery
bool "STM32F407Discovery"
depends on (FROSTED_ARCH_STM32F407)
- default y
config FROSTED_MACH_STM32F405Pyboard
bool "STM32F405 PyBoard (micropython)"
depends on (FROSTED_ARCH_STM32F405)
- default y
config FROSTED_MACH_STM32F4x1Discovery
bool "STM32F4x1Discovery"
depends on ( FROSTED_ARCH_STM32F401 ||FROSTED_ARCH_STM32F411)
- default y
config FROSTED_MACH_STM32F429Discovery
bool "STM32F429Discovery"
depends on (FROSTED_ARCH_STM32F429)
- default y
config FROSTED_MACH_STM32F446Nucleo
bool "STM32F446 Nucleo"
depends on (FROSTED_ARCH_STM32F446)
- default y
config FROSTED_MACH_LPC1768MBED
bool "LPC1768MBED"
@@ -332,19 +323,15 @@ endif
config FROSTED_MACH_SEEEDPRO
bool "SEEEDPRO"
depends on FROSTED_ARCH_LPC1768
- default y
config FROSTED_MACH_LPC1679XPRESSO
bool "LPC1679XPRESSO"
depends on FROSTED_ARCH_LPC1769
- default y
config FROSTED_MACH_LM3S6965EVB
bool "lm3s6965evb"
depends on FROSTED_ARCH_LM3S6965
- default y
config FROSTED_MACH_LM3SVIRT
bool "lm3s-qemu"
depends on FROSTED_ARCH_LM3SVIRT
- default y
endchoice
@@ -487,7 +474,6 @@ menu "Networking"
config FROSTED_PICOTCP
bool "Built-in PicoTCP"
- default y
endchoice
if FROSTED_PICOTCP
diff --git a/toolchain/Makefile b/toolchain/Makefile
index fb46789f2..2502d3f15 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -40,7 +40,7 @@ TARGETS+=newlib
CLIB:=newlib
endif
-ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
+ifeq ($(ADK_TARGET_BINFMT_FLAT)$(ADK_TARGET_OS_FROSTED),y)
TARGETS+=elf2flt
ELF2FLT:=elf2flt-install
endif
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
index 1cb0d2540..095e6649a 100644
--- a/toolchain/gcc/Makefile
+++ b/toolchain/gcc/Makefile
@@ -51,10 +51,6 @@ GCC_CONFOPTS:= --prefix=$(TOOLCHAIN_DIR)/usr \
--disable-werror \
--disable-nls
-ifeq ($(ADK_TARGET_LIB_NEWLIB),y)
-GCC_FINAL_CONFOPTS:= --with-newlib
-endif
-
ifeq ($(ADK_TARGET_WITH_NPTL),y)
GCC_FINAL_CONFOPTS:= --enable-tls --enable-threads --enable-libatomic
GCC_TLS_CONFOPTS:= --enable-tls
@@ -68,7 +64,11 @@ GCC_FINAL_CONFOPTS:= --disable-tls --disable-threads --disable-libatomic
GCC_TLS_CONFOPTS:= --disable-tls
endif
-ifeq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY),y)
+ifeq ($(ADK_TARGET_LIB_NEWLIB),y)
+GCC_FINAL_CONFOPTS+= --with-newlib
+endif
+
+ifeq ($(ADK_TARGET_OS_FROSTED)$(ADK_TARGET_USE_STATIC_LIBS_ONLY),y)
GCC_FINAL_CONFOPTS+= --disable-shared
else
GCC_FINAL_CONFOPTS+= --enable-shared --enable-cxx-flags='-fPIC'
diff --git a/toolchain/newlib/Makefile b/toolchain/newlib/Makefile
index d2b3a5758..abe153107 100644
--- a/toolchain/newlib/Makefile
+++ b/toolchain/newlib/Makefile
@@ -15,6 +15,7 @@ NEWLIB_CONFIGURE_ARGS+= --enable-newlib-fvwrite-in-streamio=no \
--enable-newlib-fseek-optimization=no \
--enable-newlib_wide_orient=no \
--enable-newlib-unbuf-stream-opt=yes
+TARGET_CFLAGS+="-DREENTRANT_SYSCALLS_PROVIDED"
endif
@@ -23,6 +24,7 @@ $(WRKBUILD)/.configured:
CC='' \
CFLAGS='' \
LDFLAGS='' \
+ CFLAGS_FOR_TARGET='$(TARGET_CFLAGS)' \
./configure --prefix=/usr \
--target=$(GNU_TARGET_NAME) \
--disable-nls \
@@ -33,14 +35,16 @@ $(WRKBUILD)/.configured:
$(WRKBUILD)/.compiled:
PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
CC='' \
- CFLAGS='$(TARGET_CFLAGS)' \
+ CFLAGS='' \
+ CFLAGS_FOR_TARGET='$(TARGET_CFLAGS)' \
all
touch $@
$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
CC='' \
- CFLAGS='$(TARGET_CFLAGS)' \
+ CFLAGS='' \
+ CFLAGS_FOR_TARGET='$(TARGET_CFLAGS)' \
DESTDIR=$(STAGING_TARGET_DIR) \
install
touch $@