summaryrefslogtreecommitdiff
path: root/toolchain/glibc
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/glibc
Initial import
Diffstat (limited to 'toolchain/glibc')
-rw-r--r--toolchain/glibc/Makefile99
-rw-r--r--toolchain/glibc/Makefile.inc10
-rw-r--r--toolchain/glibc/patches/binutils.patch12
-rw-r--r--toolchain/glibc/patches/gcc43.patch18
-rw-r--r--toolchain/glibc/patches/i586-chk.patch15
-rw-r--r--toolchain/glibc/patches/install-extra.patch84
-rw-r--r--toolchain/glibc/patches/make-install-lib.patch17
7 files changed, 255 insertions, 0 deletions
diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile
new file mode 100644
index 000000000..a819c65d9
--- /dev/null
+++ b/toolchain/glibc/Makefile
@@ -0,0 +1,99 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+_IN_CVTC= 1
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+
+include ${TOPDIR}/mk/buildhlp.mk
+
+ifeq ($(ADK_NO_FPU),y)
+GLIBC_CONFOPTS:= --without-fp
+endif
+
+GLIBC_BUILD_DIR:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
+GLIBC_BUILD_DIR2:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
+
+$(WRKBUILD)/.headers_configure:
+ mkdir -p $(GLIBC_BUILD_DIR)
+ (cd $(GLIBC_BUILD_DIR); \
+ $(WRKBUILD)/configure \
+ --prefix=/usr \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --disable-nls \
+ --without-cvs \
+ --disable-sanity-checks \
+ ${GLIBC_CONFOPTS} \
+ --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
+ --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ );
+ touch $@
+
+$(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
+ $(MAKE) -C $(GLIBC_BUILD_DIR) \
+ cross-compiling=yes \
+ install_root=$(TOOLCHAIN_SYSROOT) \
+ CFLAGS="-DBOOTSTRAP_GCC" install-headers
+ touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
+ $(CP) $(GLIBC_BUILD_DIR)/bits/stdio_lim.h \
+ $(TOOLCHAIN_SYSROOT)/usr/include/bits
+ touch $@
+
+$(WRKBUILD)/.configure_done:
+ mkdir -p $(GLIBC_BUILD_DIR2)
+ (cd $(GLIBC_BUILD_DIR2); \
+ PATH='${TARGET_PATH}' \
+ BUILD_CC=gcc \
+ CFLAGS="$(TARGET_CFLAGS_ARCH) -O2 -pipe" \
+ CC=${REAL_GNU_TARGET_NAME}-gcc \
+ AR=${REAL_GNU_TARGET_NAME}-ar \
+ RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
+ LD=${REAL_GNU_TARGET_NAME}-ld \
+ libc_cv_forced_unwind=yes \
+ libc_cv_c_cleanup=yes \
+ $(WRKBUILD)/configure \
+ --prefix=/usr \
+ --build=$(GNU_TARGET_NAME) \
+ --host=$(REAL_GNU_TARGET_NAME) \
+ --disable-nls \
+ --without-cvs \
+ --disable-profile \
+ --disable-debug \
+ --without-gd \
+ --enable-shared \
+ --enable-stackguard-randomization \
+ --enable-add-ons=nptl --with-__thread \
+ --with-tls \
+ --enable-tls \
+ ${GLIBC_CONFOPTS} \
+ --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled:
+ PATH='${TARGET_PATH}' \
+ CFLAGS="$(TARGET_CFLAGS_ARCH) -O2 -pipe" \
+ CC=${REAL_GNU_TARGET_NAME}-gcc \
+ LD=${REAL_GNU_TARGET_NAME}-ld \
+ RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
+ $(MAKE) -C $(GLIBC_BUILD_DIR2) lib \
+ cross-compiling=yes
+ touch $@
+
+$(WRKBUILD)/.installed:
+ PATH='${TARGET_PATH}' \
+ #CFLAGS="$(TARGET_CFLAGS_ARCH) $(TARGET_CFLAGS)" \
+ $(MAKE) -C $(GLIBC_BUILD_DIR2) \
+ install_root=$(STAGING_DIR) \
+ install-lib-all install-headers \
+ install-others cross-compiling=yes
+ touch $(STAGING_DIR)/usr/include/gnu/stubs.h
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/glibc/Makefile.inc b/toolchain/glibc/Makefile.inc
new file mode 100644
index 000000000..b2784a195
--- /dev/null
+++ b/toolchain/glibc/Makefile.inc
@@ -0,0 +1,10 @@
+# $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:= glibc
+PKG_VERSION:= 2.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 0b4bc75fb7413bbd7e43c0a0e7c672b6
+MASTER_SITES:= ${MASTER_SITE_GNU:=glibc/}
diff --git a/toolchain/glibc/patches/binutils.patch b/toolchain/glibc/patches/binutils.patch
new file mode 100644
index 000000000..5b1bd763e
--- /dev/null
+++ b/toolchain/glibc/patches/binutils.patch
@@ -0,0 +1,12 @@
+diff -Nur glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.7/sysdeps/i386/fpu/ftestexcept.c
+--- glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c 2004-03-05 11:14:48.000000000 +0100
++++ glibc-2.7/sysdeps/i386/fpu/ftestexcept.c 2008-12-22 01:03:19.000000000 +0100
+@@ -26,7 +26,7 @@
+ int
+ fetestexcept (int excepts)
+ {
+- int temp;
++ short temp;
+ int xtemp = 0;
+
+ /* Get current exceptions. */
diff --git a/toolchain/glibc/patches/gcc43.patch b/toolchain/glibc/patches/gcc43.patch
new file mode 100644
index 000000000..8bd45ee8c
--- /dev/null
+++ b/toolchain/glibc/patches/gcc43.patch
@@ -0,0 +1,18 @@
+diff -Nur glibc-2.7.orig/configure glibc-2.7/configure
+--- glibc-2.7.orig/configure 2007-10-18 13:22:23.000000000 +0200
++++ glibc-2.7/configure 2008-11-29 23:48:57.461566623 +0100
+@@ -5062,8 +5062,12 @@
+ # header directory and add that to the list. NOTE: Only does the right
+ # thing on a system that doesn't need fixincludes. (Not presently a problem.)
+ if test -n "$sysheaders"; then
+- ccheaders=`$CC -print-file-name=include`
+- SYSINCLUDES="-nostdinc -isystem $ccheaders \
++ SYSINCLUDES=-nostdinc
++ for d in include include-fixed; do
++ i=`$CC -print-file-name="$d"` && test "x$i" != "x$d" &&
++ SYSINCLUDES="$SYSINCLUDES -isystem $i"
++ done
++ SYSINCLUDES="$SYSINCLUDES \
+ -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
+ if test -n "$CXX"; then
+ cxxversion=`$CXX -dumpversion 2>&5` &&
diff --git a/toolchain/glibc/patches/i586-chk.patch b/toolchain/glibc/patches/i586-chk.patch
new file mode 100644
index 000000000..8ebc182e0
--- /dev/null
+++ b/toolchain/glibc/patches/i586-chk.patch
@@ -0,0 +1,15 @@
+diff -Nur glibc-2.7.orig/sysdeps/i386/i586/memcpy_chk.S glibc-2.7/sysdeps/i386/i586/memcpy_chk.S
+--- glibc-2.7.orig/sysdeps/i386/i586/memcpy_chk.S 1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.7/sysdeps/i386/i586/memcpy_chk.S 2008-09-17 12:22:02.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/i386/i686/memcpy_chk.S>
+diff -Nur glibc-2.7.orig/sysdeps/i386/i586/mempcpy_chk.S glibc-2.7/sysdeps/i386/i586/mempcpy_chk.S
+--- glibc-2.7.orig/sysdeps/i386/i586/mempcpy_chk.S 1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.7/sysdeps/i386/i586/mempcpy_chk.S 2008-09-17 12:22:02.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/i386/i686/mempcpy_chk.S>
+diff -Nur glibc-2.7.orig/sysdeps/i386/i586/memset_chk.S glibc-2.7/sysdeps/i386/i586/memset_chk.S
+--- glibc-2.7.orig/sysdeps/i386/i586/memset_chk.S 1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.7/sysdeps/i386/i586/memset_chk.S 2008-09-17 12:22:02.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/i386/i686/memset_chk.S>
diff --git a/toolchain/glibc/patches/install-extra.patch b/toolchain/glibc/patches/install-extra.patch
new file mode 100644
index 000000000..790bafc17
--- /dev/null
+++ b/toolchain/glibc/patches/install-extra.patch
@@ -0,0 +1,84 @@
+diff -Nur glibc-2.7.orig/elf/Makefile glibc-2.7/elf/Makefile
+--- glibc-2.7.orig/elf/Makefile 2007-08-16 23:20:11.000000000 +0200
++++ glibc-2.7/elf/Makefile 2008-09-17 08:57:12.000000000 +0200
+@@ -116,7 +116,7 @@
+ ifeq (yes,$(build-shared))
+ extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
+ generated += librtld.os dl-allobjs.os ld.so ldd
+-install-others = $(inst_slibdir)/$(rtld-installed-name)
++install-extra = $(inst_slibdir)/$(rtld-installed-name)
+ install-bin-script = ldd
+ endif
+
+diff -Nur glibc-2.7.orig/iconvdata/Makefile glibc-2.7/iconvdata/Makefile
+--- glibc-2.7.orig/iconvdata/Makefile 2007-09-30 06:00:02.000000000 +0200
++++ glibc-2.7/iconvdata/Makefile 2008-09-17 08:56:57.000000000 +0200
+@@ -211,7 +211,7 @@
+
+
+ extra-objs += $(modules.so)
+-install-others = $(addprefix $(inst_gconvdir)/, $(modules.so)) \
++install-extra = $(addprefix $(inst_gconvdir)/, $(modules.so)) \
+ $(inst_gconvdir)/gconv-modules
+
+ # We can build the conversion tables for numerous charsets automatically.
+diff -Nur glibc-2.7.orig/intl/Makefile glibc-2.7/intl/Makefile
+--- glibc-2.7.orig/intl/Makefile 2005-05-04 19:53:42.000000000 +0200
++++ glibc-2.7/intl/Makefile 2008-09-17 08:55:58.000000000 +0200
+@@ -45,7 +45,7 @@
+
+ before-compile = $(objpfx)msgs.h
+
+-install-others = $(inst_msgcatdir)/locale.alias
++install-extra = $(inst_msgcatdir)/locale.alias
+
+ generated = msgs.h mtrace-tst-gettext tst-gettext.mtrace
+ generated-dirs := domaindir localedir
+diff -Nur glibc-2.7.orig/localedata/Makefile glibc-2.7/localedata/Makefile
+--- glibc-2.7.orig/localedata/Makefile 2007-10-02 19:19:40.000000000 +0200
++++ glibc-2.7/localedata/Makefile 2008-09-17 08:55:35.000000000 +0200
+@@ -102,7 +102,7 @@
+ endif
+
+ # Files to install.
+-install-others := $(addprefix $(inst_i18ndir)/, \
++install-extra := $(addprefix $(inst_i18ndir)/, \
+ $(addsuffix .gz, $(charmaps)) \
+ $(locales))
+
+diff -Nur glibc-2.7.orig/po/Makefile glibc-2.7/po/Makefile
+--- glibc-2.7.orig/po/Makefile 2007-05-29 20:08:41.000000000 +0200
++++ glibc-2.7/po/Makefile 2008-09-17 08:55:15.000000000 +0200
+@@ -46,7 +46,7 @@
+ mo-installed = $(inst_msgcatdir)/%/LC_MESSAGES/$(domainname).mo
+
+ # Files to install: a $(domainname).mo file for each language.
+-install-others = $(LINGUAS:%=$(mo-installed))
++install-extra = $(LINGUAS:%=$(mo-installed))
+
+ # Files to distribute: all the source and compiled binary translation files.
+ distribute = $(ALL_LINGUAS:=.po) $(BROKEN_LINGUAS:=.po) $(ALL_LINGUAS:=.mo) \
+diff -Nur glibc-2.7.orig/sunrpc/Makefile glibc-2.7/sunrpc/Makefile
+--- glibc-2.7.orig/sunrpc/Makefile 2006-10-18 21:25:38.000000000 +0200
++++ glibc-2.7/sunrpc/Makefile 2008-09-17 08:54:26.000000000 +0200
+@@ -52,7 +52,7 @@
+ svc_auth.h types.h xdr.h auth_des.h \
+ des_crypt.h key_prot.h rpc_des.h) \
+ $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
+-install-others = $(inst_sysconfdir)/rpc
++install-extra = $(inst_sysconfdir)/rpc
+ generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
+ $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
+ generated-dirs := rpcsvc
+diff -Nur glibc-2.7.orig/timezone/Makefile glibc-2.7/timezone/Makefile
+--- glibc-2.7.orig/timezone/Makefile 2007-07-28 22:33:11.000000000 +0200
++++ glibc-2.7/timezone/Makefile 2008-09-17 08:54:43.000000000 +0200
+@@ -71,7 +71,7 @@
+
+ ifeq ($(cross-compiling),no)
+ # Don't try to install the zoneinfo files since we can't run zic.
+-install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
++install-extra = $(addprefix $(inst_zonedir)/,$(zonenames) \
+ $(zonenames:%=posix/%) \
+ $(zonenames:%=right/%)) \
+ $(installed-localtime-file) $(installed-posixrules-file)
diff --git a/toolchain/glibc/patches/make-install-lib.patch b/toolchain/glibc/patches/make-install-lib.patch
new file mode 100644
index 000000000..b5fb9295a
--- /dev/null
+++ b/toolchain/glibc/patches/make-install-lib.patch
@@ -0,0 +1,17 @@
+diff -Nur glibc-2.7.orig/Makerules glibc-2.7/Makerules
+--- glibc-2.7.orig/Makerules 2007-08-26 04:18:03.000000000 +0200
++++ glibc-2.7/Makerules 2008-09-12 11:35:40.000000000 +0200
+@@ -867,6 +867,13 @@
+ installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
+ $(inst_libdir)/$(patsubst %,$(libtype$o),\
+ $(libprefix)$(libc-name)))
++
++install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
++ $(inst_slibdir)/libc-$(version).so \
++ $(inst_libdir)/libc.so \
++ $(inst_libdir)/libc.a \
++ install-lib
++
+ install: $(installed-libcs)
+ $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
+ $(make-target-directory)