From c8c00d0199d1920d16cfbe963c07b21e4b12c61642a4dc980e9b9f6c6d999936 Mon Sep 17 00:00:00 2001 From: Kurt Garloff Date: Thu, 29 Dec 2016 16:19:32 +0000 Subject: [PATCH] Accepting request 447483 from home:marxin:branches:Base:System Fix undefined shift behavior done in HTONL macro. OBS-URL: https://build.opensuse.org/request/show/447483 OBS-URL: https://build.opensuse.org/package/show/Base:System/dd_rescue?expand=0&rev=30 --- dd_rescue.changes | 5 +++++ dd_rescue.spec | 3 +++ gcc7-fix-htonl.patch | 14 ++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 gcc7-fix-htonl.patch diff --git a/dd_rescue.changes b/dd_rescue.changes index c72151e..73ad1da 100644 --- a/dd_rescue.changes +++ b/dd_rescue.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Dec 23 09:26:20 UTC 2016 - mliska@suse.cz + +- Add gcc7-fix-htonl.patch patch. + ------------------------------------------------------------------- Fri Dec 9 11:56:45 UTC 2016 - mliska@suse.cz diff --git a/dd_rescue.spec b/dd_rescue.spec index 330df10..7526feb 100644 --- a/dd_rescue.spec +++ b/dd_rescue.spec @@ -30,6 +30,8 @@ Source99: %{name}.changes # PATCH-FIX-OPENSUSE gcc7-static-inline.patch - Add 'static' to inlined fns Patch1: gcc7-static-inline.patch +# PATCH-FIX-OPENSUSE gcc7-fix-htonl.patch - Fix HTONL macro +Patch2: gcc7-fix-htonl.patch BuildRequires: autoconf BuildRequires: libattr-devel BuildRequires: lzo-devel @@ -119,6 +121,7 @@ data to the decompressor; the plugin is still young and might expose bugs. %prep %setup -q %patch1 +%patch2 ./autogen.sh # Remove build time references so build-compare can do its work diff --git a/gcc7-fix-htonl.patch b/gcc7-fix-htonl.patch new file mode 100644 index 0000000..96f749d --- /dev/null +++ b/gcc7-fix-htonl.patch @@ -0,0 +1,14 @@ +--- libddr_lzo.c 2015-04-15 22:44:15.000000000 +0200 ++++ libddr_lzo.c 2016-12-23 10:20:40.268227806 +0100 +@@ -784,7 +784,10 @@ + #if __BYTE_ORDER == __BIG_ENDIAN + #define HTONL(x) x + #else +-#define HTONL(x) ((x<<24)&0xff000000) | ((x<<8)&0x00ff0000) | ((x>>8)&0x0000ff00) | ((x>>24)&0x000000ff) ++#define HTONL(n) (((((n) & 0xFF)) << 24) | \ ++ ((((n) & 0xFF00)) << 8) | \ ++ ((((n) & 0xFF0000)) >> 8) | \ ++ ((((n) & 0xFF000000)) >> 24)) + #endif + + unsigned char* lzo_search_hdr(fstate_t *fst, unsigned char* bf, int *towr,