Browse Source

add toolchain settings menu point

- gdb compilation can be disabled
- gcc languages (c++/java) can be enabled/disabled
- gcc stack smashing protection can be enabled/disabled
Waldemar Brodkorb 14 years ago
parent
commit
d3b021b541
6 changed files with 31 additions and 4 deletions
  1. 1 0
      Config.in
  2. 3 0
      mk/vars.mk
  3. 2 0
      toolchain/Makefile
  4. 7 2
      toolchain/binutils/Makefile
  5. 15 2
      toolchain/gcc/Makefile
  6. 3 0
      toolchain/uClibc/Makefile

+ 1 - 0
Config.in

@@ -56,3 +56,4 @@ source "target/linux/Config.in"
 endmenu
 endmenu
 
 
 source "target/config/Config.in.adk"
 source "target/config/Config.in.adk"
+source "toolchain/Config.in"

+ 3 - 0
mk/vars.mk

@@ -15,6 +15,9 @@ else
 TARGET_DEBUGGING:=	-fomit-frame-pointer $(TARGET_OPTIMIZATION) 
 TARGET_DEBUGGING:=	-fomit-frame-pointer $(TARGET_OPTIMIZATION) 
 endif
 endif
 TARGET_CFLAGS:=		$(TARGET_CFLAGS_ARCH) $(TARGET_DEBUGGING) -fwrapv
 TARGET_CFLAGS:=		$(TARGET_CFLAGS_ARCH) $(TARGET_DEBUGGING) -fwrapv
+ifneq ($(ADK_TOOLCHAIN_GCC_USE_SSP),)
+TARGET_CFLAGS+=		-fstack-protector
+endif
 
 
 BASE_DIR:=		$(TOPDIR)
 BASE_DIR:=		$(TOPDIR)
 DISTDIR?=		${BASE_DIR}/dl
 DISTDIR?=		${BASE_DIR}/dl

+ 2 - 0
toolchain/Makefile

@@ -26,7 +26,9 @@ ifeq ($(ADK_TARGET_LIB_UCLIBC),y)
 TARGETS+=uClibc
 TARGETS+=uClibc
 LIBC:=uClibc
 LIBC:=uClibc
 endif
 endif
+ifeq ($(ADK_TOOLCHAIN_GDB),y)
 TARGETS+=gdb
 TARGETS+=gdb
+endif
 
 
 DOWNLOAD:=kernel-headers-download $(patsubst %,%-download,$(TARGETS))
 DOWNLOAD:=kernel-headers-download $(patsubst %,%-download,$(TARGETS))
 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))

+ 7 - 2
toolchain/binutils/Makefile

@@ -6,6 +6,12 @@ include Makefile.inc
 include ../rules.mk
 include ../rules.mk
 include ${TOPDIR}/mk/buildhlp.mk
 include ${TOPDIR}/mk/buildhlp.mk
 
 
+ifeq ($(ADK_TOOLCHAIN_GCC_SSP),y)
+CONFOPTS+=		--enable-libssp
+else
+CONFOPTS+=		--disable-libssp
+endif
+
 ifeq ($(ADK_LINUX_64),y)
 ifeq ($(ADK_LINUX_64),y)
 CONFOPTS+=		--enable-64-bit-bfd
 CONFOPTS+=		--enable-64-bit-bfd
 endif
 endif
@@ -22,14 +28,13 @@ $(WRKBUILD)/.configured:
 		--build=$(GNU_HOST_NAME) \
 		--build=$(GNU_HOST_NAME) \
 		--host=$(GNU_HOST_NAME) \
 		--host=$(GNU_HOST_NAME) \
 		--target=$(REAL_GNU_TARGET_NAME) \
 		--target=$(REAL_GNU_TARGET_NAME) \
-		--disable-nls \
 		--with-sysroot=$(TOOLCHAIN_SYSROOT) \
 		--with-sysroot=$(TOOLCHAIN_SYSROOT) \
 		--with-sysroot=$(STAGING_TARGET_DIR) \
 		--with-sysroot=$(STAGING_TARGET_DIR) \
 		--disable-multilib \
 		--disable-multilib \
 		--disable-dependency-tracking \
 		--disable-dependency-tracking \
 		--disable-libtool-lock \
 		--disable-libtool-lock \
