Skip to contentSkip to conversation

minilzo: Update to minilzo-2.10

PATCH In review Colin Watson 2 participants 2 messages Nov 28, 2021 – Nov 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minilzo: Update to minilzo-2.10

minilzo fails to build on a number of Debian release architectures (armel, mips64el, mipsel, ppc64el) with errors such as:

../../grub-core/lib/minilzo/minilzo.c: In function 'lzo_memops_get_le16':
../../grub-core/lib/minilzo/minilzo.c:3479:11: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

   3479 |         * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss); \
        |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../../grub-core/lib/minilzo/minilzo.c:3530:5: note: in expansion of macro 'LZO_MEMOPS_COPY2'
   3530 |     LZO_MEMOPS_COPY2(&v, ss);
        |     ^~~~~~~~~~~~~~~~

The latest upstream version is 2.10, so updating to it seems like a good idea on general principles, and it fixes builds on all the above architectures.

The update procedure documented in the GRUB Developers Manual worked; I just updated the version numbers to make it clear that it's been executed recently.

---
 docs/grub-dev.texi              |  10 +-
 grub-core/lib/minilzo/lzoconf.h |  41 ++-
 grub-core/lib/minilzo/lzodefs.h | 416 +++++++++++++++++++-----
 grub-core/lib/minilzo/minilzo.c | 542 +++++++++++++++++++++++++-------
 grub-core/lib/minilzo/minilzo.h |  22 +-
 5 files changed, 817 insertions(+), 214 deletions(-)
docs/grub-dev.texi +5 -5
index fb2cc965e..92c69b6dd 100644
@@ -575,12 +575,12 @@ To upgrade to a new version of the miniLZO library, download the release
 tarball and copy the files into the target directory:
 
 @example
-curl -L -O http://www.oberhumer.com/opensource/lzo/download/minilzo-2.08.tar.gz
-tar -zxf minilzo-2.08.tar.gz
-rm minilzo-2.08/testmini.c
+curl -L -O http://www.oberhumer.com/opensource/lzo/download/minilzo-2.10.tar.gz
+tar -zxf minilzo-2.10.tar.gz
+rm minilzo-2.10/testmini.c
 rm -r grub-core/lib/minilzo/*
-cp minilzo-2.08/*.[hc] grub-core/lib/minilzo
-rm -r minilzo-2.08*
+cp minilzo-2.10/*.[hc] grub-core/lib/minilzo
+rm -r minilzo-2.10*
 @end example
 
 @node Porting
grub-core/lib/minilzo/lzoconf.h +25 -16

120 lines not on this page · raw message

grub-core/lib/minilzo/lzodefs.h +343 -73

925 lines not on this page · raw message

grub-core/lib/minilzo/minilzo.c +427 -115

1,232 lines not on this page · raw message

grub-core/lib/minilzo/minilzo.h +17 -5
index 793745467..c1c229757 100644
@@ -2,7 +2,7 @@
 
    This file is part of the LZO real-time data compression library.
 
-   Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+   Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
    All Rights Reserved.
 
    The LZO library is free software; you can redistribute it and/or
@@ -32,15 +32,25 @@
  */
 
 
-#ifndef __MINILZO_H
-#define __MINILZO_H 1
+#ifndef __MINILZO_H_INCLUDED
+#define __MINILZO_H_INCLUDED 1
 
-#define MINILZO_VERSION         0x2080
+#define MINILZO_VERSION         0x20a0  /* 2.10 */
 
-#ifdef __LZOCONF_H
+#if defined(__LZOCONF_H_INCLUDED)
 #  error "you cannot use both LZO and miniLZO"
 #endif
 
+/* internal Autoconf configuration file - only used when building miniLZO */
+#ifdef MINILZO_HAVE_CONFIG_H
+#  include <config.h>
+#endif
+#include <limits.h>
+#include <stddef.h>
+
+#ifndef __LZODEFS_H_INCLUDED
+#include "lzodefs.h"
+#endif
 #undef LZO_HAVE_CONFIG_H
 #include "lzoconf.h"
 
@@ -92,3 +102,5 @@ lzo1x_decompress_safe   ( const lzo_bytep src, lzo_uint  src_len,
 
 #endif /* already included */
 
+
+/* vim:set ts=4 sw=4 et: */
Signature · 1 line
2.33.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Colin Watson

minilzo fails to build on a number of Debian release architectures (armel, mips64el, mipsel, ppc64el) with errors such as:

../../grub-core/lib/minilzo/minilzo.c: In function 'lzo_memops_get_le16':
../../grub-core/lib/minilzo/minilzo.c:3479:11: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

   3479 |         * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss); \
        |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../../grub-core/lib/minilzo/minilzo.c:3530:5: note: in expansion of macro 'LZO_MEMOPS_COPY2'
   3530 |     LZO_MEMOPS_COPY2(&v, ss);
        |     ^~~~~~~~~~~~~~~~

The latest upstream version is 2.10, so updating to it seems like a good idea on general principles, and it fixes builds on all the above architectures.

Quoted 5 lines

The update procedure documented in the GRUB Developers Manual worked; I just updated the version numbers to make it clear that it's been executed recently.

Daniel