Browse Source

add gold support

Waldemar Brodkorb 10 years ago
parent
commit
d63d9df8e5

+ 3 - 2
mk/build.mk

@@ -41,8 +41,9 @@ DEFCONFIG=		ADK_DEBUG=n \
 			ADK_PKG_TEST=n \
 			ADK_PKG_MPDBOX=n \
 			ADK_PKG_DEVELOPMENT=n \
-			ADK_TOOLCHAIN_GCC_USE_SSP=n \
-			ADK_TOOLCHAIN_GCC_USE_LTO=n \
+			ADK_TOOLCHAIN_USE_SSP=n \
+			ADK_TOOLCHAIN_USE_LTO=n \
+			ADK_TOOLCHAIN_USE_GOLD=n \
 			BUSYBOX_IFPLUGD=n \
 			BUSYBOX_EXTRA_COMPAT=n \
 			BUSYBOX_FEATURE_IFCONFIG_SLIP=n \

+ 2 - 2
mk/vars.mk

@@ -117,13 +117,13 @@ TARGET_CXXFLAGS+=	-static
 TARGET_LDFLAGS+=	-static
 endif
 
-ifneq ($(ADK_TOOLCHAIN_GCC_USE_SSP),)
+ifneq ($(ADK_TOOLCHAIN_USE_SSP),)
 TARGET_CFLAGS+=		-fstack-protector
 TARGET_CXXFLAGS+=	-fstack-protector
 TARGET_LDFLAGS+=	-fstack-protector
 endif
 
-ifneq ($(ADK_TOOLCHAIN_GCC_USE_LTO),)
+ifneq ($(ADK_TOOLCHAIN_USE_LTO),)
 TARGET_CFLAGS+=		-flto
 TARGET_CXXFLAGS+=	-flto
 TARGET_LDFLAGS+=	-flto

+ 1 - 1
package/avahi/Makefile

@@ -61,7 +61,7 @@ CONFIGURE_ARGS+=	--enable-glib \
 			--with-avahi-user=avahi \
 			--with-avahi-group=avahi
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 CONFIGURE_ARGS+=	--enable-stack-protector
 else
 CONFIGURE_ARGS+=	--disable-stack-protector

+ 1 - 1
package/dansguardian/Makefile

@@ -26,7 +26,7 @@ ifeq ($(ADK_COMPILE_DANSGUARDIAN_WITH_UCLIBCXX),y)
 LIBRARIES:=-nodefaultlibs -luClibc++ -lgcc -lm -lc -lgcc_s
 endif
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 LIBRARIES+=-lssp
 endif
 

+ 1 - 1
package/dmidecode/Makefile

