diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/dietlibc/dietlibc-0.32/ccache.patch | 74 | ||||
-rw-r--r-- | recipes/dietlibc/dietlibc-0.32/diethome.patch | 24 | ||||
-rw-r--r-- | recipes/dietlibc/dietlibc.inc | 45 | ||||
-rw-r--r-- | recipes/dietlibc/dietlibc_0.31.bb | 51 | ||||
-rw-r--r-- | recipes/dietlibc/dietlibc_0.32.bb | 9 |
5 files changed, 158 insertions, 45 deletions
diff --git a/recipes/dietlibc/dietlibc-0.32/ccache.patch b/recipes/dietlibc/dietlibc-0.32/ccache.patch new file mode 100644 index 0000000000..fb067f038f --- /dev/null +++ b/recipes/dietlibc/dietlibc-0.32/ccache.patch @@ -0,0 +1,74 @@ +Index: dietlibc-0.32/diet.c +=================================================================== +--- dietlibc-0.32.orig/diet.c 2009-03-17 00:17:58.000000000 +0100 ++++ dietlibc-0.32/diet.c 2009-10-02 14:12:14.306929201 +0200 +@@ -132,7 +132,12 @@ + } + } + { +- char *cc=argv[1]; ++ char *cc; ++ if (!strcmp(argv[1],"ccache")) { ++ cc=argv[2]; ++ } else { ++ cc=argv[1]; ++ } + char *tmp=strchr(cc,0)-2; + char *tmp2,*tmp3; + if (tmp<cc) goto donttouch; +@@ -144,7 +149,7 @@ + if (tmp3<tmp2) tmp2=tmp3; + if (tmp2-cc>90) error("platform name too long!\n"); + shortplatform=platform+len; +- memmove(shortplatform,argv[1],(size_t)(tmp2-cc)); ++ memmove(shortplatform,cc,(size_t)(tmp2-cc)); + platform[tmp2-cc+len]=0; + if (shortplatform[0]=='i' && shortplatform[2]=='8' && shortplatform[3]=='6') shortplatform[1]='3'; + } else { +@@ -291,6 +296,9 @@ + + dest=newargv; + *dest++=argv[1]; ++ if (strcmp(argv[1],"ccache") == 0) { ++ *dest++=argv[2]; ++ } + if (argv[2]) { + if (!strcmp(argv[2],"-V")) { + *dest++=argv[2]; +@@ -300,9 +308,9 @@ + } else if (!memcmp(argv[2],"-V",2)) { + *dest++=argv[2]; + ++argv; +- --argc; + } + } ++ + #ifndef __DYN_LIB + if (_link) { *dest++=(char*)nostdlib; *dest++=dashstatic; *dest++=dashL; } + #else +@@ -320,7 +328,15 @@ + #ifdef WANT_DYNAMIC + if (_link) { *dest++=d; } + #endif +- for (i=2; i<argc; ++i) { ++ if (strcmp(argv[1],"ccache") == 0) { ++ i=3; ++ } else { ++ i=2; ++ } ++ for (i; i<argc; ++i) { ++ if (strstr(argv[i],"isystem") != NULL) ++ continue; ++ + if (!strcmp(argv[i],"-pthread")) { + *dest++="-D_REENTRANT"; + if (_link) *dest++="-lpthread"; +@@ -333,6 +349,8 @@ + continue; + } + *dest++=argv[i]; ++ *dest--; ++ *dest++; + } + #ifndef __DYN_LIB + if (compile || _link) { diff --git a/recipes/dietlibc/dietlibc-0.32/diethome.patch b/recipes/dietlibc/dietlibc-0.32/diethome.patch new file mode 100644 index 0000000000..ee05b2308d --- /dev/null +++ b/recipes/dietlibc/dietlibc-0.32/diethome.patch @@ -0,0 +1,24 @@ +Index: dietlibc-0.32/Makefile +=================================================================== +--- dietlibc-0.32.orig/Makefile 2008-05-09 06:36:56.000000000 +0200 ++++ dietlibc-0.32/Makefile 2009-10-02 14:39:58.059248076 +0200 +@@ -295,16 +295,16 @@ + $(SYSCALLOBJ): syscalls.h + + $(OBJDIR)/elftrunc: $(OBJDIR)/diet contrib/elftrunc.c +- bin-$(MYARCH)/diet $(CROSS)$(CC) $(CFLAGS) -o $@ contrib/elftrunc.c ++ DIETHOME=$(PWD) bin-$(MYARCH)/diet $(CROSS)$(CC) $(CFLAGS) -o $@ contrib/elftrunc.c + + $(OBJDIR)/dnsd: $(OBJDIR)/diet contrib/dnsd.c +- bin-$(MYARCH)/diet $(CROSS)$(CC) $(CFLAGS) -o $@ contrib/dnsd.c ++ DIETHOME=$(PWD) bin-$(MYARCH)/diet $(CROSS)$(CC) $(CFLAGS) -o $@ contrib/dnsd.c + + VERSION=dietlibc-$(shell head -n 1 CHANGES|sed 's/://') + CURNAME=$(notdir $(shell pwd)) + + $(OBJDIR)/diet: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietlibc.a $(OBJDIR)/dyn_stop.o +- $(CROSS)$(CC) -isystem include $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(HOME)\" -DVERSION=\"$(VERSION)\" -lgcc ++ $(CROSS)$(CC) -isystem include $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(prefix)\" -DVERSION=\"$(VERSION)\" -lgcc + $(CROSS)strip -R .comment -R .note $@ + + $(OBJDIR)/diet-i: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietlibc.a $(OBJDIR)/dyn_stop.o diff --git a/recipes/dietlibc/dietlibc.inc b/recipes/dietlibc/dietlibc.inc new file mode 100644 index 0000000000..7884188486 --- /dev/null +++ b/recipes/dietlibc/dietlibc.inc @@ -0,0 +1,45 @@ +SECTION = "libs" +DESCRIPTION = "The diet libc is a libc that is optimized for small size. \ +It can be used to create small statically linked binaries" +LICENSE = "GPLv2" + +INC_PR = "r1" + +SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/dietlibc/dietlibc-${PV}.tar.bz2" + +#otherwise the whole run scripts got broken +do_configure () { +: +} + +do_compile () { + oe_runmake all CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" prefix=${STAGING_DIR_TARGET}/lib/dietlibc + oe_runmake all ARCH="${TARGET_ARCH}" CROSS=" " prefix=${STAGING_DIR_TARGET}/lib/dietlibc +} + +#no packages needed, all binaries will be compiled with -static +PACKAGES = " " + +#otherwise the whole run scripts got broken +do_install () { +: +} + +do_stage () { + DIETLIBC_BUILD_ARCH=`echo ${BUILD_ARCH} | sed -e s'/.86/386/'` + DIETLIBC_TARGET_ARCH=`echo ${TARGET_ARCH} | sed -e s'/.86/386/'` + rm -rf ${STAGING_DIR_TARGET}/lib/dietlibc || true + rm ${CROSS_DIR}/bin/diet || true + install -d ${STAGING_DIR_TARGET}/lib/dietlibc/lib-${DIETLIBC_TARGET_ARCH} + install -d ${STAGING_DIR_TARGET}/lib/dietlibc/include + for i in `find include -name \*.h`; do install -m 644 -D $i ${STAGING_DIR_TARGET}/lib/dietlibc/$i; done + + install -m755 bin-${DIETLIBC_BUILD_ARCH}/diet-i ${CROSS_DIR}/bin/diet + + cd bin-${DIETLIBC_TARGET_ARCH} + install -m 644 start.o libm.a libpthread.a librpc.a \ + liblatin1.a libcompat.a libcrypt.a \ + ${STAGING_DIR_TARGET}/lib/dietlibc/lib-${DIETLIBC_TARGET_ARCH} + install -m 644 dietlibc.a ${STAGING_DIR_TARGET}/lib/dietlibc/lib-${DIETLIBC_TARGET_ARCH}/libc.a +} + diff --git a/recipes/dietlibc/dietlibc_0.31.bb b/recipes/dietlibc/dietlibc_0.31.bb index 7720588b60..70b813bb07 100644 --- a/recipes/dietlibc/dietlibc_0.31.bb +++ b/recipes/dietlibc/dietlibc_0.31.bb @@ -1,47 +1,8 @@ -SECTION = "libs" -DESCRIPTION = "The diet libc is a libc that is optimized for small size. \ -It can be used to create small statically linked binaries" -LICENSE = "GPLv2" +require dietlibc.inc -SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/dietlibc/dietlibc-${PV}.tar.bz2 \ - file://ccache.patch;patch=1 \ - file://ceil.patch;patch=1 \ - file://ai_addrconfig.patch;patch=1 \ - " - -#otherwise the whole run scripts got broken -do_configure () { - echo "moo" > /dev/null 2>&1 -} - -do_compile () { - oe_runmake all CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" prefix=${STAGING_DIR_TARGET}/lib/dietlibc - oe_runmake all ARCH="${TARGET_ARCH}" CROSS=" " prefix=${STAGING_DIR_TARGET}/lib/dietlibc -} - -#no packages needed, all binaries will be compiled with -static -PACKAGES = " " - -#otherwise the whole run scripts got broken -do_install () { - echo "moo" > /dev/null 2>&1 -} - -do_stage () { - DIETLIBC_BUILD_ARCH=`echo ${BUILD_ARCH} | sed -e s'/.86/386/'` - DIETLIBC_TARGET_ARCH=`echo ${TARGET_ARCH} | sed -e s'/.86/386/'` - rm -rf ${STAGING_DIR_TARGET}/lib/dietlibc || true - rm ${CROSS_DIR}/bin/diet || true - install -d ${STAGING_DIR_TARGET}/lib/dietlibc/lib-${DIETLIBC_TARGET_ARCH} - install -d ${STAGING_DIR_TARGET}/lib/dietlibc/include - for i in `find include -name \*.h`; do install -m 644 -D $i ${STAGING_DIR_TARGET}/lib/dietlibc/$i; done - - install -m755 bin-${DIETLIBC_BUILD_ARCH}/diet-i ${CROSS_DIR}/bin/diet - - cd bin-${DIETLIBC_TARGET_ARCH} - install -m 644 start.o libm.a libpthread.a librpc.a \ - liblatin1.a libcompat.a libcrypt.a \ - ${STAGING_DIR_TARGET}/lib/dietlibc/lib-${DIETLIBC_TARGET_ARCH} - install -m 644 dietlibc.a ${STAGING_DIR_TARGET}/lib/dietlibc/lib-${DIETLIBC_TARGET_ARCH}/libc.a -} +PR = "${INC_PR}.1" +SRC_URI += "file://ccache.patch;patch=1 \ + file://ceil.patch;patch=1 \ + file://ai_addrconfig.patch;patch=1 \ + " diff --git a/recipes/dietlibc/dietlibc_0.32.bb b/recipes/dietlibc/dietlibc_0.32.bb new file mode 100644 index 0000000000..5e644fa750 --- /dev/null +++ b/recipes/dietlibc/dietlibc_0.32.bb @@ -0,0 +1,9 @@ +require dietlibc.inc + +PR = "${INC_PR}.1" + +SRC_URI += "file://ccache.patch;patch=1 \ + file://ceil.patch;patch=1 \ + file://diethome.patch;patch=1 \ + " + |