From 7e58edfad5318ab12b990099e220be91b47366c0 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 7 Jan 2011 18:21:39 +0100 Subject: glibc: install some glibc-shipped config files - /etc/gai.conf - /etc/nscd.conf - /etc/nsswitch.conf Signed-off-by: Phil Sutter --- toolchain/glibc/Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'toolchain/glibc') diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile index 4d39e2b27..9480500d5 100644 --- a/toolchain/glibc/Makefile +++ b/toolchain/glibc/Makefile @@ -67,6 +67,10 @@ $(WRKBUILD)/.compiled: $(WRKBUILD)/.installed: ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) \ install_root=$(STAGING_TARGET_DIR) install + mkdir -p ${STAGING_TARGET_DIR}/etc + ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc/ + ${INSTALL_DATA} ${WRKBUILD}/nscd/nscd.conf ${STAGING_TARGET_DIR}/etc/ + ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc/ touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h touch $(WRKBUILD)/.installed -- cgit v1.2.3 From 3adbe63f92a5215422ad4e8f9adc924bb1936101 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 7 Jan 2011 18:21:54 +0100 Subject: glibc: fix build for ADK_TARGET_CFLAGS="-march=i686" Signed-off-by: Phil Sutter --- toolchain/glibc/patches/i686_define_bug.patch | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 toolchain/glibc/patches/i686_define_bug.patch (limited to 'toolchain/glibc') diff --git a/toolchain/glibc/patches/i686_define_bug.patch b/toolchain/glibc/patches/i686_define_bug.patch new file mode 100644 index 000000000..0414fecc9 --- /dev/null +++ b/toolchain/glibc/patches/i686_define_bug.patch @@ -0,0 +1,38 @@ + Fix for compiling glibc with -march=i686 specified. + The patch below found at: http://permalink.gmane.org/gmane.linux.lfs.devel/9758, + a nice discussion (with a comment of the glibc maintainer) can be found here: + http://old.nabble.com/-RFC-PATCH--glibc-doesn%27t-build-with-%22gcc--march%3Di686%22-td17442608.html + + To me, this simply shows once more how fucked up things can be. E.g. the (related) bug report here: + http://bugs.gentoo.org/show_bug.cgi?id=201815. There are lots of duplicates to it, many people are + affected, one can find really elaborate reports. And the responsible gentoo developers are too + elite to even point to the actual patch fixing the issue. +diff -Naur glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c +--- glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 20:10:20.000000000 +0000 ++++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c 2010-04-17 02:24:02.000000000 +0100 +@@ -45,6 +45,11 @@ + /* Embed an #include to pull in the alignment and .end directives. */ + asm ("\n#include \"defs.h\""); + ++asm ("\n#if defined __i686 && defined __ASSEMBLER__"); ++asm ("\n#undef __i686"); ++asm ("\n#define __i686 __i686"); ++asm ("\n#endif"); ++ + /* The initial common code ends here. */ + asm ("\n/*@HEADER_ENDS*/"); + +diff -Naur glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h +--- glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 20:10:20.000000000 +0000 ++++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-04-17 02:24:02.000000000 +0100 +@@ -29,6 +29,10 @@ + #include + #include + ++#if defined __i686 && defined __ASSEMBLER__ ++#undef __i686 ++#define __i686 __i686 ++#endif + + /* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h -- cgit v1.2.3 From a217fc80b29080dae963bb15051df023de36ce39 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 10 Jan 2011 10:59:12 +0100 Subject: add LTO support to toolchain settings. Cleanup SYSROOT mess. - just use on sysroot directory for toolchain. - add missing patches from previos commit. (rpath/cflags cleanup) --- TODO | 13 ++++++--- mk/build.mk | 1 + mk/buildhlp.mk | 4 ++- mk/vars.mk | 13 ++++++--- package/ImageMagick/patches/patch-config_ltmain_sh | 30 +++++++++++++++++++++ package/ImageMagick/patches/patch-configure | 20 -------------- package/dbus/patches/patch-configure | 6 ++--- package/dbus/patches/patch-ltmain_sh | 30 +++++++++++++++++++++ package/eglibc/Makefile | 5 ++-- package/fltk/patches/patch-fltk2-config_in | 27 +++++++++++++++++++ package/gettext/Makefile | 3 ++- package/gettext/patches/patch-build-aux_ltmain_sh | 30 +++++++++++++++++++++ package/gnupg/Makefile | 1 + package/irssi/patches/patch-build-aux_ltmain_sh | 30 +++++++++++++++++++++ package/krb5/patches/patch-src_krb5-config_in | 22 +++++++++++++++ package/libelf/Makefile | 11 ++++---- package/opensc/patches/patch-ltmain_sh | 30 +++++++++++++++++++++ package/opensc/patches/patch-src_Makefile_in | 6 ++--- package/rpcbind/patches/patch-ltmain_sh | 30 +++++++++++++++++++++ package/subversion/patches/patch-build_ltmain_sh | 30 +++++++++++++++++++++ target/linux/config/Config.in.netdevice | 1 + toolchain/Config.in | 18 ++++++++++++- toolchain/Makefile | 6 ++--- toolchain/binutils/Makefile | 1 - toolchain/eglibc/Makefile | 12 ++++++--- toolchain/gcc/Makefile | 25 +++++++++-------- toolchain/glibc/Makefile | 11 ++++---- toolchain/glibc/Makefile.inc | 2 +- toolchain/kernel-headers/Makefile | 5 ---- toolchain/libelf/Makefile | 31 ++++++++++++++++++++++ toolchain/libelf/Makefile.inc | 8 ++++++ toolchain/uClibc/Makefile | 18 ++++++++++--- 32 files changed, 402 insertions(+), 78 deletions(-) create mode 100644 package/ImageMagick/patches/patch-config_ltmain_sh delete mode 100644 package/ImageMagick/patches/patch-configure create mode 100644 package/dbus/patches/patch-ltmain_sh create mode 100644 package/fltk/patches/patch-fltk2-config_in create mode 100644 package/gettext/patches/patch-build-aux_ltmain_sh create mode 100644 package/irssi/patches/patch-build-aux_ltmain_sh create mode 100644 package/krb5/patches/patch-src_krb5-config_in create mode 100644 package/opensc/patches/patch-ltmain_sh create mode 100644 package/rpcbind/patches/patch-ltmain_sh create mode 100644 package/subversion/patches/patch-build_ltmain_sh create mode 100644 toolchain/libelf/Makefile create mode 100644 toolchain/libelf/Makefile.inc (limited to 'toolchain/glibc') diff --git a/TODO b/TODO index 34fed5d18..56959ebbe 100644 --- a/TODO +++ b/TODO @@ -1,20 +1,27 @@ - man pages in ipkg/tgz packages (automatic) +- automatic healing after move of adk directory (pc,la) - ccache support for speedup -- distcc eval +- distcc evaluation - GCC SSP evaluation - LTO GCC evaluation +- finish qemu package - fix autoreconf usage in opensc -- fix timezone stuff in eglibc/glibc +- fix timezone stuff in glibc - add back aufs2 patches for kernel - openssl ocf support check +- locales support - new package minidlna - wget/curl/ftp download support - fix heimdal package +- fix or remove bazaar package - check all patches for CFLAGS compliance, fhonour patch from FreeWRT +- rpath cleanup - busybox update and SuSv3 removal - check rtc support on foxg20 - adkinstall with NTP and hwclock support - PKG_CONFLICTS for python/python2, is this possible with Kconfig? - mirror only option, for no internet access -- add support for brcm 2.6 (lzma/flash/wireless support) +- add and test brcm 2.6 wireless support - help text for config/ needs adoption +- diet libc / klibc / newlib support +- pcc support? clang+llvm diff --git a/mk/build.mk b/mk/build.mk index 9f1841cc2..7c8a697f8 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -554,6 +554,7 @@ bulkallmod: done ${TOPDIR}/bin/tools/pkgmaker: + @mkdir -p $(TOPDIR)/bin/tools @$(HOSTCC) -Wall -g -o $@ tools/adk/pkgmaker.c tools/adk/sortfile.c tools/adk/strmap.c ${TOPDIR}/bin/tools/pkgrebuild: diff --git a/mk/buildhlp.mk b/mk/buildhlp.mk index c7c598de3..2cb4f1714 100644 --- a/mk/buildhlp.mk +++ b/mk/buildhlp.mk @@ -24,9 +24,11 @@ else _CHECKSUM_COOKIE= endif -post-extract: +${PACKAGE_DIR}/.stamps: @mkdir -p ${PACKAGE_DIR}/.stamps +post-extract: ${PACKAGE_DIR}/.stamps + ifeq ($(strip ${NO_DISTFILES}),1) ${WRKDIST}/.extract_done: rm -rf ${WRKDIST} ${WRKSRC} ${WRKBUILD} diff --git a/mk/vars.mk b/mk/vars.mk index 37461e981..7828347d5 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -9,14 +9,23 @@ INSTALL_SCRIPT= install -m0755 MAKEFLAGS= $(EXTRA_MAKEFLAGS) BUILD_USER= $(shell id -un) BUILD_GROUP= $(shell id -gn) + +# target compiler settings +TARGET_CPPFLAGS+= -I${STAGING_TARGET_DIR}/usr/include +TARGET_LDFLAGS+= -Wl,-O2 ifneq ($(ADK_DEBUG),) TARGET_DEBUGGING:= -g3 -fno-omit-frame-pointer else -TARGET_DEBUGGING:= -fomit-frame-pointer $(TARGET_OPTIMIZATION) +TARGET_DEBUGGING:= $(TARGET_OPTIMIZATION) -fomit-frame-pointer endif TARGET_CFLAGS:= $(TARGET_CFLAGS_ARCH) $(TARGET_DEBUGGING) -fwrapv ifneq ($(ADK_TOOLCHAIN_GCC_USE_SSP),) TARGET_CFLAGS+= -fstack-protector +TARGET_LDFLAGS+= -fstack-protector +endif +ifneq ($(ADK_TOOLCHAIN_GCC_USE_LTO),) +TARGET_CFLAGS+= -flto +TARGET_LDFLAGS+= -flto endif BASE_DIR:= $(TOPDIR) @@ -56,8 +65,6 @@ endif TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++ TARGET_LD:= ${TARGET_COMPILER_PREFIX}ld -TARGET_CPPFLAGS+= -I${STAGING_TARGET_DIR}/usr/include -TARGET_LDFLAGS+= -Wl,-O2 PATCH= ${BASH} $(SCRIPT_DIR)/patch.sh SED:= sed -i -e LINUX_DIR:= $(BUILD_DIR)/linux diff --git a/package/ImageMagick/patches/patch-config_ltmain_sh b/package/ImageMagick/patches/patch-config_ltmain_sh new file mode 100644 index 000000000..3c1be111b --- /dev/null +++ b/package/ImageMagick/patches/patch-config_ltmain_sh @@ -0,0 +1,30 @@ +--- ImageMagick-6.6.5-10.orig/config/ltmain.sh 2010-11-21 22:35:22.000000000 +0100 ++++ ImageMagick-6.6.5-10/config/ltmain.sh 2011-01-08 23:20:33.000000000 +0100 +@@ -5843,27 +5843,6 @@ func_mode_link () + esac + fi + +- # Hardcode the library path. +- # Skip directories that are in the system default run-time +- # search path. +- case " $sys_lib_dlsearch_path " in +- *" $absdir "*) ;; +- *) +- case "$compile_rpath " in +- *" $absdir "*) ;; +- *) compile_rpath="$compile_rpath $absdir" +- esac +- ;; +- esac +- case " $sys_lib_dlsearch_path " in +- *" $libdir "*) ;; +- *) +- case "$finalize_rpath " in +- *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" +- esac +- ;; +- esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && diff --git a/package/ImageMagick/patches/patch-configure b/package/ImageMagick/patches/patch-configure deleted file mode 100644 index 717f612ea..000000000 --- a/package/ImageMagick/patches/patch-configure +++ /dev/null @@ -1,20 +0,0 @@ ---- ImageMagick-6.6.5-10.orig/configure 2010-11-21 22:36:46.000000000 +0100 -+++ ImageMagick-6.6.5-10/configure 2011-01-07 00:03:54.000000000 +0100 -@@ -14824,7 +14824,7 @@ fi - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. -- hardcode_into_libs=yes -+ hardcode_into_libs=no - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" -@@ -18491,7 +18491,7 @@ fi - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. -- hardcode_into_libs=yes -+ hardcode_into_libs=no - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" diff --git a/package/dbus/patches/patch-configure b/package/dbus/patches/patch-configure index f33a192a9..85521d390 100644 --- a/package/dbus/patches/patch-configure +++ b/package/dbus/patches/patch-configure @@ -1,6 +1,6 @@ ---- dbus-1.2.16.orig/configure 2009-07-14 21:43:08.000000000 +0200 -+++ dbus-1.2.16/configure 2010-01-15 19:03:24.000000000 +0100 -@@ -25213,19 +25213,6 @@ if test "x$GCC" = "xyes"; then +--- dbus-1.2.24.orig/configure 2010-03-23 20:11:22.000000000 +0100 ++++ dbus-1.2.24/configure 2011-01-08 22:50:31.000000000 +0100 +@@ -25294,19 +25296,6 @@ if test "x$GCC" = "xyes"; then ;; esac diff --git a/package/dbus/patches/patch-ltmain_sh b/package/dbus/patches/patch-ltmain_sh new file mode 100644 index 000000000..b63e1d647 --- /dev/null +++ b/package/dbus/patches/patch-ltmain_sh @@ -0,0 +1,30 @@ +--- dbus-1.2.24.orig/ltmain.sh 2010-03-12 23:22:29.000000000 +0100 ++++ dbus-1.2.24/ltmain.sh 2011-01-08 22:57:14.000000000 +0100 +@@ -5516,27 +5516,6 @@ func_mode_link () + esac + fi + +- # Hardcode the library path. +- # Skip directories that are in the system default run-time +- # search path. +- case " $sys_lib_dlsearch_path " in +- *" $absdir "*) ;; +- *) +- case "$compile_rpath " in +- *" $absdir "*) ;; +- *) compile_rpath="$compile_rpath $absdir" +- esac +- ;; +- esac +- case " $sys_lib_dlsearch_path " in +- *" $libdir "*) ;; +- *) +- case "$finalize_rpath " in +- *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" +- esac +- ;; +- esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && diff --git a/package/eglibc/Makefile b/package/eglibc/Makefile index e82e3b707..844b49876 100644 --- a/package/eglibc/Makefile +++ b/package/eglibc/Makefile @@ -20,10 +20,9 @@ CONFIG_STYLE:= manual BUILD_STYLE:= manual INSTALL_STYLE:= manual -EGLIBC_CONFOPTS:= \ - --build=$(GNU_HOST_NAME) \ +EGLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \ --host=$(REAL_GNU_TARGET_NAME) \ - --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \ + --with-headers=$(STAGING_TARGET_DIR)/usr/include \ --disable-nls \ --without-cvs \ --disable-profile \ diff --git a/package/fltk/patches/patch-fltk2-config_in b/package/fltk/patches/patch-fltk2-config_in new file mode 100644 index 000000000..c4784688a --- /dev/null +++ b/package/fltk/patches/patch-fltk2-config_in @@ -0,0 +1,27 @@ +--- fltk-2.0.x-r7513.orig/fltk2-config.in 2006-04-15 19:43:12.000000000 +0200 ++++ fltk-2.0.x-r7513/fltk2-config.in 2011-01-08 23:34:40.000000000 +0100 +@@ -77,7 +77,6 @@ LDLIBS="@LDFLAGS@ @LIBS@" + # libraries to link with: + LIBNAME="@LIBNAME@" + DSONAME="@DSONAME@" +-DSOLINK="@DSOLINK@" + IMAGELIBS="@IMAGELIBS@" + SHAREDSUFFIX="@SHAREDSUFFIX@" + +@@ -168,7 +167,6 @@ do + bindir=${exec_prefix} + includedir=${prefix}/include + libdir=${prefix}/lib +- DSOLINK="-Wl,-rpath,${prefix}/lib" + ;; + --prefix) + echo_prefix=yes +@@ -283,7 +281,7 @@ if test x$use_images = xyes; then + LDSTATIC="$libdir/libfltk2_images.a $LDSTATIC $IMAGELIBS" + fi + +-LDLIBS="$DSOLINK $LDLIBS" ++LDLIBS="$LDLIBS" + LDSTATIC="$LDSTATIC_PATHS $LDSTATIC" + + # Answer to user requests diff --git a/package/gettext/Makefile b/package/gettext/Makefile index 76e73fed0..76d47acd5 100644 --- a/package/gettext/Makefile +++ b/package/gettext/Makefile @@ -18,7 +18,7 @@ ifeq ($(ADK_STATIC),y) PKG_OPTS:= libonly endif -WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}/gettext-runtime +WRKSRC= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}/gettext-runtime include ${TOPDIR}/mk/package.mk @@ -29,6 +29,7 @@ CONFIGURE_ARGS+= --disable-java \ --disable-csharp \ --enable-nls \ --disable-libasprintf \ + --disable-rpath \ --enable-threads=posix \ --disable-openmp \ --with-libiconv-prefix='${STAGING_TARGET_DIR}/usr' \ diff --git a/package/gettext/patches/patch-build-aux_ltmain_sh b/package/gettext/patches/patch-build-aux_ltmain_sh new file mode 100644 index 000000000..9141bd704 --- /dev/null +++ b/package/gettext/patches/patch-build-aux_ltmain_sh @@ -0,0 +1,30 @@ +--- gettext-0.18.1.1.orig/build-aux/ltmain.sh 2010-06-06 14:49:57.000000000 +0200 ++++ gettext-0.18.1.1/build-aux/ltmain.sh 2011-01-08 23:49:55.000000000 +0100 +@@ -5652,27 +5652,6 @@ func_mode_link () + esac + fi + +- # Hardcode the library path. +- # Skip directories that are in the system default run-time +- # search path. +- case " $sys_lib_dlsearch_path " in +- *" $absdir "*) ;; +- *) +- case "$compile_rpath " in +- *" $absdir "*) ;; +- *) compile_rpath="$compile_rpath $absdir" +- esac +- ;; +- esac +- case " $sys_lib_dlsearch_path " in +- *" $libdir "*) ;; +- *) +- case "$finalize_rpath " in +- *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" +- esac +- ;; +- esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && diff --git a/package/gnupg/Makefile b/package/gnupg/Makefile index ff3739775..d28b2b4dc 100644 --- a/package/gnupg/Makefile +++ b/package/gnupg/Makefile @@ -29,6 +29,7 @@ CONFIGURE_ARGS+= --disable-asm \ --disable-finger \ --disable-ftp \ --disable-dns-srv \ + --disable-rpath \ --enable-fake-curl \ --disable-regex diff --git a/package/irssi/patches/patch-build-aux_ltmain_sh b/package/irssi/patches/patch-build-aux_ltmain_sh new file mode 100644 index 000000000..05bcb0e77 --- /dev/null +++ b/package/irssi/patches/patch-build-aux_ltmain_sh @@ -0,0 +1,30 @@ +--- irssi-0.8.15.orig/build-aux/ltmain.sh 2010-04-03 18:21:23.000000000 +0200 ++++ irssi-0.8.15/build-aux/ltmain.sh 2011-01-09 00:18:54.000000000 +0100 +@@ -5516,27 +5516,6 @@ func_mode_link () + esac + fi + +- # Hardcode the library path. +- # Skip directories that are in the system default run-time +- # search path. +- case " $sys_lib_dlsearch_path " in +- *" $absdir "*) ;; +- *) +- case "$compile_rpath " in +- *" $absdir "*) ;; +- *) compile_rpath="$compile_rpath $absdir" +- esac +- ;; +- esac +- case " $sys_lib_dlsearch_path " in +- *" $libdir "*) ;; +- *) +- case "$finalize_rpath " in +- *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" +- esac +- ;; +- esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && diff --git a/package/krb5/patches/patch-src_krb5-config_in b/package/krb5/patches/patch-src_krb5-config_in new file mode 100644 index 000000000..ddc0159a6 --- /dev/null +++ b/package/krb5/patches/patch-src_krb5-config_in @@ -0,0 +1,22 @@ +--- krb5-1.8.1.orig/src/krb5-config.in 2010-01-21 23:49:01.000000000 +0100 ++++ krb5-1.8.1/src/krb5-config.in 2011-01-09 01:33:14.000000000 +0100 +@@ -34,8 +34,6 @@ libdir=@libdir@ + CC_LINK='@CC_LINK@' + KDB5_DB_LIB=@KDB5_DB_LIB@ + LDFLAGS='@LDFLAGS@' +-RPATH_FLAG='@RPATH_FLAG@' +-PROG_RPATH_FLAGS='@PROG_RPATH_FLAGS@' + PTHREAD_CFLAGS='@PTHREAD_CFLAGS@' + DL_LIB='@DL_LIB@' + +@@ -180,10 +178,7 @@ if test -n "$do_libs"; then + # Ugly gross hack for our build tree + lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \ + -e 's/\$(PURE)//' \ +- -e 's#\$(PROG_RPATH_FLAGS)#'"$PROG_RPATH_FLAGS"'#' \ +- -e 's#\$(PROG_RPATH)#'$libdir'#' \ + -e 's#\$(PROG_LIBPATH)#'$libdirarg'#' \ +- -e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \ + -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \ + -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \ + -e 's#\$(CFLAGS)#'"$CFLAGS"'#'` diff --git a/package/libelf/Makefile b/package/libelf/Makefile index a5847bc87..c8ae86b32 100644 --- a/package/libelf/Makefile +++ b/package/libelf/Makefile @@ -2,18 +2,17 @@ # material, please see the LICENCE file in the top-level directory. include ${TOPDIR}/rules.mk +include ${TOPDIR}/toolchain/libelf/Makefile.inc -PKG_NAME:= libelf -PKG_VERSION:= 0.8.11 -PKG_RELEASE:= 1 -PKG_MD5SUM:= e931910b6d100f6caa32239849947fbf PKG_DESCR:= elf library PKG_SECTION:= libs PKG_SITES:= http://www.mr511.de/software/ +PKG_SUBPKGS:= LIBELF + include ${TOPDIR}/mk/package.mk -$(eval $(call PKG_template,LIBELF,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) +$(eval $(call PKG_template,LIBELF,libelf,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) CONFIGURE_ENV+= mr_cv_target_elf=yes \ ac_cv_sizeof_long_long=8 @@ -21,7 +20,7 @@ CONFIGURE_ARGS+= --enable-elf64=yes \ --disable-sanity-checks FAKE_FLAGS+= instroot="${WRKINST}" -post-install: +libelf-install: ${INSTALL_DIR} ${IDIR_LIBELF}/usr/lib ${CP} ${WRKINST}/usr/lib/libelf.so* ${IDIR_LIBELF}/usr/lib/ diff --git a/package/opensc/patches/patch-ltmain_sh b/package/opensc/patches/patch-ltmain_sh new file mode 100644 index 000000000..e36389c67 --- /dev/null +++ b/package/opensc/patches/patch-ltmain_sh @@ -0,0 +1,30 @@ +--- opensc-0.11.13.orig/ltmain.sh 2011-01-09 00:58:43.000000000 +0100 ++++ opensc-0.11.13/ltmain.sh 2011-01-09 00:57:54.000000000 +0100 +@@ -6635,27 +6635,6 @@ func_mode_link () + esac + fi + +- # Hardcode the library path. +- # Skip directories that are in the system default run-time +- # search path. +- case " $sys_lib_dlsearch_path " in +- *" $absdir "*) ;; +- *) +- case "$compile_rpath " in +- *" $absdir "*) ;; +- *) func_append compile_rpath " $absdir" ;; +- esac +- ;; +- esac +- case " $sys_lib_dlsearch_path " in +- *" $libdir "*) ;; +- *) +- case "$finalize_rpath " in +- *" $libdir "*) ;; +- *) func_append finalize_rpath " $libdir" ;; +- esac +- ;; +- esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && diff --git a/package/opensc/patches/patch-src_Makefile_in b/package/opensc/patches/patch-src_Makefile_in index 63d41a20e..f2891678f 100644 --- a/package/opensc/patches/patch-src_Makefile_in +++ b/package/opensc/patches/patch-src_Makefile_in @@ -1,6 +1,6 @@ ---- opensc-0.11.13.orig/src/Makefile.in 2010-02-16 10:32:17.000000000 +0100 -+++ opensc-0.11.13/src/Makefile.in 2010-12-15 21:48:57.000000000 +0100 -@@ -260,8 +260,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefil +--- opensc-0.11.13.orig/src/Makefile.in 2011-01-09 00:58:50.000000000 +0100 ++++ opensc-0.11.13/src/Makefile.in 2011-01-09 00:56:00.000000000 +0100 +@@ -263,8 +263,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefil EXTRA_DIST = Makefile.mak # Order IS important diff --git a/package/rpcbind/patches/patch-ltmain_sh b/package/rpcbind/patches/patch-ltmain_sh new file mode 100644 index 000000000..1f5fa84b7 --- /dev/null +++ b/package/rpcbind/patches/patch-ltmain_sh @@ -0,0 +1,30 @@ +--- rpcbind-0.2.0.orig/ltmain.sh 2008-08-30 00:27:25.000000000 +0200 ++++ rpcbind-0.2.0/ltmain.sh 2011-01-09 00:48:19.000000000 +0100 +@@ -2561,27 +2561,6 @@ EOF + esac + fi + +- # Hardcode the library path. +- # Skip directories that are in the system default run-time +- # search path. +- case " $sys_lib_dlsearch_path " in +- *" $absdir "*) ;; +- *) +- case "$compile_rpath " in +- *" $absdir "*) ;; +- *) compile_rpath="$compile_rpath $absdir" +- esac +- ;; +- esac +- case " $sys_lib_dlsearch_path " in +- *" $libdir "*) ;; +- *) +- case "$finalize_rpath " in +- *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" +- esac +- ;; +- esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && diff --git a/package/subversion/patches/patch-build_ltmain_sh b/package/subversion/patches/patch-build_ltmain_sh new file mode 100644 index 000000000..b9315f8b3 --- /dev/null +++ b/package/subversion/patches/patch-build_ltmain_sh @@ -0,0 +1,30 @@ +--- subversion-1.6.12.orig/build/ltmain.sh 2010-03-31 20:37:12.000000000 +0200 ++++ subversion-1.6.12/build/ltmain.sh 2011-01-09 01:50:49.000000000 +0100 +@@ -2561,27 +2561,6 @@ EOF + esac + fi + +- # Hardcode the library path. +- # Skip directories that are in the system default run-time +- # search path. +- case " $sys_lib_dlsearch_path " in +- *" $absdir "*) ;; +- *) +- case "$compile_rpath " in +- *" $absdir "*) ;; +- *) compile_rpath="$compile_rpath $absdir" +- esac +- ;; +- esac +- case " $sys_lib_dlsearch_path " in +- *" $libdir "*) ;; +- *) +- case "$finalize_rpath " in +- *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" +- esac +- ;; +- esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && diff --git a/target/linux/config/Config.in.netdevice b/target/linux/config/Config.in.netdevice index 40573a78f..e7ff2be99 100644 --- a/target/linux/config/Config.in.netdevice +++ b/target/linux/config/Config.in.netdevice @@ -319,6 +319,7 @@ config ADK_KPACKAGE_KMOD_B43 tristate select ADK_KPACKAGE_KMOD_FW_LOADER depends on ADK_TARGET_WITH_SSB || ADK_TARGET_WITH_MINIPCI + default y if ADK_TARGET_SYSTEM_LINKSYS_WRT54G default n help Driver for Broadcom B43xx wireless chips. diff --git a/toolchain/Config.in b/toolchain/Config.in index b85fd6056..06f0c468a 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -15,6 +15,11 @@ config ADK_TOOLCHAIN_GCC_JAVA boolean default n +config ADK_TOOLCHAIN_GCC_OBJC + prompt "Enable building of Objective C compiler" + boolean + default n + config ADK_TOOLCHAIN_GCC_SSP prompt "Enable Stack Smashing Protection in GCC" boolean @@ -25,5 +30,16 @@ config ADK_TOOLCHAIN_GCC_USE_SSP boolean depends on ADK_TOOLCHAIN_GCC_SSP default n - + +config ADK_TOOLCHAIN_GCC_LTO + prompt "Enable Link Time Optimization in GCC" + boolean + default n + +config ADK_TOOLCHAIN_GCC_USE_LTO + prompt "Use Link Time Optimization for all packages" + boolean + depends on ADK_TOOLCHAIN_GCC_LTO + default n + endmenu diff --git a/toolchain/Makefile b/toolchain/Makefile index 34bd57210..e3c04a85a 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -3,7 +3,7 @@ # # Steps to build toolchains # 1) build and install binutils -# 2) build and install mpfr, mpc and gmp +# 2) build and install mpfr, mpc, libelf and gmp # 3) build and install gcc c compiler # 4) install kernel-headers # 5) install libc headers @@ -13,7 +13,7 @@ include $(TOPDIR)/rules.mk -TARGETS:=binutils gmp mpfr mpc gcc +TARGETS:=binutils gmp mpfr mpc libelf gcc ifeq ($(ADK_TARGET_LIB_GLIBC),y) TARGETS+=glibc-ports glibc LIBC:=glibc @@ -38,7 +38,7 @@ install: $(TARGETS_INSTALL) clean: $(TARGETS_CLEAN) download: $(DOWNLOAD) -gcc-prepare: binutils-install gmp-install mpfr-install mpc-install +gcc-prepare: binutils-install gmp-install mpfr-install mpc-install libelf-install ifeq ($(ADK_TARGET_LIB_GLIBC),y) $(LIBC)-prepare: gcc-prepare kernel-headers-prepare glibc-ports-prepare else diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index 2b0137db9..cc8c1b26a 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -28,7 +28,6 @@ $(WRKBUILD)/.configured: --build=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \ - --with-sysroot=$(TOOLCHAIN_SYSROOT) \ --with-sysroot=$(STAGING_TARGET_DIR) \ --disable-multilib \ --disable-dependency-tracking \ diff --git a/toolchain/eglibc/Makefile b/toolchain/eglibc/Makefile index 2db3fa6f6..c5f2a5653 100644 --- a/toolchain/eglibc/Makefile +++ b/toolchain/eglibc/Makefile @@ -50,8 +50,8 @@ $(WRKBUILD)/.headers_configure: (cd $(EGLIBC_BUILD_DIR_INITIAL); \ ${EGLIBC_ENV} \ $(WRKBUILD)/libc/configure \ - --prefix=$(TOOLCHAIN_SYSROOT)/usr \ - --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \ + --prefix=$(STAGING_TARGET_DIR)/usr \ + --with-headers=$(STAGING_TARGET_DIR)/usr/include \ ${EGLIBC_CONFOPTS} \ ); touch $@ @@ -61,9 +61,15 @@ $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure PATH='${TARGET_PATH}' \ $(MAKE) install-headers install-bootstrap-headers=yes \ ); - touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h + touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h touch $@ +ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y) +EGLIBC_ENV+= libc_cv_ssp=yes +else +EGLIBC_ENV+= libc_cv_ssp=no +endif + $(WRKBUILD)/.configured: mkdir -p $(EGLIBC_BUILD_DIR_FINAL) $(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \ diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index b881473de..afb945000 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -11,6 +11,7 @@ GCC_CONFOPTS= --prefix=$(STAGING_HOST_DIR) \ --target=$(REAL_GNU_TARGET_NAME) \ --with-gmp=$(STAGING_HOST_DIR) \ --with-mpfr=$(STAGING_HOST_DIR) \ + --with-libelf=$(STAGING_HOST_DIR) \ --disable-__cxa_atexit \ --with-gnu-ld \ --disable-libmudflap \ @@ -32,6 +33,12 @@ else GCC_CONFOPTS+= --disable-libssp endif +ifeq ($(ADK_TOOLCHAIN_GCC_LTO),y) +GCC_CONFOPTS+= --enable-lto +else +GCC_CONFOPTS+= --disable-lto +endif + ifeq ($(ARCH),cris) GCC_CONFOPTS+= --disable-tls else @@ -67,6 +74,9 @@ endif ifeq ($(ADK_TOOLCHAIN_GCC_JAVA),y) LANGUAGES:=${LANGUAGES},java endif +ifeq ($(ADK_TOOLCHAIN_GCC_ADA),y) +LANGUAGES:=${LANGUAGES},ada +endif include ${TOPDIR}/mk/buildhlp.mk @@ -76,7 +86,7 @@ GCC_BUILD_DIR_FINAL:= $(WRKBUILD)-final $(GCC_BUILD_DIR_MINIMAL)/.configured: mkdir -p $(GCC_BUILD_DIR_MINIMAL) - (cd $(GCC_BUILD_DIR_MINIMAL); rm -f config.cache; \ + (cd $(GCC_BUILD_DIR_MINIMAL); \ PATH='$(TARGET_PATH)' \ $(WRKBUILD)/configure \ ${GCC_CONFOPTS} \ @@ -98,12 +108,8 @@ $(WRKBUILD)/.headers: $(GCC_BUILD_DIR_MINIMAL)/.compiled touch $@ $(GCC_BUILD_DIR_INITIAL)/.configured: - rm -rf $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include - ln -sf ${STAGING_TARGET_DIR}/include $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include - rm -rf ${STAGING_HOST_DIR}/$(REAL_GNU_TARGET_NAME)/lib - ln -sf ${STAGING_TARGET_DIR}/lib $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/lib mkdir -p $(GCC_BUILD_DIR_INITIAL) - (cd $(GCC_BUILD_DIR_INITIAL); rm -f config.cache; \ + (cd $(GCC_BUILD_DIR_INITIAL); \ PATH='$(TARGET_PATH)' \ $(WRKBUILD)/configure \ ${GCC_CONFOPTS} \ @@ -111,7 +117,7 @@ $(GCC_BUILD_DIR_INITIAL)/.configured: --disable-shared \ --disable-threads \ --with-newlib \ - --with-sysroot=$(TOOLCHAIN_SYSROOT) \ + --with-sysroot=$(STAGING_TARGET_DIR) \ ); touch $@ @@ -128,7 +134,7 @@ $(WRKBUILD)/.configured: $(GCC_BUILD_DIR_INITIAL)/.compiled $(GCC_BUILD_DIR_FINAL)/.configured: mkdir -p $(GCC_BUILD_DIR_FINAL) - (cd $(GCC_BUILD_DIR_FINAL); rm -f config.cache; \ + (cd $(GCC_BUILD_DIR_FINAL); \ PATH='$(TARGET_PATH)' \ $(WRKBUILD)/configure \ ${GCC_CONFOPTS} \ @@ -146,9 +152,6 @@ $(WRKBUILD)/.compiled: $(GCC_BUILD_DIR_FINAL)/.configured $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled PATH='$(TARGET_PATH)' $(MAKE) -C $(GCC_BUILD_DIR_FINAL) install - # workaround if you cross-compile binutils - @-rm $(STAGING_TARGET_DIR)/lib/libiberty.a - @-rm $(STAGING_TARGET_DIR)/usr/lib/libiberty.a # Set up the symlinks to enable lying about target name. set -e; \ (cd $(STAGING_HOST_DIR); \ diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile index 4d39e2b27..96dc99302 100644 --- a/toolchain/glibc/Makefile +++ b/toolchain/glibc/Makefile @@ -31,21 +31,21 @@ $(WRKBUILD)/.headers_configure: (cd $(GLIBC_BUILD_DIR_INITIAL); \ ${GLIBC_ENV} \ $(WRKBUILD)/configure \ - --prefix=$(TOOLCHAIN_SYSROOT)/usr \ - --with-sysroot=$(TOOLCHAIN_SYSROOT) \ + --prefix=$(STAGING_TARGET_DIR)/usr \ + --with-sysroot=$(STAGING_TARGET_DIR) \ ${GLIBC_CONFOPTS} \ ); touch $@ $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure - mkdir -p $(TOOLCHAIN_SYSROOT)/usr/lib + mkdir -p $(STAGING_TARGET_DIR)/usr/lib (cd $(GLIBC_BUILD_DIR_INITIAL); \ ${GLIBC_ENV} \ $(MAKE) ${GLIBC_MAKEOPTS} \ cross-compiling=yes \ install-headers \ ); - touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h + touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h touch $@ $(WRKBUILD)/.configured: @@ -67,7 +67,6 @@ $(WRKBUILD)/.compiled: $(WRKBUILD)/.installed: ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) \ install_root=$(STAGING_TARGET_DIR) install - touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h - touch $(WRKBUILD)/.installed + touch $@ include ${TOPDIR}/mk/toolchain.mk diff --git a/toolchain/glibc/Makefile.inc b/toolchain/glibc/Makefile.inc index ff4753465..d7bcecb13 100644 --- a/toolchain/glibc/Makefile.inc +++ b/toolchain/glibc/Makefile.inc @@ -9,7 +9,7 @@ PKG_SITES:= ${MASTER_SITE_GNU:=glibc/} GLIBC_PORTS_VERSION:= 2.12 GLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \ --host=$(REAL_GNU_TARGET_NAME) \ - --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \ + --with-headers=$(STAGING_TARGET_DIR)/usr/include \ --disable-nls \ --disable-sanity-checks \ --disable-nls \ diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile index 45160fab1..81c2b6593 100644 --- a/toolchain/kernel-headers/Makefile +++ b/toolchain/kernel-headers/Makefile @@ -10,9 +10,6 @@ $(WRKBUILD)/.headers: $(MAKE) -C $(WRKBUILD) HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \ INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)/usr \ headers_install - $(MAKE) -C $(WRKBUILD) HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \ - INSTALL_HDR_PATH=$(TOOLCHAIN_SYSROOT)/usr \ - headers_install $(MAKE) -C $(WRKBUILD) HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \ INSTALL_HDR_PATH=$(LINUX_HEADER_DIR) \ headers_install @@ -22,10 +19,8 @@ $(WRKBUILD)/.headers: ifeq ($(ARCH),cris) ifeq ($(CPU_ARCH),crisv32) cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v32/arch arch - cd $(TOOLCHAIN_SYSROOT)/usr/include && ln -sf arch-v32/arch arch else cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v10/arch arch - cd $(TOOLCHAIN_SYSROOT)/usr/include && ln -sf arch-v10/arch arch endif endif touch $@ diff --git a/toolchain/libelf/Makefile b/toolchain/libelf/Makefile new file mode 100644 index 000000000..485978cf0 --- /dev/null +++ b/toolchain/libelf/Makefile @@ -0,0 +1,31 @@ +# 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 Makefile.inc +include ../rules.mk +include ${TOPDIR}/mk/buildhlp.mk + +ifeq (${ADK_MAKE_PARALLEL},y) +LIBELF_MAKEOPTS+= -j${ADK_MAKE_JOBS} +endif + +$(WRKBUILD)/.headers: +$(WRKBUILD)/.configured: + (cd $(WRKBUILD); \ + $(WRKBUILD)/configure \ + --prefix=$(STAGING_HOST_DIR) \ + --disable-shared \ + --enable-static \ + ); + touch $@ + +$(WRKBUILD)/.compiled: $(WRKBUILD)/.configured + $(MAKE) ${LIBELF_MAKEOPTS} -C $(WRKBUILD) all + touch $@ + +$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled + $(MAKE) -C $(WRKBUILD) install + touch $@ + +include ${TOPDIR}/mk/toolchain.mk diff --git a/toolchain/libelf/Makefile.inc b/toolchain/libelf/Makefile.inc new file mode 100644 index 000000000..66ca9fd2c --- /dev/null +++ b/toolchain/libelf/Makefile.inc @@ -0,0 +1,8 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +PKG_NAME:= libelf +PKG_VERSION:= 0.8.13 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 4136d7b4c04df68b686570afa26988ac +PKG_SITES:= http://www.mr511.de/software/ diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile index e04985dac..cc63b9e5f 100644 --- a/toolchain/uClibc/Makefile +++ b/toolchain/uClibc/Makefile @@ -14,18 +14,28 @@ endif $(WRKBUILD)/.headers: $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(WRKBUILD)/Rules.mak - sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${TOOLCHAIN_SYSROOT}/usr/include\"' \ + sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${STAGING_TARGET_DIR}/usr/include\"' \ $(TOPDIR)/target/$(ADK_TARGET_ARCH)/uclibc.config >${WRKBUILD}/.config ifneq ($(ADK_DEBUG),) $(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config endif -ifneq ($(ADK_TOOLCHAIN_GCC_SSP),) +ifneq ($(ADK_TOOLCHAIN_GCC_USE_SSP),) $(SED) 's,.*UCLIBC_HAS_SSP,UCLIBC_HAS_SSP=y,' ${WRKBUILD}/.config + echo "UCLIBC_HAS_SSP_COMPAT=n" >> ${WRKBUILD}/.config + echo "SSP_QUICK_CANARY=n" >> ${WRKBUILD}/.config + echo "UCLIBC_BUILD_SSP=y" >> ${WRKBUILD}/.config endif + echo N|$(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \ + PREFIX=$(STAGING_TARGET_DIR) \ + DEVEL_PREFIX=/usr/ \ + RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \ + HOSTCC="$(HOSTCC)" \ + CPU_CFLAGS="$(TARGET_CFLAGS)" \ + oldconfig $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \ - PREFIX=$(TOOLCHAIN_SYSROOT) \ + PREFIX=$(STAGING_TARGET_DIR) \ DEVEL_PREFIX=/usr/ \ - RUNTIME_PREFIX=$(TOOLCHAIN_SYSROOT) \ + RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \ HOSTCC="$(HOSTCC)" \ CPU_CFLAGS="$(TARGET_CFLAGS)" \ install_headers -- cgit v1.2.3 From 1edd657512fe89c6727a3d8adb68f29568078347 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 10 Jan 2011 12:17:41 +0100 Subject: create directory where others are created --- mk/build.mk | 2 +- toolchain/glibc/Makefile | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'toolchain/glibc') diff --git a/mk/build.mk b/mk/build.mk index 7c8a697f8..92a5e947a 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -136,7 +136,7 @@ ifeq ($(ADK_TARGET_PACKAGE_IPKG),y) endif ${STAGING_TARGET_DIR} ${STAGING_TARGET_DIR}/etc ${STAGING_HOST_DIR}: - mkdir -p ${STAGING_TARGET_DIR}/{bin,etc,lib,usr/include} \ + mkdir -p ${STAGING_TARGET_DIR}/{bin,etc,lib,usr/include,usr/lib} \ ${STAGING_HOST_DIR}/{bin,lib} ${STAGING_TARGET_DIR}/etc/ipkg.conf: ${STAGING_TARGET_DIR}/etc diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile index cfa3690e8..5d8a252c4 100644 --- a/toolchain/glibc/Makefile +++ b/toolchain/glibc/Makefile @@ -38,7 +38,6 @@ $(WRKBUILD)/.headers_configure: touch $@ $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure - mkdir -p $(STAGING_TARGET_DIR)/usr/lib (cd $(GLIBC_BUILD_DIR_INITIAL); \ ${GLIBC_ENV} \ $(MAKE) ${GLIBC_MAKEOPTS} \ -- cgit v1.2.3 From 903a9849d50273c9d63e3be4ca85b1ea847cdf0d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 10 Jan 2011 22:47:51 +0100 Subject: fix timezone configuration for glibc based systems --- TODO | 1 - package/glibc/Makefile | 19 +++++- toolchain/glibc/Makefile | 2 +- toolchain/glibc/patches/tz.patch | 135 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 152 insertions(+), 5 deletions(-) create mode 100644 toolchain/glibc/patches/tz.patch (limited to 'toolchain/glibc') diff --git a/TODO b/TODO index 56959ebbe..552758a73 100644 --- a/TODO +++ b/TODO @@ -6,7 +6,6 @@ - LTO GCC evaluation - finish qemu package - fix autoreconf usage in opensc -- fix timezone stuff in glibc - add back aufs2 patches for kernel - openssl ocf support check - locales support diff --git a/package/glibc/Makefile b/package/glibc/Makefile index f509e3f3c..9d890c18b 100644 --- a/package/glibc/Makefile +++ b/package/glibc/Makefile @@ -23,9 +23,22 @@ INSTALL_STYLE:= manual # compile nothing, glibc is already build in toolchain directory do-install: ${INSTALL_DIR} $(IDIR_GLIBC)/lib $(IDIR_GLIBC)/etc - test -z $(ADK_RUNTIME_TIMEZONE) || \ - $(CP) /usr/share/zoneinfo/$(ADK_RUNTIME_TIMEZONE) \ - $(IDIR_GLIBC)/etc/localtime + cd ${STAGING_TARGET_DIR} && for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \ + test -s usr/share/zoneinfo/"$$f" || continue; \ + echo usr/share/zoneinfo/"$$f" | \ + ${TOOLS_DIR}/cpio -pdu ${IDIR_GLIBC}/; \ + done + tz=; cd ${IDIR_GLIBC}/usr/share/zoneinfo || exit 1; \ + for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \ + test -s "$$f" || continue; \ + tz=$$f; \ + done; if test x"$$tz" = x""; then \ + echo >&2 Error during timezone installation; \ + exit 1; \ + else \ + ln -sf "../usr/share/zoneinfo/$$tz" \ + ${IDIR_GLIBC}/etc/localtime; \ + fi ${CP} ${STAGING_TARGET_DIR}/etc/gai.conf ${IDIR_GLIBC}/etc/ ${CP} ${STAGING_TARGET_DIR}/etc/nscd.conf ${IDIR_GLIBC}/etc/ ${CP} ${STAGING_TARGET_DIR}/etc/nsswitch.conf ${IDIR_GLIBC}/etc/ diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile index 5d8a252c4..d492b9837 100644 --- a/toolchain/glibc/Makefile +++ b/toolchain/glibc/Makefile @@ -17,6 +17,7 @@ ifeq ($(ADK_TARGET_NO_FPU),y) GLIBC_CONFOPTS+= --without-fp endif +GLIBC_MAKEOPTS+= cross-compiling=yes ifeq (${ADK_MAKE_PARALLEL},y) GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j${ADK_MAKE_JOBS}" endif @@ -41,7 +42,6 @@ $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure (cd $(GLIBC_BUILD_DIR_INITIAL); \ ${GLIBC_ENV} \ $(MAKE) ${GLIBC_MAKEOPTS} \ - cross-compiling=yes \ install-headers \ ); touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h diff --git a/toolchain/glibc/patches/tz.patch b/toolchain/glibc/patches/tz.patch new file mode 100644 index 000000000..990458aa4 --- /dev/null +++ b/toolchain/glibc/patches/tz.patch @@ -0,0 +1,135 @@ +--- glibc-2.12.1/timezone/Makefile 2010-07-27 13:34:39.000000000 +0200 ++++ glibc-2.12.1.orig/timezone/Makefile 2011-01-10 15:20:02.576150764 +0100 +@@ -69,13 +69,10 @@ + $(addprefix $(inst_zonedir)/, \ + $(posixrules-file))) + +-ifeq ($(cross-compiling),no) +-# Don't try to install the zoneinfo files since we can't run zic. + install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \ + $(zonenames:%=posix/%) \ + $(zonenames:%=right/%)) \ + $(installed-localtime-file) $(installed-posixrules-file) +-endif + + ifeq ($(have-ksh),yes) + install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab +@@ -106,18 +103,35 @@ + echo '$$(addprefix $$(inst_zonedir)/,$$($*-zones)): \' ;\ + echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_zonedir)/,$$($$t-zones)))' ;\ + fi ;\ +- echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/right/,$$($*-zones)): \' ;\ +- echo '$< $$(objpfx)zic leapseconds yearistype' ;\ +- echo ' $$(tzcompile)' ;\ +- echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/posix/,$$($*-zones)): \' ;\ +- echo '$< $$(objpfx)zic /dev/null yearistype' ;\ +- echo ' $$(tzcompile)' ;\ +- echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/,$$($*-zones)): \' ;\ +- echo '$< $$(objpfx)zic $$(leapseconds) yearistype' ;\ +- echo ' $$(tzcompile)' ;\ ++ echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/right/,$$($*-zones)): \' ;) > $@.new ++ ++ifeq (no,$(cross-compiling)) ++ (echo '$< $$(objpfx)zic leapseconds yearistype' ;) >> $@.new ++else ++ (echo '$< $$(objpfx)cross-zic leapseconds yearistype' ;) >> $@.new ++endif ++ ++ (echo ' $$(tzcompile)' ;\ ++ echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/posix/,$$($*-zones)): \' ;) >> $@.new ++ ++ifeq (no,$(cross-compiling)) ++ (echo '$< $$(objpfx)zic /dev/null yearistype' ;) >> $@.new ++else ++ (echo '$< $$(objpfx)cross-zic /dev/null yearistype' ;) >> $@.new ++endif ++ ++ (echo ' $$(tzcompile)' ;\ ++ echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/,$$($*-zones)): \' ;) >> $@.new ++ ++ifeq (no,$(cross-compiling)) ++ (echo '$< $$(objpfx)zic $$(leapseconds) yearistype' ;) >> $@.new ++else ++ (echo '$< $$(objpfx)cross-zic $$(leapseconds) yearistype' ;) >> $@.new ++endif ++ ++ (echo ' $$(tzcompile)' ;\ + echo 'endif' ;\ +- echo 'zonenames := $$(zonenames) $$($*-zones)' ;\ +- ) > $@.new ++ echo 'zonenames := $$(zonenames) $$($*-zones)' ;) >> $@.new + mv $@.new $@ + + .PHONY: echo-zonenames +@@ -128,7 +142,11 @@ + # We have to use `-d $(inst_zonedir)' to explictly tell zic where to + # place the output files although $(zonedir) is compiled in. But the + # user might have set $(install_root) on the command line of `make install'. ++ifeq (no,$(cross-compiling)) + zic-cmd = $(built-program-cmd) -d $(inst_zonedir) ++else ++zic-cmd = $(objpfx)cross-zic -d $(inst_zonedir) ++endif + tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \ + -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $< + +@@ -158,8 +176,17 @@ + $(zic-cmd) -p $(posixrules) + endif + ++zic-objs = zic.o ialloc.o scheck.o ++ ++$(objpfx)zic: $(addprefix $(objpfx), $(zic-objs)) ++ ++$(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c ++ gcc $< -c $(OUTPUT_OPTION) \ ++ $(filter-out -DHAVE_GETTEXT,$(CFLAGS-$*.c)) \ ++ $(CPPFLAGS-$*) -DCROSS_ZIC $(compile-mkdep-flags) + +-$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o ++$(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs)) ++ gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@ + + tz-cflags = -DTZDIR='"$(zonedir)"' \ + -DTZDEFAULT='"$(localtime-file)"' \ +@@ -176,10 +203,17 @@ + # Don't add leapseconds here since test-tz made checks that work only without + # leapseconds. + testdata = $(objpfx)testdata ++ifeq (no,$(cross-compiling)) + define build-testdata + GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \ + $(built-program-cmd) -d $(testdata) -y ./yearistype $< + endef ++else ++define build-testdata ++LANGUAGE=C LC_ALL=C \ ++ $(objpfx)cross-zic -d $(testdata) -y ./yearistype $< ++endef ++endif + + $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC) + $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \ +@@ -192,7 +226,11 @@ + tst-timezone-ENV = TZDIR=$(testdata) + + # Note this must come second in the deps list for $(built-program-cmd) to work. ++ifeq (no,$(cross-compiling)) + zic-deps = $(objpfx)zic $(leapseconds) yearistype ++else ++zic-deps = $(objpfx)cross-zic $(objpfx)zic $(leapseconds) yearistype ++endif + + $(testdata)/America/New_York: northamerica $(zic-deps) + $(build-testdata) +@@ -214,7 +252,9 @@ + + $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make + sed -e 's%@KSH@%$(KSH)%g' \ +- -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new ++ -e 's%@TZDIR@%$(zonedir)%g' \ ++ -e 's%@PKGVERSION@%$(PKGVERSION)%g' \ ++ -e 's%@REPORT_BUGS_TO@%$(REPORT_BUGS_TO)%g' < $< > $@.new + chmod 555 $@.new + mv -f $@.new $@ + -- cgit v1.2.3 From bf47f2d852558cdf07c29564af7284b428c2ffe6 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 12 Jan 2011 11:42:44 +0100 Subject: fix mips64 glibc toolchains --- toolchain/glibc/Makefile.inc | 1 + 1 file changed, 1 insertion(+) (limited to 'toolchain/glibc') diff --git a/toolchain/glibc/Makefile.inc b/toolchain/glibc/Makefile.inc index d7bcecb13..79ba89cc2 100644 --- a/toolchain/glibc/Makefile.inc +++ b/toolchain/glibc/Makefile.inc @@ -32,3 +32,4 @@ GLIBC_ENV:= PATH='${TARGET_PATH}' \ libc_cv_c_cleanup=yes \ libc_cv_gnu99_inline=yes \ libc_cv_sparc64_tls=yes \ + libc_cv_slibdir="/lib" \ -- cgit v1.2.3