summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/vars.mk5
-rw-r--r--target/config/Config.in.binfmt23
-rw-r--r--toolchain/uclibc-ng/Makefile14
3 files changed, 30 insertions, 12 deletions
diff --git a/mk/vars.mk b/mk/vars.mk
index 13dd97716..d95caaa82 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -108,11 +108,14 @@ TARGET_LDFLAGS:= -L$(STAGING_TARGET_DIR)/lib -L$(STAGING_TARGET_DIR)/usr/lib \
-Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib
ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
+TARGET_LDFLAGS+= -elf2flt
+endif
+
+ifeq ($(ADK_TARGET_ARCH_M68K),y)
ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
TARGET_CFLAGS+= -msep-data
TARGET_CXXFLAGS+= -msep-data
endif
-TARGET_LDFLAGS+= -elf2flt
endif
ifeq ($(ADK_TARGET_LIB_MUSL),y)
diff --git a/target/config/Config.in.binfmt b/target/config/Config.in.binfmt
index 88c875d84..239442da4 100644
--- a/target/config/Config.in.binfmt
+++ b/target/config/Config.in.binfmt
@@ -30,20 +30,21 @@ depends on ADK_TARGET_BINFMT_FLAT
default ADK_TARGET_BINFMT_FLAT_ONE
config ADK_TARGET_BINFMT_FLAT_ONE
- bool "One memory region"
- help
- All segments are linked into one memory region.
+ bool "One memory region"
+ help
+ All segments are linked into one memory region.
config ADK_TARGET_BINFMT_FLAT_SEP_DATA
- bool "Separate data and code region"
- help
- Allow for the data and text segments to be separated and placed in
- different regions of memory.
+ bool "Separate data and code region"
+ depends on ADK_TARGET_ARCH_M68K || ADK_TARGET_ARCH_BFIN
+ help
+ Allow for the data and text segments to be separated and placed in
+ different regions of memory.
config ADK_TARGET_BINFMT_FLAT_SHARED
- bool "Shared binary"
- select ADK_TARGET_BINFMT_SUPPORTS_SHARED
- help
- Allow to load and link indiviual FLAT binaries at run time.
+ bool "Shared binary"
+ select ADK_TARGET_BINFMT_SUPPORTS_SHARED
+ help
+ Allow to load and link indiviual FLAT binaries at run time.
endchoice
diff --git a/toolchain/uclibc-ng/Makefile b/toolchain/uclibc-ng/Makefile
index cd5f99de3..bb6769659 100644
--- a/toolchain/uclibc-ng/Makefile
+++ b/toolchain/uclibc-ng/Makefile
@@ -61,8 +61,16 @@ ifeq ($(ADK_TARGET_HARD_FLOAT),y)
$(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/# \1 is not set/' ${WRKBUILD}/.config
endif
ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
+ifeq ($(ADK_TARGET_BINFMT_FLAT_ONE),y)
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_ONE\).*/\1=y/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
$(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/\1=y/' ${WRKBUILD}/.config
endif
+ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SHARED\).*/\1=y/' ${WRKBUILD}/.config
+endif
+endif
ifeq ($(ADK_TARGET_UCLINUX),y)
$(SED) 's/.*\(ARCH_USE_MMU\).*/# \1 is not set/' ${WRKBUILD}/.config
endif
@@ -179,6 +187,7 @@ endif
RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
HOSTCC="$(HOST_CC)" \
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
oldconfig
PATH='$(HOST_PATH)' $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
PREFIX=$(STAGING_TARGET_DIR) \
@@ -186,6 +195,7 @@ endif
RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
HOSTCC="$(HOST_CC)" \
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
install_headers
touch $(WRKBUILD)/.configured
touch $@
@@ -197,6 +207,7 @@ $(WRKBUILD)/.compiled:
RUNTIME_PREFIX=/ \
HOSTCC="$(HOST_CC)" \
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
VERBOSE=1 \
all
touch $@
@@ -208,6 +219,7 @@ $(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled
DEVEL_PREFIX_LIB=/ \
RUNTIME_PREFIX=/ \
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
VERBOSE=1 \
install_dev
touch $@
@@ -219,6 +231,7 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
DEVEL_PREFIX_LIB=/ \
RUNTIME_PREFIX=/ \
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
VERBOSE=1 \
install_runtime
touch $@
@@ -230,6 +243,7 @@ ifeq ($(ADK_UCLIBC_TEST),y)
TEST_INSTALLED_UCLIBC=1 \
UCLIBC_ONLY=1 \
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
VERBOSE=1 \
test_compile
endif