diff options
| -rw-r--r-- | meta/classes/qemu.bbclass | 15 | ||||
| -rw-r--r-- | meta/conf/distro/include/poky-eglibc.inc | 29 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc-2.12/IO-acquire-lock-fix.patch | 15 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc-2.12/armv4t-interworking.patch | 78 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc-2.12/eglibc-svn-arm-lowlevellock-include-tls.patch | 19 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc-2.12/etc/ld.so.conf | 2 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc-2.12/generate-supported.mk | 11 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc-2.12/shorten-build-commands.patch | 79 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc-initial.inc | 44 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc-initial_2.12.bb | 6 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc-package.bbclass | 381 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc.inc | 24 | ||||
| -rw-r--r-- | meta/packages/eglibc/eglibc_2.12.bb | 98 |
13 files changed, 801 insertions, 0 deletions
diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass new file mode 100644 index 0000000000..66dfb2b0d2 --- /dev/null +++ b/meta/classes/qemu.bbclass | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | # | ||
| 2 | # This class contains functions for recipes that need QEMU or test for its | ||
| 3 | # existance. | ||
| 4 | # | ||
| 5 | |||
| 6 | def qemu_target_binary(data): | ||
| 7 | import bb | ||
| 8 | |||
| 9 | target_arch = bb.data.getVar("TARGET_ARCH", data, 1) | ||
| 10 | if target_arch in ("i486", "i586", "i686"): | ||
| 11 | target_arch = "i386" | ||
| 12 | elif target_arch == "powerpc": | ||
| 13 | target_arch = "ppc" | ||
| 14 | |||
| 15 | return "qemu-" + target_arch | ||
diff --git a/meta/conf/distro/include/poky-eglibc.inc b/meta/conf/distro/include/poky-eglibc.inc new file mode 100644 index 0000000000..57d6d28289 --- /dev/null +++ b/meta/conf/distro/include/poky-eglibc.inc | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # | ||
| 2 | # eglibc specific configuration | ||
| 3 | # | ||
| 4 | |||
| 5 | # Add glibc overrides to the overrides for eglibc. | ||
| 6 | OVERRIDES .= ":libc-glibc" | ||
| 7 | |||
| 8 | PREFERRED_PROVIDER_virtual/libiconv ?= "eglibc" | ||
| 9 | PREFERRED_PROVIDER_virtual/libintl ?= "eglibc" | ||
| 10 | PREFERRED_PROVIDER_virtual/libc ?= "eglibc" | ||
| 11 | PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "eglibc-initial" | ||
| 12 | PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "eglibc" | ||
| 13 | |||
| 14 | TARGET_OS = "${GLIBCTARGETOS}" | ||
| 15 | |||
| 16 | CXXFLAGS += "-fvisibility-inlines-hidden" | ||
| 17 | |||
| 18 | |||
| 19 | # eglibc is configured for OLDEST_KERNEL kernel version, so we set minimal | ||
| 20 | # sane versions there | ||
| 21 | |||
| 22 | OLDEST_KERNEL ?= "2.4.0" | ||
| 23 | |||
| 24 | # ARM OABI is fine with 2.4.0, EABI is not, so we override on "-gnueabi" | ||
| 25 | # TARGET_OS here, not on architecture which is 'arm' in both cases | ||
| 26 | OLDEST_KERNEL_linux-gnueabi ?= "2.6.16" | ||
| 27 | OLDEST_KERNEL_sparc64 ?= "2.4.21" | ||
| 28 | OLDEST_KERNEL_ppc64 ?= "2.4.21" | ||
| 29 | |||
diff --git a/meta/packages/eglibc/eglibc-2.12/IO-acquire-lock-fix.patch b/meta/packages/eglibc/eglibc-2.12/IO-acquire-lock-fix.patch new file mode 100644 index 0000000000..4d3e0613b1 --- /dev/null +++ b/meta/packages/eglibc/eglibc-2.12/IO-acquire-lock-fix.patch | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | import http://sourceware.org/ml/libc-ports/2007-12/msg00000.html | ||
| 2 | |||
| 3 | Index: libc/bits/stdio-lock.h | ||
| 4 | =================================================================== | ||
| 5 | --- libc.orig/bits/stdio-lock.h 2009-10-28 14:34:19.000000000 -0700 | ||
| 6 | +++ libc/bits/stdio-lock.h 2009-10-28 14:34:54.000000000 -0700 | ||
| 7 | @@ -50,6 +50,8 @@ __libc_lock_define_recursive (typedef, _ | ||
| 8 | _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \ | ||
| 9 | _IO_flockfile (_fp) | ||
| 10 | |||
| 11 | +# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp) | ||
| 12 | + | ||
| 13 | # define _IO_release_lock(_fp) \ | ||
| 14 | _IO_funlockfile (_fp); \ | ||
| 15 | _IO_cleanup_region_end (0) | ||
diff --git a/meta/packages/eglibc/eglibc-2.12/armv4t-interworking.patch b/meta/packages/eglibc/eglibc-2.12/armv4t-interworking.patch new file mode 100644 index 0000000000..6ab306180c --- /dev/null +++ b/meta/packages/eglibc/eglibc-2.12/armv4t-interworking.patch | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | Index: libc/ports/sysdeps/arm/memcpy.S | ||
| 2 | =================================================================== | ||
| 3 | --- libc.orig/ports/sysdeps/arm/memcpy.S 2009-09-03 16:12:00.000000000 -0700 | ||
| 4 | +++ libc/ports/sysdeps/arm/memcpy.S 2009-10-28 12:51:22.000000000 -0700 | ||
| 5 | @@ -130,7 +130,12 @@ ENTRY(memcpy) | ||
| 6 | strcsb r4, [r0], #1 | ||
| 7 | strcsb ip, [r0] | ||
| 8 | |||
| 9 | +#if defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__) | ||
| 10 | + ldmfd sp!, {r0, r4, lr} | ||
| 11 | + bx lr | ||
| 12 | +#else | ||
| 13 | ldmfd sp!, {r0, r4, pc} | ||
| 14 | +#endif | ||
| 15 | |||
| 16 | 9: rsb ip, ip, #4 | ||
| 17 | cmp ip, #2 | ||
| 18 | Index: libc/ports/sysdeps/arm/memmove.S | ||
| 19 | =================================================================== | ||
| 20 | --- libc.orig/ports/sysdeps/arm/memmove.S 2009-09-03 16:12:00.000000000 -0700 | ||
| 21 | +++ libc/ports/sysdeps/arm/memmove.S 2009-10-28 12:51:22.000000000 -0700 | ||
| 22 | @@ -144,7 +144,12 @@ ENTRY(memmove) | ||
| 23 | strneb r3, [r0, #-1]! | ||
| 24 | strcsb r4, [r0, #-1]! | ||
| 25 | strcsb ip, [r0, #-1] | ||
| 26 | +#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__) | ||
| 27 | + ldmfd sp!, {r0, r4, lr} | ||
| 28 | + bx lr | ||
| 29 | +#else | ||
| 30 | ldmfd sp!, {r0, r4, pc} | ||
| 31 | +#endif | ||
| 32 | |||
| 33 | 9: cmp ip, #2 | ||
| 34 | ldrgtb r3, [r1, #-1]! | ||
| 35 | Index: libc/ports/sysdeps/unix/sysv/linux/arm/clone.S | ||
| 36 | =================================================================== | ||
| 37 | --- libc.orig/ports/sysdeps/unix/sysv/linux/arm/clone.S 2009-09-03 16:12:04.000000000 -0700 | ||
| 38 | +++ libc/ports/sysdeps/unix/sysv/linux/arm/clone.S 2009-10-28 12:51:22.000000000 -0700 | ||
| 39 | @@ -96,8 +96,14 @@ ENTRY(__clone) | ||
| 40 | #endif | ||
| 41 | @ pick the function arg and call address off the stack and execute | ||
| 42 | ldr r0, [sp, #4] | ||
| 43 | +#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__) | ||
| 44 | + ldr ip, [sp], #8 | ||
| 45 | + mov lr, pc | ||
| 46 | + bx ip | ||
| 47 | +#else | ||
| 48 | mov lr, pc | ||
| 49 | ldr pc, [sp], #8 | ||
| 50 | +#endif | ||
| 51 | |||
| 52 | @ and we are done, passing the return value through r0 | ||
| 53 | b PLTJMP(HIDDEN_JUMPTARGET(_exit)) | ||
| 54 | Index: libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h | ||
| 55 | =================================================================== | ||
| 56 | --- libc.orig/ports/sysdeps/unix/sysv/linux/arm/sysdep.h 2009-09-16 13:58:18.000000000 +0100 | ||
| 57 | +++ libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h 2009-11-03 19:17:16.000000000 +0000 | ||
| 58 | @@ -129,6 +129,11 @@ | ||
| 59 | DO_RET(lr); \ | ||
| 60 | 1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8; | ||
| 61 | # else | ||
| 62 | +#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__) | ||
| 63 | +#define POP_PC ldr lr, [sp], #4; bx lr | ||
| 64 | +#else | ||
| 65 | +#define POP_PC ldr pc, [sp], #4 | ||
| 66 | +#endif | ||
| 67 | # define SYSCALL_ERROR_HANDLER \ | ||
| 68 | __local_syscall_error: \ | ||
| 69 | str lr, [sp, #-4]!; \ | ||
| 70 | @@ -138,7 +143,7 @@ | ||
| 71 | rsb r1, r1, #0; \ | ||
| 72 | str r1, [r0]; \ | ||
| 73 | mvn r0, #0; \ | ||
| 74 | - ldr pc, [sp], #4; | ||
| 75 | + POP_PC; | ||
| 76 | # endif | ||
| 77 | #else | ||
| 78 | # define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ | ||
diff --git a/meta/packages/eglibc/eglibc-2.12/eglibc-svn-arm-lowlevellock-include-tls.patch b/meta/packages/eglibc/eglibc-2.12/eglibc-svn-arm-lowlevellock-include-tls.patch new file mode 100644 index 0000000000..99c3fef802 --- /dev/null +++ b/meta/packages/eglibc/eglibc-2.12/eglibc-svn-arm-lowlevellock-include-tls.patch | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21: | ||
| 2 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private': | ||
| 3 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: warning: implicit declaration of function 'THREAD_GETMEM' | ||
| 4 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'THREAD_SELF' undeclared (first use in this function) | ||
| 5 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: (Each undeclared identifier is reported only once | ||
| 6 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: for each function it appears in.) | ||
| 7 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'header' undeclared (first use in this function) | ||
| 8 | make[4]: *** [/var/tmp/portage/sys-libs/glibc-2.7-r1/work/build-default-armv4l-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os] Error 1 | ||
| 9 | |||
| 10 | --- libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h.orig | ||
| 11 | +++ libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h | ||
| 12 | @@ -25,6 +25,7 @@ | ||
| 13 | #include <atomic.h> | ||
| 14 | #include <sysdep.h> | ||
| 15 | #include <kernel-features.h> | ||
| 16 | +#include <tls.h> | ||
| 17 | |||
| 18 | #define FUTEX_WAIT 0 | ||
| 19 | #define FUTEX_WAKE 1 | ||
diff --git a/meta/packages/eglibc/eglibc-2.12/etc/ld.so.conf b/meta/packages/eglibc/eglibc-2.12/etc/ld.so.conf new file mode 100644 index 0000000000..dfa65edb85 --- /dev/null +++ b/meta/packages/eglibc/eglibc-2.12/etc/ld.so.conf | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | /usr/local/lib | ||
| 2 | /usr/X11R6/lib | ||
diff --git a/meta/packages/eglibc/eglibc-2.12/generate-supported.mk b/meta/packages/eglibc/eglibc-2.12/generate-supported.mk new file mode 100644 index 0000000000..d2a28c2dc6 --- /dev/null +++ b/meta/packages/eglibc/eglibc-2.12/generate-supported.mk | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #!/usr/bin/make | ||
| 2 | |||
| 3 | include $(IN) | ||
| 4 | |||
| 5 | all: | ||
| 6 | rm -f $(OUT) | ||
| 7 | touch $(OUT) | ||
| 8 | for locale in $(SUPPORTED-LOCALES); do \ | ||
| 9 | [ $$locale = true ] && continue; \ | ||
| 10 | echo $$locale | sed 's,/, ,' >> $(OUT); \ | ||
| 11 | done | ||
diff --git a/meta/packages/eglibc/eglibc-2.12/shorten-build-commands.patch b/meta/packages/eglibc/eglibc-2.12/shorten-build-commands.patch new file mode 100644 index 0000000000..57835adcdb --- /dev/null +++ b/meta/packages/eglibc/eglibc-2.12/shorten-build-commands.patch | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | Source: http://sourceware.org/ml/libc-alpha/2010-03/msg00064.html | ||
| 2 | |||
| 3 | This patch scratches an itch. Each individual gcc command in the | ||
| 4 | glibc build is over 1K, which means it takes up a good chunk of my | ||
| 5 | terminal. Most of that is include paths. Any version of GCC new | ||
| 6 | enough to build glibc supports response files, which were added in | ||
| 7 | 2005. So use a response file for the static list of include paths. | ||
| 8 | Now the build commands are a lot shorter, and easier to use when | ||
| 9 | developing glibc. | ||
| 10 | |||
| 11 | Tested on x86_64-linux-gnu. Please apply if acceptable. | ||
| 12 | |||
| 13 | -- | ||
| 14 | Daniel Jacobowitz | ||
| 15 | CodeSourcery | ||
| 16 | |||
| 17 | 2010-03-30 Daniel Jacobowitz <dan@codesourcery.com> | ||
| 18 | |||
| 19 | * Makeconfig (+common-includes): Define. | ||
| 20 | (+includes): Use @$(common-objpfx)includes. | ||
| 21 | * Makefile (postclean): Remove includes and includes.mk. | ||
| 22 | * Makerules ($(common-objpfx)includes.mk): Include and create | ||
| 23 | includes.mk. Create includes. | ||
| 24 | |||
| 25 | Index: libc/Makeconfig | ||
| 26 | =================================================================== | ||
| 27 | --- libc.orig/Makeconfig 2009-10-13 22:55:12.000000000 -0700 | ||
| 28 | +++ libc/Makeconfig 2010-03-31 16:02:37.120489733 -0700 | ||
| 29 | @@ -678,9 +678,10 @@ endif # $(+cflags) == "" | ||
| 30 | # library source directory, in the include directory, and in the | ||
| 31 | # current directory. | ||
| 32 | +sysdep-includes = $(addprefix -I,$(+sysdep_dirs)) | ||
| 33 | ++common-includes = $(+sysdep-includes) $(includes) $(sysincludes) | ||
| 34 | +includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \ | ||
| 35 | - $(+sysdep-includes) $(includes) \ | ||
| 36 | - $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes) | ||
| 37 | + @$(common-objpfx)includes \ | ||
| 38 | + $(patsubst %/,-I%,$(..)) $(libio-include) -I. | ||
| 39 | |||
| 40 | # Since libio has several internal header files, we use a -I instead | ||
| 41 | # of many little headers in the include directory. | ||
| 42 | Index: libc/Makefile | ||
| 43 | =================================================================== | ||
| 44 | --- libc.orig/Makefile 2009-12-09 12:06:28.000000000 -0800 | ||
| 45 | +++ libc/Makefile 2010-03-31 16:02:37.132481508 -0700 | ||
| 46 | @@ -247,7 +247,7 @@ parent-mostlyclean: common-mostlyclean # | ||
| 47 | parent-clean: parent-mostlyclean common-clean | ||
| 48 | |||
| 49 | postclean = $(addprefix $(common-objpfx),$(postclean-generated)) \ | ||
| 50 | - $(addprefix $(objpfx),sysd-dirs sysd-rules) \ | ||
| 51 | + $(addprefix $(objpfx),sysd-dirs sysd-rules includes includes.mk) \ | ||
| 52 | $(addprefix $(objpfx),sysd-sorted soversions.mk soversions.i) | ||
| 53 | |||
| 54 | clean: parent-clean | ||
| 55 | Index: libc/Makerules | ||
| 56 | =================================================================== | ||
| 57 | --- libc.orig/Makerules 2009-12-09 12:06:28.000000000 -0800 | ||
| 58 | +++ libc/Makerules 2010-03-31 16:02:37.140481645 -0700 | ||
| 59 | @@ -254,6 +254,20 @@ ifndef sysd-rules-done | ||
| 60 | no_deps=t | ||
| 61 | endif | ||
| 62 | |||
| 63 | +-include $(common-objpfx)includes.mk | ||
| 64 | +ifneq ($(+common-includes),$(saved-includes)) | ||
| 65 | +# Recreate includes.mk (and includes). | ||
| 66 | +includes-force = FORCE | ||
| 67 | +FORCE: | ||
| 68 | +endif | ||
| 69 | +$(common-objpfx)includes.mk: $(includes-force) | ||
| 70 | + -@rm -f $@T $(common-objpfx)includesT | ||
| 71 | + for inc in $(+common-includes); do echo "$$inc"; done \ | ||
| 72 | + > $(common-objpfx)includesT | ||
| 73 | + mv -f $(common-objpfx)includesT $(common-objpfx)includes | ||
| 74 | + echo 'saved-includes := $(+common-includes)' > $@T | ||
| 75 | + mv -f $@T $@ | ||
| 76 | + | ||
| 77 | define o-iterator-doit | ||
| 78 | $(objpfx)%$o: %.S $(before-compile); $$(compile-command.S) | ||
| 79 | endef | ||
diff --git a/meta/packages/eglibc/eglibc-initial.inc b/meta/packages/eglibc/eglibc-initial.inc new file mode 100644 index 0000000000..eb765df178 --- /dev/null +++ b/meta/packages/eglibc/eglibc-initial.inc | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | SECTION = "libs" | ||
| 2 | DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial" | ||
| 3 | PROVIDES = "virtual/${TARGET_PREFIX}libc-initial" | ||
| 4 | |||
| 5 | PACKAGES = "" | ||
| 6 | PACKAGES_DYNAMIC = "" | ||
| 7 | |||
| 8 | do_configure () { | ||
| 9 | sed -ie 's,{ (exit 1); exit 1; }; },{ (exit 0); }; },g' ${S}/configure | ||
| 10 | chmod +x ${S}/configure | ||
| 11 | (cd ${S} && gnu-configize) || die "failure in running gnu-configize" | ||
| 12 | find ${S} -name "configure" | xargs touch | ||
| 13 | ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \ | ||
| 14 | --prefix=/usr \ | ||
| 15 | --without-cvs --disable-sanity-checks \ | ||
| 16 | --with-headers=${STAGING_DIR_TARGET}${includedir} \ | ||
| 17 | --enable-hacker-mode --enable-addons | ||
| 18 | } | ||
| 19 | |||
| 20 | do_compile () { | ||
| 21 | : | ||
| 22 | } | ||
| 23 | |||
| 24 | do_install () { | ||
| 25 | oe_runmake cross-compiling=yes install_root=${D} \ | ||
| 26 | includedir='${includedir}' prefix='${prefix}' \ | ||
| 27 | install-bootstrap-headers=yes install-headers | ||
| 28 | |||
| 29 | oe_runmake csu/subdir_lib | ||
| 30 | # Two headers -- stubs.h and features.h -- aren't installed by install-headers, | ||
| 31 | # so do them by hand. We can tolerate an empty stubs.h for the moment. | ||
| 32 | # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html | ||
| 33 | mkdir -p ${D}${includedir}/gnu/ | ||
| 34 | touch ${D}${includedir}/gnu/stubs.h | ||
| 35 | cp ${S}/include/features.h ${D}${includedir}/features.h | ||
| 36 | |||
| 37 | if [ -e ${B}/bits/stdio_lim.h ]; then | ||
| 38 | cp ${B}/bits/stdio_lim.h ${D}${includedir}/bits/ | ||
| 39 | fi | ||
| 40 | mkdir -p ${D}${libdir}/ | ||
| 41 | install -m 644 csu/crt[1in].o ${D}${libdir} | ||
| 42 | ${CC} -nostdlib -nostartfiles -shared -x c /dev/null \ | ||
| 43 | -o ${D}${libdir}/libc.so | ||
| 44 | } | ||
diff --git a/meta/packages/eglibc/eglibc-initial_2.12.bb b/meta/packages/eglibc/eglibc-initial_2.12.bb new file mode 100644 index 0000000000..787c762609 --- /dev/null +++ b/meta/packages/eglibc/eglibc-initial_2.12.bb | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | require eglibc_${PV}.bb | ||
| 2 | require eglibc-initial.inc | ||
| 3 | |||
| 4 | do_configure_prepend () { | ||
| 5 | unset CFLAGS | ||
| 6 | } | ||
diff --git a/meta/packages/eglibc/eglibc-package.bbclass b/meta/packages/eglibc/eglibc-package.bbclass new file mode 100644 index 0000000000..4e286afa80 --- /dev/null +++ b/meta/packages/eglibc/eglibc-package.bbclass | |||
| @@ -0,0 +1,381 @@ | |||
| 1 | # | ||
| 2 | # For now, we will skip building of a gcc package if it is a uclibc one | ||
| 3 | # and our build is not a uclibc one, and we skip a eglibc one if our build | ||
| 4 | # is a uclibc build. | ||
| 5 | # | ||
| 6 | # See the note in gcc/gcc_3.4.0.oe | ||
| 7 | # | ||
| 8 | |||
| 9 | inherit qemu | ||
| 10 | |||
| 11 | python __anonymous () { | ||
| 12 | import bb, re | ||
| 13 | uc_os = (re.match('.*uclibc*', bb.data.getVar('TARGET_OS', d, 1)) != None) | ||
| 14 | if uc_os: | ||
| 15 | raise bb.parse.SkipPackage("incompatible with target %s" % | ||
| 16 | bb.data.getVar('TARGET_OS', d, 1)) | ||
| 17 | } | ||
| 18 | |||
| 19 | |||
| 20 | # Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION | ||
| 21 | # is set. The idea is to avoid running localedef on the target (at first boot) | ||
| 22 | # to decrease initial boot time and avoid localedef being killed by the OOM | ||
| 23 | # killer which used to effectively break i18n on machines with < 128MB RAM. | ||
| 24 | |||
| 25 | # default to disabled until qemu works for everyone | ||
| 26 | ENABLE_BINARY_LOCALE_GENERATION ?= "0" | ||
| 27 | |||
| 28 | # BINARY_LOCALE_ARCHES is a space separated list of regular expressions | ||
| 29 | BINARY_LOCALE_ARCHES ?= "arm.* i[3-6]86 x86_64 powerpc" | ||
| 30 | |||
| 31 | # Set this to zero if you don't want ldconfig in the output package | ||
| 32 | USE_LDCONFIG ?= "1" | ||
| 33 | |||
| 34 | PACKAGES = "eglibc-dbg eglibc catchsegv sln nscd ldd localedef eglibc-utils eglibc-pic eglibc-dev eglibc-doc eglibc-locale libcidn libmemusage libsegfault eglibc-extra-nss eglibc-thread-db eglibc-pcprofile" | ||
| 35 | PACKAGES_DYNAMIC = "glibc-gconv-* glibc-charmap-* glibc-localedata-* glibc-binary-localedata-* eglibc-gconv-* eglibc-charmap-* eglibc-localedata-* eglibc-binary-localedata-* locale-base-*" | ||
| 36 | |||
| 37 | RPROVIDES_eglibc = "glibc" | ||
| 38 | RPROVIDES_eglibc-utils = "glibc-utils" | ||
| 39 | RPROVIDES_eglibc-pic = "glibc-pic" | ||
| 40 | RPROVIDES_eglibc-dev = "glibc-dev" | ||
| 41 | RPROVIDES_eglibc-doc = "glibc-doc" | ||
| 42 | RPROVIDES_eglibc-locale = "glibc-locale" | ||
| 43 | RPROVIDES_eglibc-extra-nss = "glibc-extra-nss" | ||
| 44 | RPROVIDES_eglibc-thread-db = "glibc-thread-db" | ||
| 45 | RPROVIDES_eglibc-pcprofile = "glibc-pcprofile" | ||
| 46 | RPROVIDES_eglibc-dbg = "glibc-dbg" | ||
| 47 | libc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so ${base_libdir}/libc*.so.* ${base_libdir}/libc*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so" | ||
| 48 | |||
| 49 | FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${@base_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig', '', d)}" | ||
| 50 | FILES_ldd = "${bindir}/ldd" | ||
| 51 | FILES_libsegfault = "${base_libdir}/libSegFault*" | ||
| 52 | FILES_libcidn = "${base_libdir}/libcidn*.so" | ||
| 53 | FILES_libmemusage = "${base_libdir}/libmemusage.so" | ||
| 54 | FILES_eglibc-extra-nss = "${base_libdir}/libnss*" | ||
| 55 | FILES_sln = "/sbin/sln" | ||
| 56 | FILES_eglibc-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/" | ||
| 57 | FILES_eglibc-dev_append += "${bindir}/rpcgen ${libdir}/*.a \ | ||
| 58 | ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal" | ||
| 59 | FILES_nscd = "${sbindir}/nscd*" | ||
| 60 | FILES_eglibc-utils = "${bindir}/* ${sbindir}/*" | ||
| 61 | FILES_eglibc-gconv = "${libdir}/gconv/*" | ||
| 62 | FILES_${PN}-dbg += "${libexecdir}/*/.debug ${libdir}/gconv/.debug" | ||
| 63 | FILES_catchsegv = "${bindir}/catchsegv" | ||
| 64 | RDEPENDS_catchsegv = "libsegfault" | ||
| 65 | FILES_eglibc-pcprofile = "${base_libdir}/libpcprofile.so" | ||
| 66 | FILES_eglibc-thread-db = "${base_libdir}/libthread_db*" | ||
| 67 | FILES_localedef = "${bindir}/localedef" | ||
| 68 | RPROVIDES_eglibc-dev += "libc-dev" | ||
| 69 | |||
| 70 | DESCRIPTION_sln = "eglibc: create symbolic links between files" | ||
| 71 | DESCRIPTION_nscd = "eglibc: name service cache daemon for passwd, group, and hosts" | ||
| 72 | DESCRIPTION_eglibc-extra-nss = "eglibc: nis, nisplus and hesiod search services" | ||
| 73 | DESCRIPTION_ldd = "eglibc: print shared library dependencies" | ||
| 74 | DESCRIPTION_localedef = "eglibc: compile locale definition files" | ||
| 75 | DESCRIPTION_eglibc-utils = "eglibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..." | ||
| 76 | |||
| 77 | def get_eglibc_fpu_setting(bb, d): | ||
| 78 | if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: | ||
| 79 | return "--without-fp" | ||
| 80 | return "" | ||
| 81 | |||
| 82 | EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}" | ||
| 83 | |||
| 84 | OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}" | ||
| 85 | |||
| 86 | do_configure_prepend() { | ||
| 87 | sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in | ||
| 88 | } | ||
| 89 | |||
| 90 | do_install() { | ||
| 91 | oe_runmake install_root=${D} install | ||
| 92 | for r in ${rpcsvc}; do | ||
| 93 | h=`echo $r|sed -e's,\.x$,.h,'` | ||
| 94 | install -m 0644 ${S}/sunrpc/rpcsvc/$h ${D}/${includedir}/rpcsvc/ | ||
| 95 | done | ||
| 96 | install -m 0644 ${WORKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/ | ||
| 97 | install -d ${D}${libdir}/locale | ||
| 98 | make -f ${WORKDIR}/generate-supported.mk IN="${S}/localedata/SUPPORTED" OUT="${WORKDIR}/SUPPORTED" | ||
| 99 | # get rid of some broken files... | ||
| 100 | for i in ${GLIBC_BROKEN_LOCALES}; do | ||
| 101 | grep -v $i ${WORKDIR}/SUPPORTED > ${WORKDIR}/SUPPORTED.tmp | ||
| 102 | mv ${WORKDIR}/SUPPORTED.tmp ${WORKDIR}/SUPPORTED | ||
| 103 | done | ||
| 104 | rm -f ${D}/etc/rpc | ||
| 105 | rm -rf ${D}${datadir}/zoneinfo | ||
| 106 | rm -rf ${D}${libexecdir}/getconf | ||
| 107 | } | ||
| 108 | |||
| 109 | TMP_LOCALE="/tmp/locale${libdir}/locale" | ||
| 110 | |||
| 111 | locale_base_postinst() { | ||
| 112 | #!/bin/sh | ||
| 113 | |||
| 114 | if [ "x$D" != "x" ]; then | ||
| 115 | exit 1 | ||
| 116 | fi | ||
| 117 | |||
| 118 | rm -rf ${TMP_LOCALE} | ||
| 119 | mkdir -p ${TMP_LOCALE} | ||
| 120 | if [ -f ${libdir}/locale/locale-archive ]; then | ||
| 121 | cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/ | ||
| 122 | fi | ||
| 123 | localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s | ||
| 124 | mkdir -p ${libdir}/locale/ | ||
| 125 | mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/ | ||
| 126 | rm -rf ${TMP_LOCALE} | ||
| 127 | } | ||
| 128 | |||
| 129 | locale_base_postrm() { | ||
| 130 | #!/bin/sh | ||
| 131 | |||
| 132 | rm -rf ${TMP_LOCALE} | ||
| 133 | mkdir -p ${TMP_LOCALE} | ||
| 134 | if [ -f ${libdir}/locale/locale-archive ]; then | ||
| 135 | cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/ | ||
| 136 | fi | ||
| 137 | localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s | ||
| 138 | mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/ | ||
| 139 | rm -rf ${TMP_LOCALE} | ||
| 140 | } | ||
| 141 | |||
| 142 | python __anonymous () { | ||
| 143 | enabled = bb.data.getVar("ENABLE_BINARY_LOCALE_GENERATION", d, 1) | ||
| 144 | |||
| 145 | if enabled and int(enabled): | ||
| 146 | import re | ||
| 147 | |||
| 148 | target_arch = bb.data.getVar("TARGET_ARCH", d, 1) | ||
| 149 | binary_arches = bb.data.getVar("BINARY_LOCALE_ARCHES", d, 1) or "" | ||
| 150 | |||
| 151 | for regexp in binary_arches.split(" "): | ||
| 152 | r = re.compile(regexp) | ||
| 153 | |||
| 154 | if r.match(target_arch): | ||
| 155 | depends = bb.data.getVar("DEPENDS", d, 1) | ||
| 156 | depends = "%s qemu-native" % depends | ||
| 157 | bb.data.setVar("DEPENDS", depends, d) | ||
| 158 | bb.data.setVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", "1", d) | ||
| 159 | break | ||
| 160 | } | ||
| 161 | |||
| 162 | do_prep_locale_tree() { | ||
| 163 | treedir=${WORKDIR}/locale-tree | ||
| 164 | rm -rf $treedir | ||
| 165 | mkdir -p $treedir/bin $treedir/lib $treedir/${datadir} $treedir/${libdir}/locale | ||
| 166 | cp -pPR ${PKGD}${datadir}/i18n $treedir/${datadir}/i18n | ||
| 167 | # unzip to avoid parsing errors | ||
| 168 | for i in $treedir/${datadir}/i18n/charmaps/*gz; do | ||
| 169 | gunzip $i | ||
| 170 | done | ||
| 171 | ls -d ${PKGD}${base_libdir}/* | xargs -iBLAH cp -pPR BLAH $treedir/lib | ||
| 172 | if [ -f ${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/lib/libgcc_s.* ]; then | ||
| 173 | cp -pPR ${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/lib/libgcc_s.* $treedir/lib | ||
| 174 | fi | ||
| 175 | install -m 0755 ${PKGD}${bindir}/localedef $treedir/bin | ||
| 176 | } | ||
| 177 | |||
| 178 | do_collect_bins_from_locale_tree() { | ||
| 179 | treedir=${WORKDIR}/locale-tree | ||
| 180 | |||
| 181 | mkdir -p ${PKGD}${libdir} | ||
| 182 | cp -pPR $treedir/${libdir}/locale ${PKGD}${libdir} | ||
| 183 | } | ||
| 184 | |||
| 185 | python package_do_split_gconvs () { | ||
| 186 | import os, re | ||
| 187 | if (bb.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'): | ||
| 188 | bb.note("package requested not splitting gconvs") | ||
| 189 | return | ||
| 190 | |||
| 191 | if not bb.data.getVar('PACKAGES', d, 1): | ||
| 192 | return | ||
| 193 | |||
| 194 | libdir = bb.data.getVar('libdir', d, 1) | ||
| 195 | if not libdir: | ||
| 196 | bb.error("libdir not defined") | ||
| 197 | return | ||
| 198 | datadir = bb.data.getVar('datadir', d, 1) | ||
| 199 | if not datadir: | ||
| 200 | bb.error("datadir not defined") | ||
| 201 | return | ||
| 202 | |||
| 203 | gconv_libdir = base_path_join(libdir, "gconv") | ||
| 204 | charmap_dir = base_path_join(datadir, "i18n", "charmaps") | ||
| 205 | locales_dir = base_path_join(datadir, "i18n", "locales") | ||
| 206 | binary_locales_dir = base_path_join(libdir, "locale") | ||
| 207 | |||
| 208 | def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group): | ||
| 209 | deps = [] | ||
| 210 | f = open(fn, "r") | ||
| 211 | c_re = re.compile('^copy "(.*)"') | ||
| 212 | i_re = re.compile('^include "(\w+)".*') | ||
| 213 | for l in f.readlines(): | ||
| 214 | m = c_re.match(l) or i_re.match(l) | ||
| 215 | if m: | ||
| 216 | dp = legitimize_package_name('eglibc-gconv-%s' % m.group(1)) | ||
| 217 | if not dp in deps: | ||
| 218 | deps.append(dp) | ||
| 219 | f.close() | ||
| 220 | if deps != []: | ||
| 221 | bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d) | ||
| 222 | bb.data.setVar('RPROVIDES_%s' % pkg, pkg.replace('eglibc', 'glibc'), d) | ||
| 223 | |||
| 224 | do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern='eglibc-gconv-%s', description='gconv module for character set %s', hook=calc_gconv_deps, extra_depends='eglibc-gconv') | ||
| 225 | |||
| 226 | def calc_charmap_deps(fn, pkg, file_regex, output_pattern, group): | ||
| 227 | deps = [] | ||
| 228 | f = open(fn, "r") | ||
| 229 | c_re = re.compile('^copy "(.*)"') | ||
| 230 | i_re = re.compile('^include "(\w+)".*') | ||
| 231 | for l in f.readlines(): | ||
| 232 | m = c_re.match(l) or i_re.match(l) | ||
| 233 | if m: | ||
| 234 | dp = legitimize_package_name('eglibc-charmap-%s' % m.group(1)) | ||
| 235 | if not dp in deps: | ||
| 236 | deps.append(dp) | ||
| 237 | f.close() | ||
| 238 | if deps != []: | ||
| 239 | bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d) | ||
| 240 | bb.data.setVar('RPROVIDES_%s' % pkg, pkg.replace('eglibc', 'glibc'), d) | ||
| 241 | |||
| 242 | do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern='eglibc-charmap-%s', description='character map for %s encoding', hook=calc_charmap_deps, extra_depends='') | ||
| 243 | |||
| 244 | def calc_locale_deps(fn, pkg, file_regex, output_pattern, group): | ||
| 245 | deps = [] | ||
| 246 | f = open(fn, "r") | ||
| 247 | c_re = re.compile('^copy "(.*)"') | ||
| 248 | i_re = re.compile('^include "(\w+)".*') | ||
| 249 | for l in f.readlines(): | ||
| 250 | m = c_re.match(l) or i_re.match(l) | ||
| 251 | if m: | ||
| 252 | dp = legitimize_package_name('eglibc-localedata-%s' % m.group(1)) | ||
| 253 | if not dp in deps: | ||
| 254 | deps.append(dp) | ||
| 255 | f.close() | ||
| 256 | if deps != []: | ||
| 257 | bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d) | ||
| 258 | bb.data.setVar('RPROVIDES_%s' % pkg, pkg.replace('eglibc', 'glibc'), d) | ||
| 259 | |||
| 260 | do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='eglibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='') | ||
| 261 | bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' eglibc-gconv', d) | ||
| 262 | |||
| 263 | supported = bb.data.getVar('GLIBC_GENERATE_LOCALES', d, 1) | ||
| 264 | if not supported or supported == "all": | ||
| 265 | f = open(base_path_join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r") | ||
| 266 | supported = f.readlines() | ||
| 267 | f.close() | ||
| 268 | else: | ||
| 269 | supported = supported.split() | ||
| 270 | supported = map(lambda s:s.replace(".", " ") + "\n", supported) | ||
| 271 | |||
| 272 | dot_re = re.compile("(.*)\.(.*)") | ||
| 273 | |||
| 274 | # Collate the locales by base and encoding | ||
| 275 | encodings = {} | ||
| 276 | for l in supported: | ||
| 277 | l = l[:-1] | ||
| 278 | (locale, charset) = l.split(" ") | ||
| 279 | m = dot_re.match(locale) | ||
| 280 | if m: | ||
| 281 | locale = m.group(1) | ||
| 282 | if not encodings.has_key(locale): | ||
| 283 | encodings[locale] = [] | ||
| 284 | encodings[locale].append(charset) | ||
| 285 | |||
| 286 | def output_locale_source(name, locale, encoding): | ||
| 287 | pkgname = 'locale-base-' + legitimize_package_name(name) | ||
| 288 | |||
| 289 | bb.data.setVar('RDEPENDS_%s' % pkgname, 'localedef eglibc-localedata-%s eglibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), d) | ||
| 290 | rprovides = 'virtual-locale-%s' % legitimize_package_name(name) | ||
| 291 | m = re.match("(.*)_(.*)", name) | ||
| 292 | if m: | ||
| 293 | rprovides += ' virtual-locale-%s' % m.group(1) | ||
| 294 | bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d) | ||
| 295 | bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d) | ||
| 296 | bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d) | ||
| 297 | bb.data.setVar('pkg_postinst_%s' % pkgname, bb.data.getVar('locale_base_postinst', d, 1) % (locale, encoding, locale), d) | ||
| 298 | bb.data.setVar('pkg_postrm_%s' % pkgname, bb.data.getVar('locale_base_postrm', d, 1) % (locale, encoding, locale), d) | ||
| 299 | |||
| 300 | def output_locale_binary(name, locale, encoding): | ||
| 301 | qemu = qemu_target_binary(d) + " -s 1048576" | ||
| 302 | kernel_ver = bb.data.getVar("OLDEST_KERNEL", d, 1) | ||
| 303 | if kernel_ver: | ||
| 304 | qemu += " -r %s" % (kernel_ver) | ||
| 305 | pkgname = 'locale-base-' + legitimize_package_name(name) | ||
| 306 | m = re.match("(.*)\.(.*)", name) | ||
| 307 | if m: | ||
| 308 | eglibc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-","")) | ||
| 309 | else: | ||
| 310 | eglibc_name = name | ||
| 311 | bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('eglibc-binary-localedata-%s' % eglibc_name), d) | ||
| 312 | bb.data.setVar('RPROVIDES_%s' % pkgname, 'glibc-binary-localedata-%s' % eglibc_name, d) | ||
| 313 | rprovides = 'virtual-locale-%s' % legitimize_package_name(name) | ||
| 314 | m = re.match("(.*)_(.*)", name) | ||
| 315 | if m: | ||
| 316 | rprovides += ' virtual-locale-%s' % m.group(1) | ||
| 317 | bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d) | ||
| 318 | bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d) | ||
| 319 | bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d) | ||
| 320 | |||
| 321 | treedir = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree") | ||
| 322 | ldlibdir = "%s/lib" % treedir | ||
| 323 | path = bb.data.getVar("PATH", d, 1) | ||
| 324 | i18npath = base_path_join(treedir, datadir, "i18n") | ||
| 325 | |||
| 326 | localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name) | ||
| 327 | cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s -E LD_LIBRARY_PATH=%s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, ldlibdir, treedir, localedef_opts) | ||
| 328 | bb.note("generating locale %s (%s)" % (locale, encoding)) | ||
| 329 | if os.system(cmd): | ||
| 330 | raise bb.build.FuncFailed("localedef returned an error (command was %s)." % cmd) | ||
| 331 | |||
| 332 | def output_locale(name, locale, encoding): | ||
| 333 | use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) | ||
| 334 | if use_bin: | ||
| 335 | output_locale_binary(name, locale, encoding) | ||
| 336 | else: | ||
| 337 | output_locale_source(name, locale, encoding) | ||
| 338 | |||
| 339 | use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) | ||
| 340 | if use_bin: | ||
| 341 | bb.note("preparing tree for binary locale generation") | ||
| 342 | bb.build.exec_func("do_prep_locale_tree", d) | ||
| 343 | |||
| 344 | # Reshuffle names so that UTF-8 is preferred over other encodings | ||
| 345 | non_utf8 = [] | ||
| 346 | for l in encodings.keys(): | ||
| 347 | if len(encodings[l]) == 1: | ||
| 348 | output_locale(l, l, encodings[l][0]) | ||
| 349 | if encodings[l][0] != "UTF-8": | ||
| 350 | non_utf8.append(l) | ||
| 351 | else: | ||
| 352 | if "UTF-8" in encodings[l]: | ||
| 353 | output_locale(l, l, "UTF-8") | ||
| 354 | encodings[l].remove("UTF-8") | ||
| 355 | else: | ||
| 356 | non_utf8.append(l) | ||
| 357 | for e in encodings[l]: | ||
| 358 | output_locale('%s.%s' % (l, e), l, e) | ||
| 359 | |||
| 360 | if non_utf8 != []: | ||
| 361 | bb.note("the following locales are supported only in legacy encodings:") | ||
| 362 | bb.note(" " + " ".join(non_utf8)) | ||
| 363 | |||
| 364 | use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) | ||
| 365 | if use_bin: | ||
| 366 | bb.note("collecting binary locales from locale tree") | ||
| 367 | bb.build.exec_func("do_collect_bins_from_locale_tree", d) | ||
| 368 | do_split_packages(d, binary_locales_dir, file_regex='(.*)', output_pattern='eglibc-binary-localedata-%s', description='binary locale definition for %s', extra_depends='', allow_dirs=True) | ||
| 369 | else: | ||
| 370 | bb.note("generation of binary locales disabled. this may break i18n!") | ||
| 371 | |||
| 372 | } | ||
| 373 | |||
| 374 | # We want to do this indirection so that we can safely 'return' | ||
| 375 | # from the called function even though we're prepending | ||
| 376 | python populate_packages_prepend () { | ||
| 377 | if bb.data.getVar('DEBIAN_NAMES', d, 1): | ||
| 378 | bb.data.setVar('PKG_eglibc', 'libc6', d) | ||
| 379 | bb.data.setVar('PKG_eglibc-dev', 'libc6-dev', d) | ||
| 380 | bb.build.exec_func('package_do_split_gconvs', d) | ||
| 381 | } | ||
diff --git a/meta/packages/eglibc/eglibc.inc b/meta/packages/eglibc/eglibc.inc new file mode 100644 index 0000000000..66bb90e83f --- /dev/null +++ b/meta/packages/eglibc/eglibc.inc | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | DESCRIPTION = "Embedded GNU C Library" | ||
| 2 | HOMEPAGE = "http://www.eglibc.org/home" | ||
| 3 | SECTION = "libs" | ||
| 4 | PRIORITY = "required" | ||
| 5 | LICENSE = "LGPL" | ||
| 6 | INC_PR = "r11" | ||
| 7 | # nptl needs unwind support in gcc, which can't be built without glibc. | ||
| 8 | DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers" | ||
| 9 | #this leads to circular deps, so lets not add it yet | ||
| 10 | #RDEPENDS_ldd += " bash" | ||
| 11 | # nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this | ||
| 12 | #RDEPENDS_${PN} += "${@['','libgcc']['nptl' in '${GLIBC_ADDONS}']}" | ||
| 13 | PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" | ||
| 14 | PROVIDES += "virtual/libintl virtual/libiconv" | ||
| 15 | inherit autotools | ||
| 16 | |||
| 17 | LEAD_SONAME = "libc.so" | ||
| 18 | |||
| 19 | GLIBC_EXTRA_OECONF ?= "" | ||
| 20 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 21 | |||
| 22 | ARM_INSTRUCTION_SET = "arm" | ||
| 23 | |||
| 24 | PACKAGES = "glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile" | ||
diff --git a/meta/packages/eglibc/eglibc_2.12.bb b/meta/packages/eglibc/eglibc_2.12.bb new file mode 100644 index 0000000000..541777bc79 --- /dev/null +++ b/meta/packages/eglibc/eglibc_2.12.bb | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | require eglibc.inc | ||
| 2 | |||
| 3 | DEFAULT_PREFERENCE = "-1" | ||
| 4 | DEPENDS += "gperf-native" | ||
| 5 | FILESPATHPKG =. "eglibc-svn:" | ||
| 6 | PR = "r0" | ||
| 7 | SRCREV="10809" | ||
| 8 | EGLIBC_BRANCH="eglibc-2_12" | ||
| 9 | SRC_URI = "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};proto=http \ | ||
| 10 | file://eglibc-svn-arm-lowlevellock-include-tls.patch \ | ||
| 11 | file://IO-acquire-lock-fix.patch \ | ||
| 12 | file://shorten-build-commands.patch \ | ||
| 13 | file://etc/ld.so.conf \ | ||
| 14 | file://generate-supported.mk" | ||
| 15 | S = "${WORKDIR}/${EGLIBC_BRANCH}/libc" | ||
| 16 | B = "${WORKDIR}/build-${TARGET_SYS}" | ||
| 17 | |||
| 18 | PACKAGES_DYNAMIC = "libc6*" | ||
| 19 | RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev" | ||
| 20 | PROVIDES_${PN}-dbg = "glibc-dbg" | ||
| 21 | |||
| 22 | # the -isystem in bitbake.conf screws up glibc do_stage | ||
| 23 | BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}" | ||
| 24 | TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}" | ||
| 25 | |||
| 26 | GLIBC_ADDONS ?= "ports,nptl,libidn" | ||
| 27 | |||
| 28 | GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1" | ||
| 29 | |||
| 30 | # | ||
| 31 | # For now, we will skip building of a gcc package if it is a uclibc one | ||
| 32 | # and our build is not a uclibc one, and we skip a glibc one if our build | ||
| 33 | # is a uclibc build. | ||
| 34 | # | ||
| 35 | # See the note in gcc/gcc_3.4.0.oe | ||
| 36 | # | ||
| 37 | |||
| 38 | python __anonymous () { | ||
| 39 | import bb, re | ||
| 40 | uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None) | ||
| 41 | if uc_os: | ||
| 42 | raise bb.parse.SkipPackage("incompatible with target %s" % | ||
| 43 | bb.data.getVar('TARGET_OS', d, 1)) | ||
| 44 | } | ||
| 45 | |||
| 46 | EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ | ||
| 47 | --without-cvs --disable-profile --disable-debug --without-gd \ | ||
| 48 | --enable-clocale=gnu \ | ||
| 49 | --enable-add-ons=${GLIBC_ADDONS},ports \ | ||
| 50 | --with-headers=${STAGING_INCDIR} \ | ||
| 51 | --without-selinux \ | ||
| 52 | ${GLIBC_EXTRA_OECONF}" | ||
| 53 | |||
| 54 | EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}" | ||
| 55 | |||
| 56 | do_unpack_append() { | ||
| 57 | bb.build.exec_func('do_move_ports', d) | ||
| 58 | } | ||
| 59 | |||
| 60 | do_move_ports() { | ||
| 61 | if test -d ${WORKDIR}/${EGLIBC_BRANCH}/ports ; then | ||
| 62 | rm -rf ${S}/ports | ||
| 63 | mv ${WORKDIR}/${EGLIBC_BRANCH}/ports ${S}/ | ||
| 64 | fi | ||
| 65 | } | ||
| 66 | |||
| 67 | do_configure () { | ||
| 68 | # override this function to avoid the autoconf/automake/aclocal/autoheader | ||
| 69 | # calls for now | ||
| 70 | # don't pass CPPFLAGS into configure, since it upsets the kernel-headers | ||
| 71 | # version check and doesn't really help with anything | ||
| 72 | if [ -z "`which rpcgen`" ]; then | ||
| 73 | echo "rpcgen not found. Install glibc-devel." | ||
| 74 | exit 1 | ||
| 75 | fi | ||
| 76 | (cd ${S} && gnu-configize) || die "failure in running gnu-configize" | ||
| 77 | find ${S} -name "configure" | xargs touch | ||
| 78 | CPPFLAGS="" oe_runconf | ||
| 79 | } | ||
| 80 | |||
| 81 | rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \ | ||
| 82 | yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \ | ||
| 83 | rusers.x spray.x nfs_prot.x rquota.x key_prot.x" | ||
| 84 | |||
| 85 | do_compile () { | ||
| 86 | # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging | ||
| 87 | unset LDFLAGS | ||
| 88 | base_do_compile | ||
| 89 | ( | ||
| 90 | cd ${S}/sunrpc/rpcsvc | ||
| 91 | for r in ${rpcsvc}; do | ||
| 92 | h=`echo $r|sed -e's,\.x$,.h,'` | ||
| 93 | rpcgen -h $r -o $h || oewarn "unable to generate header for $r" | ||
| 94 | done | ||
| 95 | ) | ||
| 96 | } | ||
| 97 | |||
| 98 | require eglibc-package.bbclass | ||
