summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target/config/Config.in15
-rw-r--r--toolchain/eglibc/Makefile15
-rw-r--r--toolchain/eglibc/Makefile.multilib31
-rw-r--r--toolchain/kernel-headers/Makefile13
4 files changed, 71 insertions, 3 deletions
diff --git a/target/config/Config.in b/target/config/Config.in
index 5dd14a6d1..893751686 100644
--- a/target/config/Config.in
+++ b/target/config/Config.in
@@ -127,6 +127,21 @@ depends on ADK_TARGET_KERNEL64 && \
config ADK_TARGET_WITH_MULTILIB
boolean "multilib support"
+config ADK_TARGET_MULTILIB_MIPS_64
+ boolean "64 bit libraries (n64 abi)"
+ depends on ADK_LINUX_MIPS && ADK_TARGET_WITH_MULTILIB
+ default y if ADK_n64
+
+config ADK_TARGET_MULTILIB_MIPS_N32
+ boolean "32 bit libraries (n32 abi)"
+ depends on ADK_LINUX_MIPS && ADK_TARGET_WITH_MULTILIB
+ default y if ADK_n32
+
+config ADK_TARGET_MULTILIB_MIPS_O32
+ boolean "32 bit libraries (o32 abi)"
+ depends on ADK_LINUX_MIPS && ADK_TARGET_WITH_MULTILIB
+ default y if ADK_o32
+
config ADK_TARGET_MULTILIB_X86_64
boolean "64 bit libraries"
depends on ADK_LINUX_X86_64 && ADK_TARGET_WITH_MULTILIB
diff --git a/toolchain/eglibc/Makefile b/toolchain/eglibc/Makefile
index b165d1ba7..ec648d9af 100644
--- a/toolchain/eglibc/Makefile
+++ b/toolchain/eglibc/Makefile
@@ -30,7 +30,7 @@ $(WRKBUILD)/.headers_configure:
$(EGLIBC_BUILD_DIR_INITIAL)-$${abi/*:/}/option-groups.config; \
(cd $(EGLIBC_BUILD_DIR_INITIAL)-$${abi/*:/}; \
${EGLIBC_ENV} \
- CC="${REAL_GNU_TARGET_NAME}-gcc -m$${abi/*:/}" \
+ CC="${REAL_GNU_TARGET_NAME}-gcc ${TCFLAGS}$${abi/*:/}" \
$(WRKBUILD)/libc/configure \
--prefix=$(STAGING_TARGET_DIR)-$${abi/*:/}/usr \
--with-headers=$(STAGING_TARGET_DIR)-$${abi/*:/}/usr/include \
@@ -44,7 +44,7 @@ $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
for abi in $(TABI); do \
(cd $(EGLIBC_BUILD_DIR_INITIAL)-$${abi/*:/}; \
${EGLIBC_ENV} \
- CC="${REAL_GNU_TARGET_NAME}-gcc -m$${abi/*:/}" \
+ CC="${REAL_GNU_TARGET_NAME}-gcc ${TCFLAGS}$${abi/*:/}" \
$(MAKE) install-headers install-bootstrap-headers=yes cross-compiling=yes \
); \
touch $(STAGING_TARGET_DIR)-$${abi/*:/}/usr/include/gnu/stubs.h; \
@@ -94,7 +94,7 @@ $(WRKBUILD)/.configured:
$(EGLIBC_BUILD_DIR_FINAL)-$${abi/*:/}/option-groups.config ;\
(cd $(EGLIBC_BUILD_DIR_FINAL)-$${abi/*:/}; \
${EGLIBC_ENV} \
- CC="${REAL_GNU_TARGET_NAME}-gcc -m$${abi/*:/}" \
+ CC="${REAL_GNU_TARGET_NAME}-gcc ${TCFLAGS}$${abi/*:/}" \
$(WRKBUILD)/libc/configure \
--prefix=/usr \
--enable-shared \
@@ -116,6 +116,15 @@ $(WRKBUILD)/.installed: $(EGLIBC_BUILD_DIR_FINAL)/libc.so
for abi in $(TABI); do \
${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL)-$${abi/*:/} install_root=$(STAGING_TARGET_DIR)-$${abi/*:/} install ;\
done
+ifeq ($(ADK_TARGET_ABI_N64),y)
+ ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL)-64 install_root=$(STAGING_TARGET_DIR) install
+endif
+ifeq ($(ADK_TARGET_ABI_N32),y)
+ ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL)-n32 install_root=$(STAGING_TARGET_DIR) install
+endif
+ifeq ($(ADK_TARGET_ABI_O32),y)
+ ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL)-o32 install_root=$(STAGING_TARGET_DIR) install
+endif
ifeq ($(ADK_TARGET_ABI_64),y)
${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL)-64 install_root=$(STAGING_TARGET_DIR) install
endif
diff --git a/toolchain/eglibc/Makefile.multilib b/toolchain/eglibc/Makefile.multilib
index 08be0a100..517fbed26 100644
--- a/toolchain/eglibc/Makefile.multilib
+++ b/toolchain/eglibc/Makefile.multilib
@@ -1,13 +1,44 @@
# multilib support
ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
TABI:=
+TCFLAGS:=
ifeq ($(ADK_TARGET_MULTILIB_X86_X32),y)
TABI+=x86_64-openadk-linux-gnu:x32
+TCFLAGS:=-m
endif
ifeq ($(ADK_TARGET_MULTILIB_X86_32),y)
TABI+=i486-openadk-linux-gnu:32
+TCFLAGS:=-m
endif
ifeq ($(ADK_TARGET_MULTILIB_X86_64),y)
TABI+=x86_64-openadk-linux-gnu:64
+TCFLAGS:=-m
+endif
+ifeq ($(ADK_TARGET_MULTILIB_MIPS_N32),y)
+ifeq ($(ADK_KERNEL_CPU_LITTLE_ENDIAN),y)
+TABI+=mips64el-openadk-linux-gnu:n32
+TCFLAGS:=-mabi=
+else
+TABI+=mips64-openadk-linux-gnu:n32
+TCFLAGS:=-mabi=
+endif
+endif
+ifeq ($(ADK_TARGET_MULTILIB_MIPS_O32),y)
+ifeq ($(ADK_KERNEL_CPU_LITTLE_ENDIAN),y)
+TABI+=mips64el-openadk-linux-gnu:o32
+TCFLAGS:=-mabi=
+else
+TABI+=mips64-openadk-linux-gnu:o32
+TCFLAGS:=-mabi=
+endif
+endif
+ifeq ($(ADK_TARGET_MULTILIB_MIPS_64),y)
+ifeq ($(ADK_KERNEL_CPU_LITTLE_ENDIAN),y)
+TABI+=mips64el-openadk-linux-gnu:64
+TCFLAGS:=-mabi=
+else
+TABI+=mips64-openadk-linux-gnu:64
+TCFLAGS:=-mabi=
+endif
endif
endif
diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile
index e81fa87eb..8b364d760 100644
--- a/toolchain/kernel-headers/Makefile
+++ b/toolchain/kernel-headers/Makefile
@@ -11,6 +11,18 @@ $(WRKBUILD)/.headers:
INSTALL_HDR_PATH=$(STAGING_DIR)/usr \
headers_install
ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
+ifeq ($(ADK_LINUX_MIPS),y)
+ $(MAKE) -C $(WRKBUILD) HOSTCC=$(CC_FOR_BUILD) ARCH=mips V=1 \
+ INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)-n32/usr \
+ headers_install
+ $(MAKE) -C $(WRKBUILD) HOSTCC=$(CC_FOR_BUILD) ARCH=mips V=1 \
+ INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)-64/usr \
+ headers_install
+ $(MAKE) -C $(WRKBUILD) HOSTCC=$(CC_FOR_BUILD) ARCH=mips V=1 \
+ INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)-o32/usr \
+ headers_install
+endif
+ifeq ($(ADK_LINUX_X86_64),y)
$(MAKE) -C $(WRKBUILD) HOSTCC=$(CC_FOR_BUILD) ARCH=x86 V=1 \
INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)-32/usr \
headers_install
@@ -21,6 +33,7 @@ ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)-64/usr \
headers_install
endif
+endif
$(MAKE) -C $(WRKBUILD) HOSTCC=$(CC_FOR_BUILD) ARCH=$(ARCH) V=1 \
INSTALL_HDR_PATH=$(LINUX_HEADER_DIR) \
headers_install