* [PATCH v2] lzo: add debian patch for alignment issue
@ 2014-12-03 22:51 Saul Wold
2014-12-15 18:03 ` [PATCH v2][dizzy] " Saul Wold
0 siblings, 1 reply; 3+ messages in thread
From: Saul Wold @ 2014-12-03 22:51 UTC (permalink / raw)
To: openembedded-core
[YOCTO #6994]
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
v2 Fixed Patched Tag info
...0001-Use-memcpy-instead-of-reinventing-it.patch | 70 ++++++++++++++++++++++
meta/recipes-support/lzo/lzo_2.08.bb | 1 +
2 files changed, 71 insertions(+)
create mode 100644 meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
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 0000000..db3a70e
--- /dev/null
+++ b/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
@@ -0,0 +1,70 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Sun, 23 Nov 2014 22:50:33 +0000
+Subject: Use memcpy() instead of reinventing it
+
+gcc inlines memcpy() with results as fast as handwritten code (at
+least in my brief testing with lzop), and knows the alignment
+constraints for our architectures.
+
+Change suggested by Julian Taylor.
+
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757037
+
+Upstream-Status: Pending
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ minilzo/minilzo.c | 14 ++++++++++++++
+ src/lzo_func.h | 14 ++++++++++++++
+ 2 files changed, 28 insertions(+)
+
+
+diff --git a/minilzo/minilzo.c b/minilzo/minilzo.c
+index ab2be5f..6913c2f 100644
+--- a/minilzo/minilzo.c
++++ b/minilzo/minilzo.c
+@@ -3523,6 +3523,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+ if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+ LZO_BLOCK_END
+
++/* Debian-specific change: we know that our compiler inlines memcpy() with
++ * constant n to be as fast as handwritten code, and knows which architectures
++ * need things correctly aligned. */
++#undef LZO_MEMOPS_COPY1
++#undef LZO_MEMOPS_COPY2
++#undef LZO_MEMOPS_COPY4
++#undef LZO_MEMOPS_COPY8
++#undef LZO_MEMOPS_COPYN
++#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
++#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
++#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
++#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
++#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
++
+ __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+ {
+ lzo_uint16_t v;
+diff --git a/src/lzo_func.h b/src/lzo_func.h
+index dfaa676..1cc1b53 100644
+--- a/src/lzo_func.h
++++ b/src/lzo_func.h
+@@ -333,6 +333,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+ if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+ LZO_BLOCK_END
+
++/* Debian-specific change: we know that our compiler inlines memcpy() with
++ * constant n to be as fast as handwritten code, and knows which architectures
++ * need things correctly aligned. */
++#undef LZO_MEMOPS_COPY1
++#undef LZO_MEMOPS_COPY2
++#undef LZO_MEMOPS_COPY4
++#undef LZO_MEMOPS_COPY8
++#undef LZO_MEMOPS_COPYN
++#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
++#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
++#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
++#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
++#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
++
+ __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+ {
+ 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 7d7d1f3..af06e29 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 \
file://src/lzo_init.c;beginline=5;endline=25;md5=a6e25df9a83b24629e847846ccdd8054"
SRC_URI = "http://www.oberhumer.com/opensource/lzo/download/lzo-${PV}.tar.gz \
+ file://0001-Use-memcpy-instead-of-reinventing-it.patch \
file://acinclude.m4 \
"
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2][dizzy] lzo: add debian patch for alignment issue
2014-12-03 22:51 [PATCH v2] lzo: add debian patch for alignment issue Saul Wold
@ 2014-12-15 18:03 ` Saul Wold
2014-12-15 18:08 ` akuster
0 siblings, 1 reply; 3+ messages in thread
From: Saul Wold @ 2014-12-15 18:03 UTC (permalink / raw)
To: Armin Kuster; +Cc: 'Patches and discussions about the oe-core layer'
Armin,
Please backport this patch to dizzy
Thanks
Sau!
On 12/03/2014 02:51 PM, Saul Wold wrote:
> [YOCTO #6994]
>
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
> v2 Fixed Patched Tag info
>
> ...0001-Use-memcpy-instead-of-reinventing-it.patch | 70 ++++++++++++++++++++++
> meta/recipes-support/lzo/lzo_2.08.bb | 1 +
> 2 files changed, 71 insertions(+)
> create mode 100644 meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
>
> 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 0000000..db3a70e
> --- /dev/null
> +++ b/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
> @@ -0,0 +1,70 @@
> +From: Simon McVittie <smcv@debian.org>
> +Date: Sun, 23 Nov 2014 22:50:33 +0000
> +Subject: Use memcpy() instead of reinventing it
> +
> +gcc inlines memcpy() with results as fast as handwritten code (at
> +least in my brief testing with lzop), and knows the alignment
> +constraints for our architectures.
> +
> +Change suggested by Julian Taylor.
> +
> +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757037
> +
> +Upstream-Status: Pending
> +Signed-off-by: Saul Wold <sgw@linux.intel.com>
> +---
> + minilzo/minilzo.c | 14 ++++++++++++++
> + src/lzo_func.h | 14 ++++++++++++++
> + 2 files changed, 28 insertions(+)
> +
> +
> +diff --git a/minilzo/minilzo.c b/minilzo/minilzo.c
> +index ab2be5f..6913c2f 100644
> +--- a/minilzo/minilzo.c
> ++++ b/minilzo/minilzo.c
> +@@ -3523,6 +3523,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
> + if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
> + LZO_BLOCK_END
> +
> ++/* Debian-specific change: we know that our compiler inlines memcpy() with
> ++ * constant n to be as fast as handwritten code, and knows which architectures
> ++ * need things correctly aligned. */
> ++#undef LZO_MEMOPS_COPY1
> ++#undef LZO_MEMOPS_COPY2
> ++#undef LZO_MEMOPS_COPY4
> ++#undef LZO_MEMOPS_COPY8
> ++#undef LZO_MEMOPS_COPYN
> ++#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
> ++#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
> ++#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
> ++#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
> ++#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
> ++
> + __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
> + {
> + lzo_uint16_t v;
> +diff --git a/src/lzo_func.h b/src/lzo_func.h
> +index dfaa676..1cc1b53 100644
> +--- a/src/lzo_func.h
> ++++ b/src/lzo_func.h
> +@@ -333,6 +333,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
> + if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
> + LZO_BLOCK_END
> +
> ++/* Debian-specific change: we know that our compiler inlines memcpy() with
> ++ * constant n to be as fast as handwritten code, and knows which architectures
> ++ * need things correctly aligned. */
> ++#undef LZO_MEMOPS_COPY1
> ++#undef LZO_MEMOPS_COPY2
> ++#undef LZO_MEMOPS_COPY4
> ++#undef LZO_MEMOPS_COPY8
> ++#undef LZO_MEMOPS_COPYN
> ++#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
> ++#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
> ++#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
> ++#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
> ++#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
> ++
> + __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
> + {
> + 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 7d7d1f3..af06e29 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 \
> file://src/lzo_init.c;beginline=5;endline=25;md5=a6e25df9a83b24629e847846ccdd8054"
>
> SRC_URI = "http://www.oberhumer.com/opensource/lzo/download/lzo-${PV}.tar.gz \
> + file://0001-Use-memcpy-instead-of-reinventing-it.patch \
> file://acinclude.m4 \
> "
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2][dizzy] lzo: add debian patch for alignment issue
2014-12-15 18:03 ` [PATCH v2][dizzy] " Saul Wold
@ 2014-12-15 18:08 ` akuster
0 siblings, 0 replies; 3+ messages in thread
From: akuster @ 2014-12-15 18:08 UTC (permalink / raw)
To: Saul Wold; +Cc: 'Patches and discussions about the oe-core layer'
ok.
- armin
On 12/15/2014 10:03 AM, Saul Wold wrote:
> [YOCTO #6994]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-15 18:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-03 22:51 [PATCH v2] lzo: add debian patch for alignment issue Saul Wold
2014-12-15 18:03 ` [PATCH v2][dizzy] " Saul Wold
2014-12-15 18:08 ` akuster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox