summaryrefslogtreecommitdiff
path: root/toolchain/gcc
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /toolchain/gcc
Initial import
Diffstat (limited to 'toolchain/gcc')
-rw-r--r--toolchain/gcc/Makefile100
-rw-r--r--toolchain/gcc/Makefile.inc11
-rw-r--r--toolchain/gcc/patches/arm-softfloat-libgcc.patch29
3 files changed, 140 insertions, 0 deletions
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
new file mode 100644
index 000000000..a85e4fa74
--- /dev/null
+++ b/toolchain/gcc/Makefile
@@ -0,0 +1,100 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+
+
+ifeq ($(ADK_CXX),y)
+TARGET_LANGUAGES:= c,c++
+else
+TARGET_LANGUAGES:= c
+endif
+
+GCC_CONFOPTS= --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --with-gmp=$(STAGING_TOOLS) \
+ --with-mpfr=$(STAGING_TOOLS) \
+ --disable-__cxa_atexit \
+ --enable-target-optspace \
+ --with-gnu-ld \
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-multilib \
+ --disable-nls
+
+ifeq ($(ADK_SSP),y)
+GCC_CONFOPTS+= --enable-libssp
+else
+GCC_CONFOPTS+= --disable-libssp
+endif
+
+ifeq ($(ADK_NO_FPU),y)
+GCC_CONFOPTS+= --with-float=soft
+endif
+
+include ${TOPDIR}/mk/buildhlp.mk
+
+GCC_BUILD_DIR1:= $(WRKBUILD)-initial
+GCC_BUILD_DIR2:= $(WRKBUILD)-final
+
+$(WRKBUILD)/.headers:
+$(GCC_BUILD_DIR1)/.configured:
+ rm -rf $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/sys-include
+ ln -sf ${STAGING_DIR}/include $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/sys-include
+ rm -rf ${STAGING_TOOLS}/$(REAL_GNU_TARGET_NAME)/lib
+ ln -sf ${STAGING_DIR}/lib $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/lib
+ mkdir -p $(GCC_BUILD_DIR1)
+ (cd $(GCC_BUILD_DIR1); rm -f config.cache; PATH=$(TARGET_PATH) \
+ $(WRKBUILD)/configure \
+ ${GCC_CONFOPTS} \
+ --enable-languages=c \
+ --disable-shared \
+ --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ );
+ touch $@
+
+$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc all-target-libgcc
+ touch $@
+
+$(WRKBUILD)/.configure_done: $(GCC_BUILD_DIR1)/.compiled
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc install-target-libgcc
+ touch $@
+
+$(GCC_BUILD_DIR2)/.configured:
+ mkdir -p $(GCC_BUILD_DIR2)
+ (cd $(GCC_BUILD_DIR2); rm -f config.cache; PATH=$(TARGET_PATH) \
+ $(WRKBUILD)/configure \
+ ${GCC_CONFOPTS} \
+ --enable-languages=$(TARGET_LANGUAGES) \
+ --with-sysroot=$(STAGING_DIR) \
+ --enable-shared \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(GCC_BUILD_DIR2)/.configured
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install
+ echo $(GCC_VERSION) > $(STAGING_TOOLS)/gcc_version
+ # Set up the symlinks to enable lying about target name.
+ set -e; \
+ (cd $(STAGING_TOOLS); \
+ ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
+ cd bin; \
+ for app in $(REAL_GNU_TARGET_NAME)-* ; do \
+ ln -sf $${app} \
+ $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
+ done; \
+ )
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/gcc/Makefile.inc b/toolchain/gcc/Makefile.inc
new file mode 100644
index 000000000..6d8be0f9d
--- /dev/null
+++ b/toolchain/gcc/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= gcc
+PKG_VERSION:= 4.3.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cc3c5565fdb9ab87a05ddb106ba0bd1f
+MASTER_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/toolchain/gcc/patches/arm-softfloat-libgcc.patch b/toolchain/gcc/patches/arm-softfloat-libgcc.patch
new file mode 100644
index 000000000..1639c39a8
--- /dev/null
+++ b/toolchain/gcc/patches/arm-softfloat-libgcc.patch
@@ -0,0 +1,29 @@
+Index: gcc-4.3.0/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.3.0/gcc/config/arm/t-linux (revision 129896)
++++ gcc-4.3.0/gcc/config/arm/t-linux (working copy)
+@@ -3,7 +3,10 @@
+ TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+Index: gcc-4.3.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.3.0/gcc/config/arm/linux-elf.h (revision 129896)
++++ gcc-4.3.0/gcc/config/arm/linux-elf.h (working copy)
+@@ -48,7 +62,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+