diff options
| -rw-r--r-- | meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch | 70 | ||||
| -rw-r--r-- | meta/recipes-support/lzo/lzo_2.08.bb | 1 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch b/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch new file mode 100644 index 0000000000..db3a70e803 --- /dev/null +++ b/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | From: Simon McVittie <smcv@debian.org> | ||
| 2 | Date: Sun, 23 Nov 2014 22:50:33 +0000 | ||
| 3 | Subject: Use memcpy() instead of reinventing it | ||
| 4 | |||
| 5 | gcc inlines memcpy() with results as fast as handwritten code (at | ||
| 6 | least in my brief testing with lzop), and knows the alignment | ||
| 7 | constraints for our architectures. | ||
| 8 | |||
| 9 | Change suggested by Julian Taylor. | ||
| 10 | |||
| 11 | Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757037 | ||
| 12 | |||
| 13 | Upstream-Status: Pending | ||
| 14 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
| 15 | --- | ||
| 16 | minilzo/minilzo.c | 14 ++++++++++++++ | ||
| 17 | src/lzo_func.h | 14 ++++++++++++++ | ||
| 18 | 2 files changed, 28 insertions(+) | ||
| 19 | |||
| 20 | |||
| 21 | diff --git a/minilzo/minilzo.c b/minilzo/minilzo.c | ||
| 22 | index ab2be5f..6913c2f 100644 | ||
| 23 | --- a/minilzo/minilzo.c | ||
| 24 | +++ b/minilzo/minilzo.c | ||
| 25 | @@ -3523,6 +3523,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8) | ||
| 26 | if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \ | ||
| 27 | LZO_BLOCK_END | ||
| 28 | |||
| 29 | +/* Debian-specific change: we know that our compiler inlines memcpy() with | ||
| 30 | + * constant n to be as fast as handwritten code, and knows which architectures | ||
| 31 | + * need things correctly aligned. */ | ||
| 32 | +#undef LZO_MEMOPS_COPY1 | ||
| 33 | +#undef LZO_MEMOPS_COPY2 | ||
| 34 | +#undef LZO_MEMOPS_COPY4 | ||
| 35 | +#undef LZO_MEMOPS_COPY8 | ||
| 36 | +#undef LZO_MEMOPS_COPYN | ||
| 37 | +#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1) | ||
| 38 | +#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2) | ||
| 39 | +#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4) | ||
| 40 | +#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8) | ||
| 41 | +#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn) | ||
| 42 | + | ||
| 43 | __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss) | ||
| 44 | { | ||
| 45 | lzo_uint16_t v; | ||
| 46 | diff --git a/src/lzo_func.h b/src/lzo_func.h | ||
| 47 | index dfaa676..1cc1b53 100644 | ||
| 48 | --- a/src/lzo_func.h | ||
| 49 | +++ b/src/lzo_func.h | ||
| 50 | @@ -333,6 +333,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8) | ||
| 51 | if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \ | ||
| 52 | LZO_BLOCK_END | ||
| 53 | |||
| 54 | +/* Debian-specific change: we know that our compiler inlines memcpy() with | ||
| 55 | + * constant n to be as fast as handwritten code, and knows which architectures | ||
| 56 | + * need things correctly aligned. */ | ||
| 57 | +#undef LZO_MEMOPS_COPY1 | ||
| 58 | +#undef LZO_MEMOPS_COPY2 | ||
| 59 | +#undef LZO_MEMOPS_COPY4 | ||
| 60 | +#undef LZO_MEMOPS_COPY8 | ||
| 61 | +#undef LZO_MEMOPS_COPYN | ||
| 62 | +#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1) | ||
| 63 | +#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2) | ||
| 64 | +#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4) | ||
| 65 | +#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8) | ||
| 66 | +#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn) | ||
| 67 | + | ||
| 68 | __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss) | ||
| 69 | { | ||
| 70 | lzo_uint16_t v; | ||
diff --git a/meta/recipes-support/lzo/lzo_2.08.bb b/meta/recipes-support/lzo/lzo_2.08.bb index 7d7d1f32ba..af06e29a6f 100644 --- a/meta/recipes-support/lzo/lzo_2.08.bb +++ b/meta/recipes-support/lzo/lzo_2.08.bb | |||
| @@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | |||
| 6 | file://src/lzo_init.c;beginline=5;endline=25;md5=a6e25df9a83b24629e847846ccdd8054" | 6 | file://src/lzo_init.c;beginline=5;endline=25;md5=a6e25df9a83b24629e847846ccdd8054" |
| 7 | 7 | ||
| 8 | SRC_URI = "http://www.oberhumer.com/opensource/lzo/download/lzo-${PV}.tar.gz \ | 8 | SRC_URI = "http://www.oberhumer.com/opensource/lzo/download/lzo-${PV}.tar.gz \ |
| 9 | file://0001-Use-memcpy-instead-of-reinventing-it.patch \ | ||
| 9 | file://acinclude.m4 \ | 10 | file://acinclude.m4 \ |
| 10 | " | 11 | " |
| 11 | 12 | ||
