summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/build.mk6
-rw-r--r--mk/toolchain.mk1
-rw-r--r--mk/vars.mk3
-rw-r--r--package/dropbear/Makefile1
-rw-r--r--rules.mk1
-rw-r--r--target/config/Config.in4
-rw-r--r--target/x86_64/target.mk4
-rw-r--r--toolchain/Makefile7
-rw-r--r--toolchain/eglibc/Makefile43
-rw-r--r--toolchain/eglibc/Makefile.inc2
-rw-r--r--toolchain/eglibc/Makefile.multilib3
-rw-r--r--toolchain/glibc/Makefile36
-rw-r--r--toolchain/glibc/Makefile.multilib3
13 files changed, 65 insertions, 49 deletions
diff --git a/mk/build.mk b/mk/build.mk
index 0ad4ea788..fa2e21fd5 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -158,12 +158,12 @@ ifeq ($(ADK_NATIVE),y)
else
ifeq ($(ADK_TOOLCHAIN),y)
ifeq ($(ADK_TOOLCHAIN_ONLY),y)
- $(MAKE) -f mk/build.mk toolchain/install tools/install jtools/install package/compile
+ $(MAKE) -f mk/build.mk toolchain/fixup tools/install jtools/install package/compile
else
- $(MAKE) -f mk/build.mk toolchain/install tools/install jtools/install package/compile root_clean package/install
+ $(MAKE) -f mk/build.mk toolchain/fixup tools/install jtools/install package/compile root_clean package/install
endif
else
- $(MAKE) -f mk/build.mk toolchain/install tools/install jtools/install target/config-prepare target/compile package/compile root_clean package/install target/install package_index
+ $(MAKE) -f mk/build.mk toolchain/fixup tools/install jtools/install target/config-prepare target/compile package/compile root_clean package/install target/install package_index
endif
endif
diff --git a/mk/toolchain.mk b/mk/toolchain.mk
index 6a181a444..80860a0f1 100644
--- a/mk/toolchain.mk
+++ b/mk/toolchain.mk
@@ -2,5 +2,6 @@ prepare: ${WRKDIST}/.prepared $(WRKBUILD)/.headers
configure: ${WRKBUILD}/.configured
compile: $(WRKBUILD)/.compiled
install: $(WRKBUILD)/.installed
+fixup: $(WRKBUILD)/.fixup
clean:
rm -rf $(WRKDIR)
diff --git a/mk/vars.mk b/mk/vars.mk
index bdfd333ad..6fc2eb192 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -99,7 +99,8 @@ TARGET_CFLAGS:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident -fhonour-copts
TARGET_CXXFLAGS:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident
TARGET_LDFLAGS:= -L$(STAGING_TARGET_DIR)/lib -L$(STAGING_TARGET_DIR)/usr/lib \
-Wl,-O2 -Wl,-rpath -Wl,/usr/lib \
- -Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib
+ -Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib \
+ $(ADK_TARGET_ABI_LDFLAGS)
ifneq ($(ADK_NATIVE),)
TARGET_CPPFLAGS:=
diff --git a/package/dropbear/Makefile b/package/dropbear/Makefile
index 3728ef8da..31d9c68f8 100644
--- a/package/dropbear/Makefile
+++ b/package/dropbear/Makefile
@@ -24,6 +24,7 @@ include $(TOPDIR)/mk/package.mk
$(eval $(call PKG_template,DROPBEAR,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
$(eval $(call PKG_template,DBCONVERT,dropbearconvert,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_DBCONVERT},${PKG_SECTION}))
+TARGET_LDFLAGS+= $(ADK_TARGET_ABI_CFLAGS)
BUILD_STYLE:= manual
INSTALL_STYLE:= manual
CONFIGURE_ARGS+= --disable-pam \
diff --git a/rules.mk b/rules.mk
index fa303a953..a66762391 100644
--- a/rules.mk
+++ b/rules.mk
@@ -33,6 +33,7 @@ ADK_TARGET_ENDIAN:= $(strip $(subst ",, $(ADK_TARGET_ENDIAN)))
ADK_TARGET_CPU_ARCH:= $(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
ADK_TARGET_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS)))
ADK_TARGET_ABI_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_CFLAGS)))
+ADK_TARGET_ABI_LDFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_LDFLAGS)))
ADK_TARGET_KERNEL_LDFLAGS:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_LDFLAGS)))
ADK_TARGET_ABI:= $(strip $(subst ",, $(ADK_TARGET_ABI)))
ADK_TARGET_IP:= $(strip $(subst ",, $(ADK_TARGET_IP)))
diff --git a/target/config/Config.in b/target/config/Config.in
index 893751686..d31bd25a9 100644
--- a/target/config/Config.in
+++ b/target/config/Config.in
@@ -490,6 +490,10 @@ config ADK_TARGET_ABI_CFLAGS
default "-mx32" if ADK_TARGET_ABI_X32
default "-m64" if ADK_TARGET_ABI_64
+config ADK_TARGET_ABI_LDFLAGS
+ string
+ default "-Wl,-m -Wl,elf_i386" if ADK_TARGET_ABI_32
+
config ADK_TARGET_KERNEL_LDFLAGS
string
default "-mabi=64 -m elf64ltsmip" if ADK_TARGET_ABI_N32
diff --git a/target/x86_64/target.mk b/target/x86_64/target.mk
index 1d5465d7a..7fe893ec7 100644
--- a/target/x86_64/target.mk
+++ b/target/x86_64/target.mk
@@ -2,8 +2,4 @@ include $(TOPDIR)/mk/kernel-ver.mk
ARCH:= x86
CPU_ARCH:= x86_64
TARGET_OPTIMIZATION:= -O2 -pipe
-ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
-TARGET_CFLAGS_ARCH:= $(ADK_TARGET_CFLAGS)
-else
TARGET_CFLAGS_ARCH:= $(ADK_TARGET_CFLAGS) $(ADK_TARGET_ABI_CFLAGS)
-endif
diff --git a/toolchain/Makefile b/toolchain/Makefile
index a32648000..fd92b46f7 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -32,11 +32,13 @@ endif
DOWNLOAD:=kernel-headers-download $(patsubst %,%-download,$(TARGETS))
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
+FIXUP:=$(patsubst %,%-fixup,$(LIBC))
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
install: $(TARGETS_INSTALL)
clean: $(TARGETS_CLEAN)
download: $(DOWNLOAD)
+fixup: $(FIXUP)
gcc-prepare: binutils-install gmp-install mpfr-install mpc-install libelf-install
ifeq ($(ADK_TARGET_LIB_GLIBC),y)
@@ -47,6 +49,7 @@ endif
gcc-configure: $(LIBC)-prepare
$(LIBC)-compile: gcc-configure
gcc-compile: $(LIBC)-install
+$(LIBC)-fixup: gcc-install
$(STAGING_HOST_DIR):
@mkdir -p $(STAGING_HOST_DIR)/lib
@@ -102,6 +105,10 @@ $(STAGING_HOST_DIR):
$(MAKE_TRACE); \
fi
+%-fixup: %-install
+ $(TRACE) toolchain/$(patsubst %-fixup,%,$@)/fixup
+ @$(MAKE) -C $(patsubst %-fixup,%,$@) fixup $(MAKE_TRACE)
+
%-clean:
$(TRACE) toolchain/$(patsubst %-clean,%,$@)/clean
@$(MAKE) -C $(patsubst %-clean,%,$@) clean $(MAKE_TRACE)
diff --git a/toolchain/eglibc/Makefile b/toolchain/eglibc/Makefile
index 3529d9124..1f959944d 100644
--- a/toolchain/eglibc/Makefile
+++ b/toolchain/eglibc/Makefile
@@ -105,42 +105,20 @@ $(WRKBUILD)/.configured:
done
touch $@
-$(EGLIBC_BUILD_DIR_FINAL)/libc.so:
$(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
for abi in $(TABI); do \
${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL)-$${abi/*:/} cross-compiling=yes all ;\
done
touch $@
-$(WRKBUILD)/.installed: $(EGLIBC_BUILD_DIR_FINAL)/libc.so
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
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)
+ # default libgcc searching for 64 bit libraries
${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
-ifeq ($(ADK_TARGET_ABI_32),y)
- ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL)-32 install_root=$(STAGING_TARGET_DIR) install
-endif
-ifeq ($(ADK_TARGET_ABI_X32),y)
- ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL)-x32 install_root=$(STAGING_TARGET_DIR) install
-endif
touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs-{32,x32,64}.h
- # for libgcc build we need C library files, 64 bit default
- mkdir -p $(STAGING_TARGET_DIR)/lib/$(REAL_GNU_TARGET_NAME)/4.7.2 ; \
- $(CP) $(STAGING_TARGET_DIR)-64/lib/* $(STAGING_TARGET_DIR)-64/usr/lib/* \
- $(STAGING_TARGET_DIR)/lib/$(REAL_GNU_TARGET_NAME)/4.7.2/; \
- rm $(STAGING_TARGET_DIR)/lib/$(REAL_GNU_TARGET_NAME)/4.7.2/libc.so ; \
for abi in $(TABI); do \
mkdir -p $(STAGING_TARGET_DIR)/lib/$(REAL_GNU_TARGET_NAME)/4.7.2/$${abi/*:/} ; \
$(CP) $(STAGING_TARGET_DIR)-$${abi/*:/}/lib/* $(STAGING_TARGET_DIR)-$${abi/*:/}/usr/lib/* \
@@ -187,4 +165,21 @@ $(WRKBUILD)/.installed: $(EGLIBC_BUILD_DIR_FINAL)/libc.so
touch $@
endif
+ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
+$(WRKBUILD)/.fixup:
+ifeq ($(ADK_TARGET_ABI_64),y)
+ ${CP} $(STAGING_TARGET_DIR)-64/lib/* $(STAGING_TARGET_DIR)/lib
+ ${CP} $(STAGING_TARGET_DIR)-64/usr/lib/* $(STAGING_TARGET_DIR)/usr/lib
+endif
+ifeq ($(ADK_TARGET_ABI_32),y)
+ ${CP} $(STAGING_TARGET_DIR)-32/lib/* $(STAGING_TARGET_DIR)/lib
+ ${CP} $(STAGING_TARGET_DIR)-32/usr/lib/* $(STAGING_TARGET_DIR)/usr/lib
+endif
+ifeq ($(ADK_TARGET_ABI_X32),y)
+ ${CP} $(STAGING_TARGET_DIR)-x32/lib/* $(STAGING_TARGET_DIR)/lib
+ ${CP} $(STAGING_TARGET_DIR)-x32/usr/lib/* $(STAGING_TARGET_DIR)/usr/lib
+endif
+ touch $@
+endif
+
include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/eglibc/Makefile.inc b/toolchain/eglibc/Makefile.inc
index 2541bb5e5..8214e2237 100644
--- a/toolchain/eglibc/Makefile.inc
+++ b/toolchain/eglibc/Makefile.inc
@@ -16,7 +16,6 @@ EGLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \
--with-tls \
--enable-add-ons \
$(NLS)
-
EGLIBC_ENV:= PATH='${TARGET_PATH}' \
BUILD_CC=${CC_FOR_BUILD} \
GCC_HONOUR_COPTS=s \
@@ -31,4 +30,3 @@ EGLIBC_ENV:= PATH='${TARGET_PATH}' \
libc_cv_gnu99_inline=yes \
libc_cv_initfini_array=yes \
libc_cv_slibdir="/lib"
-
diff --git a/toolchain/eglibc/Makefile.multilib b/toolchain/eglibc/Makefile.multilib
index 517fbed26..6416bc006 100644
--- a/toolchain/eglibc/Makefile.multilib
+++ b/toolchain/eglibc/Makefile.multilib
@@ -1,3 +1,6 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
# multilib support
ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
TABI:=
diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile
index d6aeb64b2..0d3eea92d 100644
--- a/toolchain/glibc/Makefile
+++ b/toolchain/glibc/Makefile
@@ -100,31 +100,20 @@ $(WRKBUILD)/.configured:
done
touch $@
-$(GLIBC_BUILD_DIR_FINAL)/libc.so:
$(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
for abi in $(TABI); do \
${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_FINAL)-$${abi/*:/} all ;\
done
touch $@
-$(WRKBUILD)/.installed: $(GLIBC_BUILD_DIR_FINAL)/libc.so
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
for abi in $(TABI); do \
${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL)-$${abi/*:/} install_root=$(STAGING_TARGET_DIR)-$${abi/*:/} install ;\
done
-ifeq ($(ADK_TARGET_ABI_64),y)
+ # default libgcc searching for 64 bit libraries
${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL)-64 install_root=$(STAGING_TARGET_DIR) install
-endif
-ifeq ($(ADK_TARGET_ABI_32),y)
- ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL)-32 install_root=$(STAGING_TARGET_DIR) install
-endif
-ifeq ($(ADK_TARGET_ABI_X32),y)
- ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL)-x32 install_root=$(STAGING_TARGET_DIR) install
-endif
- # for libgcc build we need C library files, 64 bit default
- mkdir -p $(STAGING_TARGET_DIR)/lib/$(REAL_GNU_TARGET_NAME)/4.7.2 ; \
- $(CP) $(STAGING_TARGET_DIR)-64/lib/* $(STAGING_TARGET_DIR)-64/usr/lib/* \
- $(STAGING_TARGET_DIR)/lib/$(REAL_GNU_TARGET_NAME)/4.7.2/; \
- rm $(STAGING_TARGET_DIR)/lib/$(REAL_GNU_TARGET_NAME)/4.7.2/libc.so ; \
+ touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
+ touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs-{32,x32,64}.h
for abi in $(TABI); do \
mkdir -p $(STAGING_TARGET_DIR)/lib/$(REAL_GNU_TARGET_NAME)/4.7.2/$${abi/*:/} ; \
$(CP) $(STAGING_TARGET_DIR)-$${abi/*:/}/lib/* $(STAGING_TARGET_DIR)-$${abi/*:/}/usr/lib/* \
@@ -162,4 +151,21 @@ $(WRKBUILD)/.installed:
touch $@
endif
+ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
+$(WRKBUILD)/.fixup:
+ifeq ($(ADK_TARGET_ABI_64),y)
+ ${CP} $(STAGING_TARGET_DIR)-64/lib/* $(STAGING_TARGET_DIR)/lib
+ ${CP} $(STAGING_TARGET_DIR)-64/usr/lib/* $(STAGING_TARGET_DIR)/usr/lib
+endif
+ifeq ($(ADK_TARGET_ABI_32),y)
+ ${CP} $(STAGING_TARGET_DIR)-32/lib/* $(STAGING_TARGET_DIR)/lib
+ ${CP} $(STAGING_TARGET_DIR)-32/usr/lib/* $(STAGING_TARGET_DIR)/usr/lib
+endif
+ifeq ($(ADK_TARGET_ABI_X32),y)
+ ${CP} $(STAGING_TARGET_DIR)-x32/lib/* $(STAGING_TARGET_DIR)/lib
+ ${CP} $(STAGING_TARGET_DIR)-x32/usr/lib/* $(STAGING_TARGET_DIR)/usr/lib
+endif
+ touch $@
+endif
+
include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/glibc/Makefile.multilib b/toolchain/glibc/Makefile.multilib
index 08be0a100..47cc0ff99 100644
--- a/toolchain/glibc/Makefile.multilib
+++ b/toolchain/glibc/Makefile.multilib
@@ -1,3 +1,6 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
# multilib support
ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
TABI:=