Skip to content
Snippets Groups Projects
Commit dbcbb3e5 authored by Colin Watson's avatar Colin Watson
Browse files

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.

Signed-off-by: default avatarColin Watson <cjwatson@debian.org>

Forwarded: https://lists.gnu.org/archive/html/grub-devel/2021-11/msg00095.html
Last-Update: 2021-11-29

Patch-Name: minilzo-2.10.patch
parent 1a1c93cd
No related branches found
No related tags found
No related merge requests found
...@@ -575,12 +575,12 @@ To upgrade to a new version of the miniLZO library, download the release ...@@ -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: tarball and copy the files into the target directory:
@example @example
curl -L -O http://www.oberhumer.com/opensource/lzo/download/minilzo-2.08.tar.gz curl -L -O http://www.oberhumer.com/opensource/lzo/download/minilzo-2.10.tar.gz
tar -zxf minilzo-2.08.tar.gz tar -zxf minilzo-2.10.tar.gz
rm minilzo-2.08/testmini.c rm minilzo-2.10/testmini.c
rm -r grub-core/lib/minilzo/* rm -r grub-core/lib/minilzo/*
cp minilzo-2.08/*.[hc] grub-core/lib/minilzo cp minilzo-2.10/*.[hc] grub-core/lib/minilzo
rm -r minilzo-2.08* rm -r minilzo-2.10*
@end example @end example
@node Porting @node Porting
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
This file is part of the LZO real-time data compression library. 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. All Rights Reserved.
The LZO library is free software; you can redistribute it and/or The LZO library is free software; you can redistribute it and/or
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
#ifndef __LZOCONF_H_INCLUDED #ifndef __LZOCONF_H_INCLUDED
#define __LZOCONF_H_INCLUDED 1 #define __LZOCONF_H_INCLUDED 1
#define LZO_VERSION 0x2080 #define LZO_VERSION 0x20a0 /* 2.10 */
#define LZO_VERSION_STRING "2.08" #define LZO_VERSION_STRING "2.10"
#define LZO_VERSION_DATE "Jun 29 2014" #define LZO_VERSION_DATE "Mar 01 2017"
/* internal Autoconf configuration file - only used when building LZO */ /* internal Autoconf configuration file - only used when building LZO */
#if defined(LZO_HAVE_CONFIG_H) #if defined(LZO_HAVE_CONFIG_H)
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
/* get OS and architecture defines */ /* get OS and architecture defines */
#ifndef __LZODEFS_H_INCLUDED #ifndef __LZODEFS_H_INCLUDED
#include "lzodefs.h" #include <lzo/lzodefs.h>
#endif #endif
...@@ -94,25 +94,29 @@ extern "C" { ...@@ -94,25 +94,29 @@ extern "C" {
# if (LZO_OS_WIN64) # if (LZO_OS_WIN64)
typedef unsigned __int64 lzo_uint; typedef unsigned __int64 lzo_uint;
typedef __int64 lzo_int; typedef __int64 lzo_int;
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF___INT64
# else # else
typedef lzo_ullong_t lzo_uint; typedef lzo_ullong_t lzo_uint;
typedef lzo_llong_t lzo_int; typedef lzo_llong_t lzo_int;
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG_LONG
# endif # endif
# define LZO_SIZEOF_LZO_UINT 8 # define LZO_SIZEOF_LZO_INT 8
# define LZO_UINT_MAX 0xffffffffffffffffull # define LZO_UINT_MAX 0xffffffffffffffffull
# define LZO_INT_MAX 9223372036854775807LL # define LZO_INT_MAX 9223372036854775807LL
# define LZO_INT_MIN (-1LL - LZO_INT_MAX) # define LZO_INT_MIN (-1LL - LZO_INT_MAX)
# elif (LZO_ABI_IP32L64) /* MIPS R5900 */ # elif (LZO_ABI_IP32L64) /* MIPS R5900 */
typedef unsigned int lzo_uint; typedef unsigned int lzo_uint;
typedef int lzo_int; typedef int lzo_int;
# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_INT # define LZO_SIZEOF_LZO_INT LZO_SIZEOF_INT
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_INT
# define LZO_UINT_MAX UINT_MAX # define LZO_UINT_MAX UINT_MAX
# define LZO_INT_MAX INT_MAX # define LZO_INT_MAX INT_MAX
# define LZO_INT_MIN INT_MIN # define LZO_INT_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL) # elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint; typedef unsigned long lzo_uint;
typedef long lzo_int; typedef long lzo_int;
# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LONG # define LZO_SIZEOF_LZO_INT LZO_SIZEOF_LONG
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG
# define LZO_UINT_MAX ULONG_MAX # define LZO_UINT_MAX ULONG_MAX
# define LZO_INT_MAX LONG_MAX # define LZO_INT_MAX LONG_MAX
# define LZO_INT_MIN LONG_MIN # define LZO_INT_MIN LONG_MIN
...@@ -122,7 +126,7 @@ extern "C" { ...@@ -122,7 +126,7 @@ extern "C" {
#endif #endif
/* The larger type of lzo_uint and lzo_uint32_t. */ /* The larger type of lzo_uint and lzo_uint32_t. */
#if (LZO_SIZEOF_LZO_UINT >= 4) #if (LZO_SIZEOF_LZO_INT >= 4)
# define lzo_xint lzo_uint # define lzo_xint lzo_uint
#else #else
# define lzo_xint lzo_uint32_t # define lzo_xint lzo_uint32_t
...@@ -131,7 +135,8 @@ extern "C" { ...@@ -131,7 +135,8 @@ extern "C" {
typedef int lzo_bool; typedef int lzo_bool;
/* sanity checks */ /* sanity checks */
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_UINT) LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int) == LZO_SIZEOF_LZO_INT)
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_INT)
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint)) LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint))
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t)) LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t))
...@@ -163,14 +168,14 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t)) ...@@ -163,14 +168,14 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t))
#endif #endif
/* Older LZO versions used to support ancient systems and memory models /* Older LZO versions used to support ancient systems and memory models
* like 16-bit MSDOS with __huge pointers and Cray PVP, but these * such as 16-bit MSDOS with __huge pointers or Cray PVP, but these
* obsolete configurations are not supported any longer. * obsolete configurations are not supported any longer.
*/ */
#if defined(__LZO_MMODEL_HUGE) #if defined(__LZO_MMODEL_HUGE)
#error "__LZO_MMODEL_HUGE is unsupported" #error "__LZO_MMODEL_HUGE memory model is unsupported"
#endif #endif
#if (LZO_MM_PVP) #if (LZO_MM_PVP)
#error "LZO_MM_PVP is unsupported" #error "LZO_MM_PVP memory model is unsupported"
#endif #endif
#if (LZO_SIZEOF_INT < 4) #if (LZO_SIZEOF_INT < 4)
#error "LZO_SIZEOF_INT < 4 is unsupported" #error "LZO_SIZEOF_INT < 4 is unsupported"
...@@ -221,13 +226,13 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep)) ...@@ -221,13 +226,13 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep))
/* __cdecl calling convention for public C and assembly functions */ /* __cdecl calling convention for public C and assembly functions */
#if !defined(LZO_PUBLIC) #if !defined(LZO_PUBLIC)
# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL # define LZO_PUBLIC(r) __LZO_EXPORT1 r __LZO_EXPORT2 __LZO_CDECL
#endif #endif
#if !defined(LZO_EXTERN) #if !defined(LZO_EXTERN)
# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype) # define LZO_EXTERN(r) __LZO_EXTERN_C LZO_PUBLIC(r)
#endif #endif
#if !defined(LZO_PRIVATE) #if !defined(LZO_PRIVATE)
# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL # define LZO_PRIVATE(r) static r __LZO_CDECL
#endif #endif
/* function types */ /* function types */
...@@ -399,6 +404,10 @@ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); ...@@ -399,6 +404,10 @@ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size);
/* deprecated types */ /* deprecated types */
typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u; typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u;
typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u; typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u;
/* deprecated defines */
#if !defined(LZO_SIZEOF_LZO_UINT)
# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LZO_INT
#endif
#if defined(LZO_CFG_COMPAT) #if defined(LZO_CFG_COMPAT)
......
This diff is collapsed.
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
This file is part of the LZO real-time data compression library. 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. All Rights Reserved.
The LZO library is free software; you can redistribute it and/or The LZO library is free software; you can redistribute it and/or
...@@ -32,15 +32,25 @@ ...@@ -32,15 +32,25 @@
*/ */
#ifndef __MINILZO_H #ifndef __MINILZO_H_INCLUDED
#define __MINILZO_H 1 #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" # error "you cannot use both LZO and miniLZO"
#endif #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 #undef LZO_HAVE_CONFIG_H
#include "lzoconf.h" #include "lzoconf.h"
...@@ -92,3 +102,5 @@ lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, ...@@ -92,3 +102,5 @@ lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
#endif /* already included */ #endif /* already included */
/* vim:set ts=4 sw=4 et: */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment