From aa4ab58940fe84dfd79b230407b0eac2fd10a80b Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 19 Feb 2010 00:36:11 +0100 Subject: first try to get eglibc/glibc based toolchain working when HOST == TARGET eglibc/glibc toolchain does not compile correctly. With this patches at least eglibc compiles fine. There still exist a problem with glibc. Someone should check what diff in eglibc make the build work :} --- toolchain/eglibc/Makefile | 1 - toolchain/gcc/Makefile | 9 ++++++--- toolchain/glibc/Makefile | 11 +++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) (limited to 'toolchain') diff --git a/toolchain/eglibc/Makefile b/toolchain/eglibc/Makefile index d6cf99e27..aeec91c90 100644 --- a/toolchain/eglibc/Makefile +++ b/toolchain/eglibc/Makefile @@ -44,7 +44,6 @@ $(WRKBUILD)/.headers_configure: mkdir -p $(EGLIBC_BUILD_DIR_INITIAL) (cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION); \ ln -sf ../ports ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)/libc); - #(cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)/libc; autoconf --force); $(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \ $(EGLIBC_BUILD_DIR_INITIAL) (cd $(EGLIBC_BUILD_DIR_INITIAL); \ diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index 619ddf47c..0fc5edc1d 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -17,6 +17,7 @@ GCC_CONFOPTS= --prefix=$(STAGING_TOOLS) \ --disable-libmudflap \ --disable-libgomp \ --disable-biarch \ + --disable-decimal-float \ --disable-multilib \ --disable-sjlj-exceptions \ --disable-libssp \ @@ -56,7 +57,7 @@ $(GCC_BUILD_DIR_MINIMAL)/.configured: $(GCC_BUILD_DIR_MINIMAL)/.compiled: $(GCC_BUILD_DIR_MINIMAL)/.configured PATH=$(TARGET_PATH) \ - $(MAKE) -C $(GCC_BUILD_DIR_MINIMAL) all-gcc + $(MAKE) -C $(GCC_BUILD_DIR_MINIMAL) all-gcc touch $@ $(WRKBUILD)/.headers: $(GCC_BUILD_DIR_MINIMAL)/.compiled @@ -76,6 +77,8 @@ $(GCC_BUILD_DIR_INITIAL)/.configured: ${GCC_CONFOPTS} \ --enable-languages=c \ --disable-shared \ + --disable-threads \ + --with-newlib \ --with-sysroot=$(TOOLCHAIN_SYSROOT) \ ); touch $@ @@ -83,12 +86,12 @@ $(GCC_BUILD_DIR_INITIAL)/.configured: $(GCC_BUILD_DIR_INITIAL)/.compiled: $(GCC_BUILD_DIR_INITIAL)/.configured PATH=$(TARGET_PATH) \ - $(MAKE) -C $(GCC_BUILD_DIR_INITIAL) all + $(MAKE) -C $(GCC_BUILD_DIR_INITIAL) all-gcc all-target-libgcc touch $@ $(WRKBUILD)/.configured: $(GCC_BUILD_DIR_INITIAL)/.compiled PATH=$(TARGET_PATH) \ - $(MAKE) -C $(GCC_BUILD_DIR_INITIAL) install + $(MAKE) -C $(GCC_BUILD_DIR_INITIAL) install-gcc install-target-libgcc touch $@ $(GCC_BUILD_DIR_FINAL)/.configured: diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile index 2b3fc252f..978794dc9 100644 --- a/toolchain/glibc/Makefile +++ b/toolchain/glibc/Makefile @@ -57,11 +57,22 @@ $(WRKBUILD)/.headers_configure: touch $@ $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure + mkdir -p $(TOOLCHAIN_SYSROOT)/usr/lib $(MAKE) -C $(GLIBC_BUILD_DIR_INITIAL) \ cross-compiling=yes \ install_root=$(TOOLCHAIN_SYSROOT) \ install-headers touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h + PATH='${TARGET_PATH}' \ + $(MAKE) -C $(GLIBC_BUILD_DIR_INITIAL) \ + csu/subdir_lib + ( cd $(GLIBC_BUILD_DIR_INITIAL); \ + $(CP) csu/crt1.o csu/crti.o csu/crtn.o \ + $(TOOLCHAIN_SYSROOT)/usr/lib \ + ); + PATH='${TARGET_PATH}' \ + $(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \ + -o $(TOOLCHAIN_SYSROOT)/usr/lib/libc.so touch $@ $(WRKBUILD)/.configured: -- cgit v1.2.3 From 0097a8249ca2d1a498b457019db15d3540a259f3 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 20 Feb 2010 17:19:15 +0100 Subject: add vendor string "openadk" to toolchain triplet With this change you can compile toolchains even when host cpu arch is identical to target cpu arch. --- toolchain/eglibc/Makefile | 10 ------ toolchain/glibc/Makefile | 13 ++----- toolchain/glibc/Makefile.inc | 2 +- toolchain/glibc/patches/longjmp_chk.patch | 56 +++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 22 deletions(-) create mode 100644 toolchain/glibc/patches/longjmp_chk.patch (limited to 'toolchain') diff --git a/toolchain/eglibc/Makefile b/toolchain/eglibc/Makefile index aeec91c90..1605113c6 100644 --- a/toolchain/eglibc/Makefile +++ b/toolchain/eglibc/Makefile @@ -60,16 +60,6 @@ $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure PATH='${TARGET_PATH}' \ $(MAKE) -C $(EGLIBC_BUILD_DIR_INITIAL) \ install-headers install-bootstrap-headers=yes - PATH='${TARGET_PATH}' \ - $(MAKE) -C $(EGLIBC_BUILD_DIR_INITIAL) \ - csu/subdir_lib - ( cd $(EGLIBC_BUILD_DIR_INITIAL); \ - $(CP) csu/crt1.o csu/crti.o csu/crtn.o \ - $(TOOLCHAIN_SYSROOT)/usr/lib \ - ); - PATH='${TARGET_PATH}' \ - $(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \ - -o $(TOOLCHAIN_SYSROOT)/usr/lib/libc.so touch $@ $(WRKBUILD)/.configured: diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile index 978794dc9..2058c41d4 100644 --- a/toolchain/glibc/Makefile +++ b/toolchain/glibc/Makefile @@ -63,16 +63,6 @@ $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure install_root=$(TOOLCHAIN_SYSROOT) \ install-headers touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h - PATH='${TARGET_PATH}' \ - $(MAKE) -C $(GLIBC_BUILD_DIR_INITIAL) \ - csu/subdir_lib - ( cd $(GLIBC_BUILD_DIR_INITIAL); \ - $(CP) csu/crt1.o csu/crti.o csu/crtn.o \ - $(TOOLCHAIN_SYSROOT)/usr/lib \ - ); - PATH='${TARGET_PATH}' \ - $(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \ - -o $(TOOLCHAIN_SYSROOT)/usr/lib/libc.so touch $@ $(WRKBUILD)/.configured: @@ -92,7 +82,8 @@ $(WRKBUILD)/.compiled: touch $@ $(WRKBUILD)/.installed: - ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_DIR) install + ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) \ + install_root=$(STAGING_DIR) install touch $(STAGING_DIR)/usr/include/gnu/stubs.h touch $@ diff --git a/toolchain/glibc/Makefile.inc b/toolchain/glibc/Makefile.inc index 596c71955..23659af5d 100644 --- a/toolchain/glibc/Makefile.inc +++ b/toolchain/glibc/Makefile.inc @@ -2,7 +2,7 @@ # material, please see the LICENCE file in the top-level directory. PKG_NAME:= glibc -PKG_VERSION:= 2.11 +PKG_VERSION:= 2.11.1 PKG_RELEASE:= 1 PKG_MD5SUM:= 55d50abb2d7c366bde6fb5e35e681f9b PKG_SITES:= ${MASTER_SITE_GNU:=glibc/} diff --git a/toolchain/glibc/patches/longjmp_chk.patch b/toolchain/glibc/patches/longjmp_chk.patch new file mode 100644 index 000000000..b2590460c --- /dev/null +++ b/toolchain/glibc/patches/longjmp_chk.patch @@ -0,0 +1,56 @@ +diff -Nur glibc-2.11.orig/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S glibc-2.11/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S +--- glibc-2.11.orig/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S 2009-10-30 18:17:08.000000000 +0100 ++++ glibc-2.11/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S 2010-02-19 08:06:22.000000000 +0100 +@@ -33,10 +33,10 @@ + cfi_register(%ebx,%ecx); \ + LOAD_PIC_REG (bx); \ + leal longjmp_msg@GOTOFF(%ebx), %eax; \ +- call __GI___fortify_fail@PLT ++ call HIDDEN_JUMPTARGET(__fortify_fail) + #else + # define CALL_FAIL movl $longjmp_msg, %eax; \ +- call __fortify_fail ++ call HIDDEN_JUMPTARGET(__fortify_fail) + #endif + + +diff -Nur glibc-2.11.orig/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S glibc-2.11/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S +--- glibc-2.11.orig/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S 2009-10-30 18:17:08.000000000 +0100 ++++ glibc-2.11/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S 2010-02-19 08:06:22.000000000 +0100 +@@ -30,19 +30,13 @@ + + #define __longjmp ____longjmp_chk + +-#ifdef PIC +-# define CALL_FAIL __GI___fortify_fail +-#else +-# define CALL_FAIL __fortify_fail +-#endif +- + #define CHECK_RSP(reg) \ + cmp.ltu p0, p8 = reg, r12; \ + (p8) br.cond.dpnt .Lok;; \ + addl r28 = @ltoffx(longjmp_msg#), r1;; \ + ld8.mov r28 = [r28], longjmp_msg#;; \ + ld8 out0 = [r28]; \ +- br.call.sptk.many b0 = CALL_FAIL#;; \ ++ br.call.sptk.many b0 = HIDDEN_JUMPTARGET(__fortify_fail)#;; \ + .Lok: + + #include "__longjmp.S" +diff -Nur glibc-2.11.orig/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S glibc-2.11/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S +--- glibc-2.11.orig/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S 2009-10-30 18:17:08.000000000 +0100 ++++ glibc-2.11/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S 2010-02-19 08:06:22.000000000 +0100 +@@ -31,10 +31,10 @@ + + #ifdef PIC + # define CALL_FAIL leaq longjmp_msg(%rip), %rdi; \ +- call __GI___fortify_fail ++ call HIDDEN_JUMPTARGET(__fortify_fail) + #else + # define CALL_FAIL movq $longjmp_msg, %rdi; \ +- call __fortify_fail ++ call HIDDEN_JUMPTARGET(__fortify_fail) + #endif + + #define CHECK_RSP(reg) \ -- cgit v1.2.3