Kaynağa Gözat

get the uClibc-ng testsuite correctly linked as bFLT, create missing symlink to ld

Waldemar Brodkorb 9 yıl önce
ebeveyn
işleme
17b1218c61

+ 12 - 4
toolchain/binutils/Makefile

@@ -38,7 +38,6 @@ ifeq (${ADK_STATIC_TOOLCHAIN},y)
 BINUTILS_STATIC_MAKEOPTS+=LDFLAGS='$(HOST_STATIC_LLDFLAGS)'
 endif
 
-$(WRKBUILD)/.headers:
 $(WRKBUILD)/.configured:
 ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
 	tar xf $(ADK_TOPDIR)/target/xtensa/overlay/xtensa_$(ADK_TARGET_XTENSA).tar \
@@ -59,11 +58,11 @@ endif
 		${CONFOPTS} \
 	);
 	$(MAKE) ${BINUTILS_MAKEOPTS} -C $(WRKBUILD) configure-host
-	@touch $@
+	touch $@
 
 $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
 	$(MAKE) ${BINUTILS_MAKEOPTS} ${BINUTILS_STATIC_MAKEOPTS} -C $(WRKBUILD) all
-	@touch $@
+	touch $@
 
 $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
 	$(MAKE) -C $(WRKBUILD) install