@@ -18,7 +18,7 @@ $(eval $(call PKG_template,DMIDECODE,dmidecode,$(PKG_VERSION)-${PKG_RELEASE},${P
 
 CONFIG_STYLE:=		manual
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 TARGET_LDFLAGS+=        -lssp
 endif
 

+ 1 - 1
package/fltk/Makefile

@@ -30,7 +30,7 @@ ifeq ($(ADK_COMPILE_LIBFLTK_WITH_UCLIBCXX),y)
 LIBRARIES:=-nodefaultlibs -luClibc++ -lgcc -lgcc_s -lm -lc
 endif
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 LIBRARIES+=-lssp -lssp_nonshared
 endif
 

+ 0 - 7
package/gcc/Makefile

@@ -39,12 +39,6 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64EL),y)
 CONFIGURE_ARGS+=       --with-abi=$(ADK_TARGET_MIPS_ABI)
 endif
 
-ifeq ($(ADK_TOOLCHAIN_GCC_SJLJ),y)
-CONFIGURE_ARGS+=	--enable-sjlj-exceptions
-else
-CONFIGURE_ARGS+=	--disable-sjlj-exceptions
-endif
-
 ifneq ($(ADK_PACKAGE_GXX),)
 CONFIGURE_ARGS+=	--enable-languages=c,c++
 else
@@ -57,7 +51,6 @@ else
 CONFIGURE_ARGS+=	--enable-target-optspace
 endif
 
-
 CONFIGURE_ENV+=		have_sys_sdt_h=no
 CONFIGURE_ARGS+=	--host=$(GNU_TARGET_NAME) \
 			--target=$(GNU_TARGET_NAME) \

+ 1 - 1
package/id3lib/Makefile

@@ -28,7 +28,7 @@ ifeq ($(ADK_COMPILE_ID3LIB_WITH_UCLIBCXX),y)
 LIBRARIES:=-nodefaultlibs -luClibc++ -lz -lm -lc -lgcc
 endif
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 LIBRARIES+=-lssp -fstack-protector
 endif
 

+ 1 - 1
package/iperf/Makefile

@@ -22,7 +22,7 @@ $(eval $(call PKG_template,IPERF,iperf,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPEN
 TARGET_CFLAGS:=         $(filter-out -flto,$(TARGET_CFLAGS))
 TARGET_CXXFLAGS:=	$(filter-out -flto,$(TARGET_CXXFLAGS))
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 TARGET_LDFLAGS+=	-lssp
 endif
 

+ 1 - 1
package/mrd6/Makefile

@@ -26,7 +26,7 @@ ifeq (${ADK_COMPILE_MRD6_WITH_UCLIBCXX},y)
 LIBRARIES:=-nodefaultlibs -luClibc++
 endif
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 LIBRARIES+=-lssp -lssp_nonshared
 endif
 

+ 1 - 1
package/net-tools/Makefile

@@ -23,7 +23,7 @@ $(eval $(call PKG_template,ARP,arp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},
 
 CONFIG_STYLE:=		manual
 INSTALL_STYLE:=		manual
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 TARGET_LDFLAGS+=	-lssp
 endif
 

+ 1 - 1
package/nmap/Makefile

@@ -21,7 +21,7 @@ include ${TOPDIR}/mk/package.mk
 
 $(eval $(call PKG_template,NMAP,nmap,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 LIBRARIES+=-lssp -lssp_nonshared
 endif
 

+ 1 - 1
package/openssh/Makefile

@@ -50,7 +50,7 @@ CONFIGURE_ARGS+=	--with-kerberos5="${STAGING_TARGET_DIR}/usr"
 TARGET_LDFLAGS+=	-L$(STAGING_TARGET_DIR)/usr/lib/heimdal -Wl,-rpath -Wl,/usr/lib/heimdal
 endif
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 CONFIGURE_ARGS+=	--with-stackprotect
 else
 CONFIGURE_ARGS+=	--without-stackprotect

+ 1 - 1
package/sudo/Makefile

@@ -21,7 +21,7 @@ CONFIGURE_ARGS+=	--without-pam \
 			--without-sendmail \
 			--with-env-editor
 
-ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
 CONFIGURE_ARGS+=	--enable-hardening
 else
 CONFIGURE_ARGS+=	--disable-hardening

+ 19 - 8
toolchain/Config.in

@@ -10,26 +10,37 @@ config ADK_TOOLCHAIN_GCC_CXX
 	boolean
 	default y
 
-config ADK_TOOLCHAIN_GCC_SSP
-	prompt "Enable Stack Smashing Protection in GCC"
+config ADK_TOOLCHAIN_SSP
+	prompt "Enable Stack Smashing Protection"
 	boolean
 	default y
 
-config ADK_TOOLCHAIN_GCC_USE_SSP
+config ADK_TOOLCHAIN_USE_SSP
 	prompt "Use SSP for all packages"
  	boolean	
-	depends on ADK_TOOLCHAIN_GCC_SSP
+	depends on ADK_TOOLCHAIN_SSP
 	default n
 
-config ADK_TOOLCHAIN_GCC_LTO
-	prompt "Enable Link Time Optimization in GCC"
+config ADK_TOOLCHAIN_LTO
+	prompt "Enable Link Time Optimization"
 	boolean
 	default y
 
-config ADK_TOOLCHAIN_GCC_USE_LTO
+config ADK_TOOLCHAIN_USE_LTO
 	prompt "Use Link Time Optimization for all packages"
 	boolean
-	depends on ADK_TOOLCHAIN_GCC_LTO
+	depends on ADK_TOOLCHAIN_LTO
+	default n
+
+config ADK_TOOLCHAIN_GOLD
+	prompt "Enable GOLD as linker"
+	boolean
+	default y
+
+config ADK_TOOLCHAIN_USE_GOLD
+	prompt "Use GOLD as linker for all packages"
+	boolean
+	depends on ADK_TOOLCHAIN_GOLD
 	default n
 
 endmenu

+ 13 - 1
toolchain/binutils/Makefile

@@ -6,12 +6,24 @@ include Makefile.inc
 include ../rules.mk
 include ${TOPDIR}/mk/buildhlp.mk
 
-ifeq ($(ADK_TOOLCHAIN_GCC_SSP),y)
+ifeq ($(ADK_TOOLCHAIN_SSP),y)
 CONFOPTS+=		--enable-libssp
 else
 CONFOPTS+=		--disable-libssp
 endif
 
+ifeq ($(ADK_TOOLCHAIN_LTO),y)
+CONFOPTS+=		--enable-lto
+else
+CONFOPTS+=		--disable-lto
+endif
+
+ifeq ($(ADK_TOOLCHAIN_GOLD),y)
+CONFOPTS+=		--enable-gold
+else
+CONFOPTS+=		--disable-gold
+endif
+
 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
 CONFOPTS+=          	--with-arch=armv6
 endif

+ 8 - 1
toolchain/gcc/Makefile

@@ -202,11 +202,18 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
 	# remove duplicate tools, convert hardlinks to symlinks
 	set -e; \
 	cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin; \
-		for app in ar as c++ g++ gcc ld ld.bfd nm objcopy objdump ranlib strip; do \
+		for app in ar as c++ g++ gcc ld ld.gold ld.bfd nm objcopy objdump ranlib strip; do \
 			ln -sf ../../bin/$(GNU_TARGET_NAME)-$${app} $${app}; \
 		done;
 	(cd $(TOOLCHAIN_DIR)/usr/bin && \
 		ln -sf $(GNU_TARGET_NAME)-gcc $(GNU_TARGET_NAME)-gcc-${PKG_VERSION})
+ifeq ($(ADK_TOOLCHAIN_USE_GOLD),y)
+	(cd $(TOOLCHAIN_DIR)/usr/bin && \
+		ln -sf $(GNU_TARGET_NAME)-ld.gold $(GNU_TARGET_NAME)-ld)
+else
+	(cd $(TOOLCHAIN_DIR)/usr/bin && \
+		ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld)
+endif
 	cd $(STAGING_TARGET_DIR)/lib && \
 		ln -sf libstdc++.so.6.0.18 libstdc++.so && \
 		ln -sf libstdc++.so.6.0.18 libstdc++.so.6