+		--disable-nls \
 		--disable-werror \
 		--disable-werror \
-		--disable-libssp \
 		${CONFOPTS} \
 		${CONFOPTS} \
 	);
 	);
 	touch $@
 	touch $@

+ 15 - 2
toolchain/gcc/Makefile

@@ -19,7 +19,6 @@ GCC_CONFOPTS=		--prefix=$(STAGING_HOST_DIR) \
 			--disable-decimal-float \
 			--disable-decimal-float \
 			--disable-multilib \
 			--disable-multilib \
 			--disable-sjlj-exceptions \
 			--disable-sjlj-exceptions \
-			--disable-libssp \
 			--disable-libstdcxx-pch \
 			--disable-libstdcxx-pch \
 			--disable-ppl-version-check \
 			--disable-ppl-version-check \
 			--disable-cloog-version-check \
 			--disable-cloog-version-check \
@@ -27,6 +26,12 @@ GCC_CONFOPTS=		--prefix=$(STAGING_HOST_DIR) \
 			--without-cloog \
 			--without-cloog \
 			--disable-nls
 			--disable-nls
 
 
+ifeq ($(ADK_TOOLCHAIN_GCC_SSP),y)
+GCC_CONFOPTS+=		--enable-libssp
+else
+GCC_CONFOPTS+=		--disable-libssp
+endif
+
 ifeq ($(ARCH),cris)
 ifeq ($(ARCH),cris)
 GCC_CONFOPTS+=		--disable-tls
 GCC_CONFOPTS+=		--disable-tls
 else
 else
@@ -55,6 +60,14 @@ ifeq (${ADK_MAKE_PARALLEL},y)
 GCC_MAKEOPTS+=		-j${ADK_MAKE_JOBS}
 GCC_MAKEOPTS+=		-j${ADK_MAKE_JOBS}
 endif
 endif
 
 
+LANGUAGES:=c
+ifeq ($(ADK_TOOLCHAIN_GCC_CXX),y)
+LANGUAGES:=${LANGUAGES},c++
+endif
+ifeq ($(ADK_TOOLCHAIN_GCC_JAVA),y)
+LANGUAGES:=${LANGUAGES},java
+endif
+
 include ${TOPDIR}/mk/buildhlp.mk
 include ${TOPDIR}/mk/buildhlp.mk
 
 
 GCC_BUILD_DIR_MINIMAL:=	$(WRKBUILD)-minimal
 GCC_BUILD_DIR_MINIMAL:=	$(WRKBUILD)-minimal
@@ -119,7 +132,7 @@ $(GCC_BUILD_DIR_FINAL)/.configured:
 		PATH='$(TARGET_PATH)' \
 		PATH='$(TARGET_PATH)' \
 		$(WRKBUILD)/configure \
 		$(WRKBUILD)/configure \
 			${GCC_CONFOPTS} \
 			${GCC_CONFOPTS} \
-			--enable-languages=c,c++ \
+			--enable-languages=$(LANGUAGES) \
 			--with-sysroot=$(STAGING_TARGET_DIR) \
 			--with-sysroot=$(STAGING_TARGET_DIR) \
 			--with-slibdir=$(STAGING_TARGET_DIR)/lib \
 			--with-slibdir=$(STAGING_TARGET_DIR)/lib \
 			--enable-shared \
 			--enable-shared \

+ 3 - 0
toolchain/uClibc/Makefile

@@ -18,6 +18,9 @@ $(WRKBUILD)/.headers:
 	    $(TOPDIR)/target/$(ADK_TARGET_ARCH)/uclibc.config >${WRKBUILD}/.config
 	    $(TOPDIR)/target/$(ADK_TARGET_ARCH)/uclibc.config >${WRKBUILD}/.config
 ifneq ($(ADK_DEBUG),)
 ifneq ($(ADK_DEBUG),)
 	$(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config
 	$(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config
+endif
+ifneq ($(ADK_TOOLCHAIN_GCC_SSP),)
+	$(SED) 's,.*UCLIBC_HAS_SSP,UCLIBC_HAS_SSP=y,' ${WRKBUILD}/.config
 endif
 endif
 	$(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
 	$(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
 		PREFIX=$(TOOLCHAIN_SYSROOT) \
 		PREFIX=$(TOOLCHAIN_SYSROOT) \