@@ -73,6 +72,15 @@ ifeq ($(ADK_TARGET_ARCH_H8300),y)
 	$(CP) $(WRKBUILD)/ld/ldscripts/* $(STAGING_TARGET_DIR)/usr/lib/ldscripts/
 endif
 endif
-	@touch $@
+ifeq ($(ADK_TARGET_USE_GOLD),y)
+	(cd $(TOOLCHAIN_DIR)/usr/bin && \
+		ln -sf $(GNU_TARGET_NAME)-ld.gold $(GNU_TARGET_NAME)-ld)
+else
+ifeq (ADK_TOOLCHAIN_BINUTILS_2_20_1),)
+	(cd $(TOOLCHAIN_DIR)/usr/bin && \
+		ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld)
+endif
+endif
+	touch $@
 
 include ${ADK_TOPDIR}/mk/toolchain.mk

+ 19 - 16
toolchain/elf2flt/Makefile

@@ -4,7 +4,7 @@
 include $(ADK_TOPDIR)/rules.mk
 include Makefile.inc
 include ../rules.mk
-include ${ADK_TOPDIR}/mk/buildhlp.mk
+include $(ADK_TOPDIR)/mk/buildhlp.mk
 
 ifeq ($(ADK_TOOLCHAIN_BINUTILS_GIT),y)
 BINUTILS_VERSION:=	git
@@ -22,14 +22,15 @@ ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_25_1),y)
 BINUTILS_VERSION:=	2.25.1
 endif
 
-$(WRKBUILD)/.headers:
 $(WRKBUILD)/.configured:
-	(cd $(WRKBUILD); CPPFLAGS="-idirafter ${ADK_TOPDIR}/adk/include" ./configure --prefix=$(STAGING_HOST_DIR)/usr \
-			--target=$(GNU_TARGET_NAME) \
-			--with-bfd-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-${BINUTILS_VERSION}-1/binutils-${BINUTILS_VERSION}/bfd \
-			--with-binutils-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-${BINUTILS_VERSION}-1/binutils-${BINUTILS_VERSION}/include \
-			--with-libbfd=$(TOOLCHAIN_BUILD_DIR)/w-binutils-${BINUTILS_VERSION}-1/binutils-${BINUTILS_VERSION}/bfd/libbfd.a \
-			--with-libiberty=$(TOOLCHAIN_BUILD_DIR)/w-binutils-${BINUTILS_VERSION}-1/binutils-${BINUTILS_VERSION}/libiberty/libiberty.a )
+	(cd $(WRKBUILD); \
+	CPPFLAGS="-idirafter $(ADK_TOPDIR)/adk/include" \
+	./configure --prefix=$(STAGING_HOST_DIR)/usr \
+		--target=$(GNU_TARGET_NAME) \
+		--with-bfd-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/bfd \
+		--with-binutils-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/include \
+		--with-libbfd=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/bfd/libbfd.a \
+		--with-libiberty=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/libiberty/libiberty.a )
 	touch $@
 
 $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
@@ -37,13 +38,15 @@ $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
 	touch $@
 
 $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
-	${INSTALL_BIN} ${WRKBUILD}/elf2flt ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/bin
-	${INSTALL_BIN} ${WRKBUILD}/flthdr ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/bin
-	${INSTALL_BIN} ${WRKBUILD}/ld-elf2flt ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/bin
-	${INSTALL_DATA} ${WRKBUILD}/elf2flt.ld ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/lib
-	rm $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-ld
-	(cd ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/bin && \
-		ln -sf ld.bfd ld.real )
+	$(INSTALL_BIN) $(WRKBUILD)/elf2flt $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
+	$(INSTALL_BIN) $(WRKBUILD)/flthdr $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
+	$(INSTALL_BIN) $(WRKBUILD)/ld-elf2flt $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
+	$(INSTALL_DATA) $(WRKBUILD)/elf2flt.ld $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/lib
+	rm $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-ld $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin/ld
+	(cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin \
+		&& ln -sf ld.bfd ld.real \
+		&& ln -sf ld-elf2flt ld \
+	)
 	(cd $(TOOLCHAIN_DIR)/usr/bin && \
 		ln -sf ../$(GNU_TARGET_NAME)/bin/elf2flt $(GNU_TARGET_NAME)-elf2flt && \
 		ln -sf ../$(GNU_TARGET_NAME)/bin/flthdr $(GNU_TARGET_NAME)-flthdr && \
@@ -52,4 +55,4 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
 	(cd $(TOOLCHAIN_DIR)/usr/bin/ && ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld.real )
 	touch $@
 
-include ${ADK_TOPDIR}/mk/toolchain.mk
+include $(ADK_TOPDIR)/mk/toolchain.mk

+ 0 - 9
toolchain/gcc/Makefile

@@ -312,15 +312,6 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
 		ln -sf $(GNU_TARGET_NAME)-gcc $(GNU_TARGET_NAME)-gcc-${PKG_VERSION} && \
 		ln -sf $(GNU_TARGET_NAME)-g++ $(GNU_TARGET_NAME)-g++-${PKG_VERSION} \
 	)
-ifeq ($(ADK_TARGET_USE_GOLD),y)
-	(cd $(TOOLCHAIN_DIR)/usr/bin && \
-		ln -sf $(GNU_TARGET_NAME)-ld.gold $(GNU_TARGET_NAME)-ld)
-else
-ifeq (ADK_TOOLCHAIN_BINUTILS_2_20_1),)
-	(cd $(TOOLCHAIN_DIR)/usr/bin && \
-		ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld)
-endif
-endif
 	cd $(STAGING_TARGET_DIR)/lib && \
 		ln -sf libstdc++.so.6.0.$(LIBSTDCXXVER) libstdc++.so && \
 		ln -sf libstdc++.so.6.0.$(LIBSTDCXXVER) libstdc++.so.6

+ 2 - 0
toolchain/uclibc-ng/Makefile

@@ -290,6 +290,7 @@ endif
 
 $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
 	PATH='$(HOST_PATH)' $(MAKE) $(UCLIBC_MAKEOPTS) -C $(WRKBUILD) \
+		CC='$(TARGET_CC)' \
 		PREFIX= \
 		DEVEL_PREFIX=/usr/ \
 		RUNTIME_PREFIX=/ \
@@ -302,6 +303,7 @@ $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
 
 $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
 	PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
+		CC='$(TARGET_CC)' \
 		PREFIX=$(STAGING_TARGET_DIR) \
 		DEVEL_PREFIX=/usr/ \
 		DEVEL_PREFIX_LIB=/ \