From 02f5ee01c96589fc13f1e21b85b0b48100aec4e8 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 26 Mar 2020 15:06:23 +0100 Subject: gnu: libffi: Fix building on powerpc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/libffi.scm (libffi)[inputs]: New field. [arguments]: Add 'apply-patch' phase when targeting PowerPC. * gnu/packages/patches/libffi-3.3-powerpc-fixes.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Co-authored-by: Ludovic Courtès --- gnu/local.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 72f81a9913..105e4dd28c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1194,6 +1194,7 @@ dist_patch_DATA = \ %D%/packages/patches/jsoncpp-fix-inverted-case.patch \ %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \ + %D%/packages/patches/libffi-3.3-powerpc-fixes.patch \ %D%/packages/patches/libvirt-create-machine-cgroup.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ %D%/packages/patches/localed-xorg-keyboard.patch \ -- cgit v1.2.3 From 74361d3ee8c1524ee3f3496f113b9a8bf644e023 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 10 Nov 2020 16:43:59 +0100 Subject: gnu: python2-pygobject@2: Shorten patch file name. The file would not be included in the tarball produced by "make dist" because its name was too long. * gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch: Rename to... * gnu/packages/patches/python2-pygobject-2-deprecation.patch: ... this. * gnu/packages/glib.scm (python2-pygobject-2)[source]: Adjust accordingly. * gnu/local.mk (dist_patch_DATA): Likewise. --- gnu/local.mk | 2 +- gnu/packages/glib.scm | 3 +- .../patches/python2-pygobject-2-deprecation.patch | 39 ++++++++++++++++++++++ ...on2-pygobject-2-gi-info-type-error-domain.patch | 39 ---------------------- 4 files changed, 41 insertions(+), 42 deletions(-) create mode 100644 gnu/packages/patches/python2-pygobject-2-deprecation.patch delete mode 100644 gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 105e4dd28c..9a8d6dd4d9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1524,7 +1524,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-paste-remove-timing-test.patch \ %D%/packages/patches/python-pycrypto-CVE-2013-7459.patch \ %D%/packages/patches/python-pycrypto-time-clock.patch \ - %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ + %D%/packages/patches/python2-pygobject-2-deprecation.patch \ %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \ %D%/packages/patches/python-robotframework-source-date-epoch.patch \ %D%/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch \ diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index bba9461d44..901222476a 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -698,8 +698,7 @@ (define-public python2-pygobject-2 (sha256 (base32 "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv")) - (patches (search-patches - "python2-pygobject-2-gi-info-type-error-domain.patch")))) + (patches (search-patches "python2-pygobject-2-deprecation.patch")))) (build-system gnu-build-system) (native-inputs `(("which" ,which) diff --git a/gnu/packages/patches/python2-pygobject-2-deprecation.patch b/gnu/packages/patches/python2-pygobject-2-deprecation.patch new file mode 100644 index 0000000000..6a08e56351 --- /dev/null +++ b/gnu/packages/patches/python2-pygobject-2-deprecation.patch @@ -0,0 +1,39 @@ +From e5df32ffbf37481dbb6a70c4d4e7b7b9778c5549 Mon Sep 17 00:00:00 2001 +From: "John (J5) Palmieri" +Date: Sat, 13 Aug 2011 04:13:28 -0400 +Subject: remove references to deprecated GI_INFO_TYPE_ERROR_DOMAIN + + +diff --git a/gi/pygi-info.c b/gi/pygi-info.c +index 8729e25..007b609 100644 +--- a/gi/pygi-info.c ++++ b/gi/pygi-info.c +@@ -165,9 +165,6 @@ _pygi_info_new (GIBaseInfo *info) + case GI_INFO_TYPE_CONSTANT: + type = &PyGIConstantInfo_Type; + break; +- case GI_INFO_TYPE_ERROR_DOMAIN: +- type = &PyGIErrorDomainInfo_Type; +- break; + case GI_INFO_TYPE_UNION: + type = &PyGIUnionInfo_Type; + break; +@@ -484,7 +481,6 @@ _pygi_g_type_info_size (GITypeInfo *type_info) + case GI_INFO_TYPE_INVALID: + case GI_INFO_TYPE_FUNCTION: + case GI_INFO_TYPE_CONSTANT: +- case GI_INFO_TYPE_ERROR_DOMAIN: + case GI_INFO_TYPE_VALUE: + case GI_INFO_TYPE_SIGNAL: + case GI_INFO_TYPE_PROPERTY: +@@ -863,7 +859,6 @@ pygi_g_struct_info_is_simple (GIStructInfo *struct_info) + case GI_INFO_TYPE_INVALID: + case GI_INFO_TYPE_FUNCTION: + case GI_INFO_TYPE_CONSTANT: +- case GI_INFO_TYPE_ERROR_DOMAIN: + case GI_INFO_TYPE_VALUE: + case GI_INFO_TYPE_SIGNAL: + case GI_INFO_TYPE_PROPERTY: +-- +cgit v0.10.1 + diff --git a/gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch b/gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch deleted file mode 100644 index 6a08e56351..0000000000 --- a/gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e5df32ffbf37481dbb6a70c4d4e7b7b9778c5549 Mon Sep 17 00:00:00 2001 -From: "John (J5) Palmieri" -Date: Sat, 13 Aug 2011 04:13:28 -0400 -Subject: remove references to deprecated GI_INFO_TYPE_ERROR_DOMAIN - - -diff --git a/gi/pygi-info.c b/gi/pygi-info.c -index 8729e25..007b609 100644 ---- a/gi/pygi-info.c -+++ b/gi/pygi-info.c -@@ -165,9 +165,6 @@ _pygi_info_new (GIBaseInfo *info) - case GI_INFO_TYPE_CONSTANT: - type = &PyGIConstantInfo_Type; - break; -- case GI_INFO_TYPE_ERROR_DOMAIN: -- type = &PyGIErrorDomainInfo_Type; -- break; - case GI_INFO_TYPE_UNION: - type = &PyGIUnionInfo_Type; - break; -@@ -484,7 +481,6 @@ _pygi_g_type_info_size (GITypeInfo *type_info) - case GI_INFO_TYPE_INVALID: - case GI_INFO_TYPE_FUNCTION: - case GI_INFO_TYPE_CONSTANT: -- case GI_INFO_TYPE_ERROR_DOMAIN: - case GI_INFO_TYPE_VALUE: - case GI_INFO_TYPE_SIGNAL: - case GI_INFO_TYPE_PROPERTY: -@@ -863,7 +859,6 @@ pygi_g_struct_info_is_simple (GIStructInfo *struct_info) - case GI_INFO_TYPE_INVALID: - case GI_INFO_TYPE_FUNCTION: - case GI_INFO_TYPE_CONSTANT: -- case GI_INFO_TYPE_ERROR_DOMAIN: - case GI_INFO_TYPE_VALUE: - case GI_INFO_TYPE_SIGNAL: - case GI_INFO_TYPE_PROPERTY: --- -cgit v0.10.1 - -- cgit v1.2.3 From 8515ea12d283632e7d0103286e679542d896058b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 10 Nov 2020 17:49:14 +0100 Subject: gnu: audiofile: Shorten patch file names. At least 'audiofile-division-by-zero-BlockCodec-runPull.patch' could end up not being included in a tarball. * gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch: Rename to... * gnu/packages/patches/audiofile-check-number-of-coefficients.patch: ... this. * gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch: Rename to... * gnu/packages/patches/audiofile-division-by-zero.patch: ....this. * gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch: Rename to... * gnu/packages/patches/audiofile-function-signature.patch: ... this. * gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch: Rename to.... * gnu/packages/patches/audiofile-multiply-overflow.patch: ... this. * gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch: Rename to... * gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch: ... this. * gnu/packages/audio.scm (audiofile)[source]: Adjust accordingly. * gnu/local.mk (dist_patch_DATA): Likewise. --- gnu/local.mk | 12 +-- gnu/packages/audio.scm | 10 +- ...udiofile-Check-the-number-of-coefficients.patch | 30 ------ ...audiofile-Fix-multiply-overflow-sfconvert.patch | 66 ------------ ...diofile-Fix-overflow-in-MSADPCM-decodeSam.patch | 116 --------------------- .../audiofile-check-number-of-coefficients.patch | 30 ++++++ ...ofile-division-by-zero-BlockCodec-runPull.patch | 21 ---- .../patches/audiofile-division-by-zero.patch | 21 ++++ .../patches/audiofile-function-signature.patch | 35 +++++++ .../patches/audiofile-multiply-overflow.patch | 66 ++++++++++++ .../patches/audiofile-overflow-in-MSADPCM.patch | 116 +++++++++++++++++++++ ...iofile-signature-of-multiplyCheckOverflow.patch | 35 ------- 12 files changed, 279 insertions(+), 279 deletions(-) delete mode 100644 gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch delete mode 100644 gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch delete mode 100644 gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch create mode 100644 gnu/packages/patches/audiofile-check-number-of-coefficients.patch delete mode 100644 gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch create mode 100644 gnu/packages/patches/audiofile-division-by-zero.patch create mode 100644 gnu/packages/patches/audiofile-function-signature.patch create mode 100644 gnu/packages/patches/audiofile-multiply-overflow.patch create mode 100644 gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch delete mode 100644 gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 9a8d6dd4d9..d5a13cbdbd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -800,14 +800,14 @@ dist_patch_DATA = \ %D%/packages/patches/audiofile-CVE-2015-7747.patch \ %D%/packages/patches/audiofile-CVE-2018-13440.patch \ %D%/packages/patches/audiofile-CVE-2018-17095.patch \ - %D%/packages/patches/audiofile-Check-the-number-of-coefficients.patch \ + %D%/packages/patches/audiofile-check-number-of-coefficients.patch \ %D%/packages/patches/audiofile-Fail-on-error-in-parseFormat.patch \ %D%/packages/patches/audiofile-Fix-index-overflow-in-IMA.cpp.patch \ - %D%/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch \ - %D%/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch \ - %D%/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch \ - %D%/packages/patches/audiofile-hurd.patch \ - %D%/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch \ + %D%/packages/patches/audiofile-multiply-overflow.patch \ + %D%/packages/patches/audiofile-overflow-in-MSADPCM.patch \ + %D%/packages/patches/audiofile-division-by-zero.patch \ + %D%/packages/patches/audiofile-hurd.patch \ + %D%/packages/patches/audiofile-function-signature.patch \ %D%/packages/patches/automake-skip-amhello-tests.patch \ %D%/packages/patches/avahi-localstatedir.patch \ %D%/packages/patches/avogadro-boost148.patch \ diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index 6479398cb5..6733c8d212 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -862,16 +862,16 @@ (define-public audiofile "audiofile-Fix-index-overflow-in-IMA.cpp.patch" ;; CVE-2017-6827, CVE-2017-6828, CVE-2017-6832, CVE-2017-6835, ;; CVE-2017-6837: - "audiofile-Check-the-number-of-coefficients.patch" + "audiofile-check-number-of-coefficients.patch" ;; CVE-2017-6839: - "audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch" + "audiofile-overflow-in-MSADPCM.patch" ;; CVE-2017-6830, CVE-2017-6834, CVE-2017-6836, CVE-2017-6838: - "audiofile-Fix-multiply-overflow-sfconvert.patch" - "audiofile-signature-of-multiplyCheckOverflow.patch" + "audiofile-multiply-overflow.patch" + "audiofile-function-signature.patch" ;; CVE-2017-6831: "audiofile-Fail-on-error-in-parseFormat.patch" ;; CVE-2017-6833: - "audiofile-division-by-zero-BlockCodec-runPull.patch" + "audiofile-division-by-zero.patch" "audiofile-CVE-2018-13440.patch" "audiofile-CVE-2018-17095.patch")))) (properties `((lint-hidden-cve . ("CVE-2017-6829" diff --git a/gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch b/gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch deleted file mode 100644 index f9427cbe61..0000000000 --- a/gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Antonio Larrosa -Date: Mon, 6 Mar 2017 12:51:22 +0100 -Subject: Always check the number of coefficients - -When building the library with NDEBUG, asserts are eliminated -so it's better to always check that the number of coefficients -is inside the array range. - -This fixes the 00191-audiofile-indexoob issue in #41 ---- - libaudiofile/WAVE.cpp | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp -index 9dd8511..0fc48e8 100644 ---- a/libaudiofile/WAVE.cpp -+++ b/libaudiofile/WAVE.cpp -@@ -281,6 +281,12 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size) - - /* numCoefficients should be at least 7. */ - assert(numCoefficients >= 7 && numCoefficients <= 255); -+ if (numCoefficients < 7 || numCoefficients > 255) -+ { -+ _af_error(AF_BAD_HEADER, -+ "Bad number of coefficients"); -+ return AF_FAIL; -+ } - - m_msadpcmNumCoefficients = numCoefficients; - diff --git a/gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch b/gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch deleted file mode 100644 index 0f17140d6b..0000000000 --- a/gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch +++ /dev/null @@ -1,66 +0,0 @@ -From: Antonio Larrosa -Date: Mon, 6 Mar 2017 13:54:52 +0100 -Subject: Check for multiplication overflow in sfconvert - -Checks that a multiplication doesn't overflow when -calculating the buffer size, and if it overflows, -reduce the buffer size instead of failing. - -This fixes the 00192-audiofile-signintoverflow-sfconvert case -in #41 ---- - sfcommands/sfconvert.c | 34 ++++++++++++++++++++++++++++++++-- - 1 file changed, 32 insertions(+), 2 deletions(-) - -diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c -index 80a1bc4..970a3e4 100644 ---- a/sfcommands/sfconvert.c -+++ b/sfcommands/sfconvert.c -@@ -45,6 +45,33 @@ void printusage (void); - void usageerror (void); - bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid); - -+int firstBitSet(int x) -+{ -+ int position=0; -+ while (x!=0) -+ { -+ x>>=1; -+ ++position; -+ } -+ return position; -+} -+ -+#ifndef __has_builtin -+#define __has_builtin(x) 0 -+#endif -+ -+int multiplyCheckOverflow(int a, int b, int *result) -+{ -+#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) -+ return __builtin_mul_overflow(a, b, result); -+#else -+ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits -+ return true; -+ *result = a * b; -+ return false; -+#endif -+} -+ - int main (int argc, char **argv) - { - if (argc == 2) -@@ -323,8 +350,11 @@ bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid) - { - int frameSize = afGetVirtualFrameSize(infile, trackid, 1); - -- const int kBufferFrameCount = 65536; -- void *buffer = malloc(kBufferFrameCount * frameSize); -+ int kBufferFrameCount = 65536; -+ int bufferSize; -+ while (multiplyCheckOverflow(kBufferFrameCount, frameSize, &bufferSize)) -+ kBufferFrameCount /= 2; -+ void *buffer = malloc(bufferSize); - - AFframecount totalFrames = afGetFrameCount(infile, AF_DEFAULT_TRACK); - AFframecount totalFramesWritten = 0; diff --git a/gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch b/gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch deleted file mode 100644 index 2be930b924..0000000000 --- a/gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch +++ /dev/null @@ -1,116 +0,0 @@ -From: Antonio Larrosa -Date: Mon, 6 Mar 2017 13:43:53 +0100 -Subject: Check for multiplication overflow in MSADPCM decodeSample - -Check for multiplication overflow (using __builtin_mul_overflow -if available) in MSADPCM.cpp decodeSample and return an empty -decoded block if an error occurs. - -This fixes the 00193-audiofile-signintoverflow-MSADPCM case of #41 ---- - libaudiofile/modules/BlockCodec.cpp | 5 ++-- - libaudiofile/modules/MSADPCM.cpp | 47 +++++++++++++++++++++++++++++++++---- - 2 files changed, 46 insertions(+), 6 deletions(-) - -diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp -index 45925e8..4731be1 100644 ---- a/libaudiofile/modules/BlockCodec.cpp -+++ b/libaudiofile/modules/BlockCodec.cpp -@@ -52,8 +52,9 @@ void BlockCodec::runPull() - // Decompress into m_outChunk. - for (int i=0; i(m_inChunk->buffer) + i * m_bytesPerPacket, -- static_cast(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount); -+ if (decodeBlock(static_cast(m_inChunk->buffer) + i * m_bytesPerPacket, -+ static_cast(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount)==0) -+ break; - - framesRead += m_framesPerPacket; - } -diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp -index 8ea3c85..ef9c38c 100644 ---- a/libaudiofile/modules/MSADPCM.cpp -+++ b/libaudiofile/modules/MSADPCM.cpp -@@ -101,24 +101,60 @@ static const int16_t adaptationTable[] = - 768, 614, 512, 409, 307, 230, 230, 230 - }; - -+int firstBitSet(int x) -+{ -+ int position=0; -+ while (x!=0) -+ { -+ x>>=1; -+ ++position; -+ } -+ return position; -+} -+ -+#ifndef __has_builtin -+#define __has_builtin(x) 0 -+#endif -+ -+int multiplyCheckOverflow(int a, int b, int *result) -+{ -+#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) -+ return __builtin_mul_overflow(a, b, result); -+#else -+ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits -+ return true; -+ *result = a * b; -+ return false; -+#endif -+} -+ -+ - // Compute a linear PCM value from the given differential coded value. - static int16_t decodeSample(ms_adpcm_state &state, -- uint8_t code, const int16_t *coefficient) -+ uint8_t code, const int16_t *coefficient, bool *ok=NULL) - { - int linearSample = (state.sample1 * coefficient[0] + - state.sample2 * coefficient[1]) >> 8; -+ int delta; - - linearSample += ((code & 0x08) ? (code - 0x10) : code) * state.delta; - - linearSample = clamp(linearSample, MIN_INT16, MAX_INT16); - -- int delta = (state.delta * adaptationTable[code]) >> 8; -+ if (multiplyCheckOverflow(state.delta, adaptationTable[code], &delta)) -+ { -+ if (ok) *ok=false; -+ _af_error(AF_BAD_COMPRESSION, "Error decoding sample"); -+ return 0; -+ } -+ delta >>= 8; - if (delta < 16) - delta = 16; - - state.delta = delta; - state.sample2 = state.sample1; - state.sample1 = linearSample; -+ if (ok) *ok=true; - - return static_cast(linearSample); - } -@@ -212,13 +248,16 @@ int MSADPCM::decodeBlock(const uint8_t *encoded, int16_t *decoded) - { - uint8_t code; - int16_t newSample; -+ bool ok; - - code = *encoded >> 4; -- newSample = decodeSample(*state[0], code, coefficient[0]); -+ newSample = decodeSample(*state[0], code, coefficient[0], &ok); -+ if (!ok) return 0; - *decoded++ = newSample; - - code = *encoded & 0x0f; -- newSample = decodeSample(*state[1], code, coefficient[1]); -+ newSample = decodeSample(*state[1], code, coefficient[1], &ok); -+ if (!ok) return 0; - *decoded++ = newSample; - - encoded++; diff --git a/gnu/packages/patches/audiofile-check-number-of-coefficients.patch b/gnu/packages/patches/audiofile-check-number-of-coefficients.patch new file mode 100644 index 0000000000..f9427cbe61 --- /dev/null +++ b/gnu/packages/patches/audiofile-check-number-of-coefficients.patch @@ -0,0 +1,30 @@ +From: Antonio Larrosa +Date: Mon, 6 Mar 2017 12:51:22 +0100 +Subject: Always check the number of coefficients + +When building the library with NDEBUG, asserts are eliminated +so it's better to always check that the number of coefficients +is inside the array range. + +This fixes the 00191-audiofile-indexoob issue in #41 +--- + libaudiofile/WAVE.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp +index 9dd8511..0fc48e8 100644 +--- a/libaudiofile/WAVE.cpp ++++ b/libaudiofile/WAVE.cpp +@@ -281,6 +281,12 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size) + + /* numCoefficients should be at least 7. */ + assert(numCoefficients >= 7 && numCoefficients <= 255); ++ if (numCoefficients < 7 || numCoefficients > 255) ++ { ++ _af_error(AF_BAD_HEADER, ++ "Bad number of coefficients"); ++ return AF_FAIL; ++ } + + m_msadpcmNumCoefficients = numCoefficients; + diff --git a/gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch b/gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch deleted file mode 100644 index e001133916..0000000000 --- a/gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Antonio Larrosa -Date: Thu, 9 Mar 2017 10:21:18 +0100 -Subject: Check for division by zero in BlockCodec::runPull - ---- - libaudiofile/modules/BlockCodec.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp -index 4731be1..eb2fb4d 100644 ---- a/libaudiofile/modules/BlockCodec.cpp -+++ b/libaudiofile/modules/BlockCodec.cpp -@@ -47,7 +47,7 @@ void BlockCodec::runPull() - - // Read the compressed data. - ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount); -- int blocksRead = bytesRead >= 0 ? bytesRead / m_bytesPerPacket : 0; -+ int blocksRead = (bytesRead >= 0 && m_bytesPerPacket > 0) ? bytesRead / m_bytesPerPacket : 0; - - // Decompress into m_outChunk. - for (int i=0; i +Date: Thu, 9 Mar 2017 10:21:18 +0100 +Subject: Check for division by zero in BlockCodec::runPull + +--- + libaudiofile/modules/BlockCodec.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp +index 4731be1..eb2fb4d 100644 +--- a/libaudiofile/modules/BlockCodec.cpp ++++ b/libaudiofile/modules/BlockCodec.cpp +@@ -47,7 +47,7 @@ void BlockCodec::runPull() + + // Read the compressed data. + ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount); +- int blocksRead = bytesRead >= 0 ? bytesRead / m_bytesPerPacket : 0; ++ int blocksRead = (bytesRead >= 0 && m_bytesPerPacket > 0) ? bytesRead / m_bytesPerPacket : 0; + + // Decompress into m_outChunk. + for (int i=0; i +Date: Fri, 10 Mar 2017 15:40:02 +0100 +Subject: Fix signature of multiplyCheckOverflow. It returns a bool, not an int + +--- + libaudiofile/modules/MSADPCM.cpp | 2 +- + sfcommands/sfconvert.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp +index ef9c38c..d8c9553 100644 +--- a/libaudiofile/modules/MSADPCM.cpp ++++ b/libaudiofile/modules/MSADPCM.cpp +@@ -116,7 +116,7 @@ int firstBitSet(int x) + #define __has_builtin(x) 0 + #endif + +-int multiplyCheckOverflow(int a, int b, int *result) ++bool multiplyCheckOverflow(int a, int b, int *result) + { + #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) + return __builtin_mul_overflow(a, b, result); +diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c +index 970a3e4..367f7a5 100644 +--- a/sfcommands/sfconvert.c ++++ b/sfcommands/sfconvert.c +@@ -60,7 +60,7 @@ int firstBitSet(int x) + #define __has_builtin(x) 0 + #endif + +-int multiplyCheckOverflow(int a, int b, int *result) ++bool multiplyCheckOverflow(int a, int b, int *result) + { + #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) + return __builtin_mul_overflow(a, b, result); diff --git a/gnu/packages/patches/audiofile-multiply-overflow.patch b/gnu/packages/patches/audiofile-multiply-overflow.patch new file mode 100644 index 0000000000..0f17140d6b --- /dev/null +++ b/gnu/packages/patches/audiofile-multiply-overflow.patch @@ -0,0 +1,66 @@ +From: Antonio Larrosa +Date: Mon, 6 Mar 2017 13:54:52 +0100 +Subject: Check for multiplication overflow in sfconvert + +Checks that a multiplication doesn't overflow when +calculating the buffer size, and if it overflows, +reduce the buffer size instead of failing. + +This fixes the 00192-audiofile-signintoverflow-sfconvert case +in #41 +--- + sfcommands/sfconvert.c | 34 ++++++++++++++++++++++++++++++++-- + 1 file changed, 32 insertions(+), 2 deletions(-) + +diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c +index 80a1bc4..970a3e4 100644 +--- a/sfcommands/sfconvert.c ++++ b/sfcommands/sfconvert.c +@@ -45,6 +45,33 @@ void printusage (void); + void usageerror (void); + bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid); + ++int firstBitSet(int x) ++{ ++ int position=0; ++ while (x!=0) ++ { ++ x>>=1; ++ ++position; ++ } ++ return position; ++} ++ ++#ifndef __has_builtin ++#define __has_builtin(x) 0 ++#endif ++ ++int multiplyCheckOverflow(int a, int b, int *result) ++{ ++#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) ++ return __builtin_mul_overflow(a, b, result); ++#else ++ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits ++ return true; ++ *result = a * b; ++ return false; ++#endif ++} ++ + int main (int argc, char **argv) + { + if (argc == 2) +@@ -323,8 +350,11 @@ bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid) + { + int frameSize = afGetVirtualFrameSize(infile, trackid, 1); + +- const int kBufferFrameCount = 65536; +- void *buffer = malloc(kBufferFrameCount * frameSize); ++ int kBufferFrameCount = 65536; ++ int bufferSize; ++ while (multiplyCheckOverflow(kBufferFrameCount, frameSize, &bufferSize)) ++ kBufferFrameCount /= 2; ++ void *buffer = malloc(bufferSize); + + AFframecount totalFrames = afGetFrameCount(infile, AF_DEFAULT_TRACK); + AFframecount totalFramesWritten = 0; diff --git a/gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch b/gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch new file mode 100644 index 0000000000..2be930b924 --- /dev/null +++ b/gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch @@ -0,0 +1,116 @@ +From: Antonio Larrosa +Date: Mon, 6 Mar 2017 13:43:53 +0100 +Subject: Check for multiplication overflow in MSADPCM decodeSample + +Check for multiplication overflow (using __builtin_mul_overflow +if available) in MSADPCM.cpp decodeSample and return an empty +decoded block if an error occurs. + +This fixes the 00193-audiofile-signintoverflow-MSADPCM case of #41 +--- + libaudiofile/modules/BlockCodec.cpp | 5 ++-- + libaudiofile/modules/MSADPCM.cpp | 47 +++++++++++++++++++++++++++++++++---- + 2 files changed, 46 insertions(+), 6 deletions(-) + +diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp +index 45925e8..4731be1 100644 +--- a/libaudiofile/modules/BlockCodec.cpp ++++ b/libaudiofile/modules/BlockCodec.cpp +@@ -52,8 +52,9 @@ void BlockCodec::runPull() + // Decompress into m_outChunk. + for (int i=0; i(m_inChunk->buffer) + i * m_bytesPerPacket, +- static_cast(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount); ++ if (decodeBlock(static_cast(m_inChunk->buffer) + i * m_bytesPerPacket, ++ static_cast(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount)==0) ++ break; + + framesRead += m_framesPerPacket; + } +diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp +index 8ea3c85..ef9c38c 100644 +--- a/libaudiofile/modules/MSADPCM.cpp ++++ b/libaudiofile/modules/MSADPCM.cpp +@@ -101,24 +101,60 @@ static const int16_t adaptationTable[] = + 768, 614, 512, 409, 307, 230, 230, 230 + }; + ++int firstBitSet(int x) ++{ ++ int position=0; ++ while (x!=0) ++ { ++ x>>=1; ++ ++position; ++ } ++ return position; ++} ++ ++#ifndef __has_builtin ++#define __has_builtin(x) 0 ++#endif ++ ++int multiplyCheckOverflow(int a, int b, int *result) ++{ ++#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) ++ return __builtin_mul_overflow(a, b, result); ++#else ++ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits ++ return true; ++ *result = a * b; ++ return false; ++#endif ++} ++ ++ + // Compute a linear PCM value from the given differential coded value. + static int16_t decodeSample(ms_adpcm_state &state, +- uint8_t code, const int16_t *coefficient) ++ uint8_t code, const int16_t *coefficient, bool *ok=NULL) + { + int linearSample = (state.sample1 * coefficient[0] + + state.sample2 * coefficient[1]) >> 8; ++ int delta; + + linearSample += ((code & 0x08) ? (code - 0x10) : code) * state.delta; + + linearSample = clamp(linearSample, MIN_INT16, MAX_INT16); + +- int delta = (state.delta * adaptationTable[code]) >> 8; ++ if (multiplyCheckOverflow(state.delta, adaptationTable[code], &delta)) ++ { ++ if (ok) *ok=false; ++ _af_error(AF_BAD_COMPRESSION, "Error decoding sample"); ++ return 0; ++ } ++ delta >>= 8; + if (delta < 16) + delta = 16; + + state.delta = delta; + state.sample2 = state.sample1; + state.sample1 = linearSample; ++ if (ok) *ok=true; + + return static_cast(linearSample); + } +@@ -212,13 +248,16 @@ int MSADPCM::decodeBlock(const uint8_t *encoded, int16_t *decoded) + { + uint8_t code; + int16_t newSample; ++ bool ok; + + code = *encoded >> 4; +- newSample = decodeSample(*state[0], code, coefficient[0]); ++ newSample = decodeSample(*state[0], code, coefficient[0], &ok); ++ if (!ok) return 0; + *decoded++ = newSample; + + code = *encoded & 0x0f; +- newSample = decodeSample(*state[1], code, coefficient[1]); ++ newSample = decodeSample(*state[1], code, coefficient[1], &ok); ++ if (!ok) return 0; + *decoded++ = newSample; + + encoded++; diff --git a/gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch b/gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch deleted file mode 100644 index 35627d3869..0000000000 --- a/gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Antonio Larrosa -Date: Fri, 10 Mar 2017 15:40:02 +0100 -Subject: Fix signature of multiplyCheckOverflow. It returns a bool, not an int - ---- - libaudiofile/modules/MSADPCM.cpp | 2 +- - sfcommands/sfconvert.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp -index ef9c38c..d8c9553 100644 ---- a/libaudiofile/modules/MSADPCM.cpp -+++ b/libaudiofile/modules/MSADPCM.cpp -@@ -116,7 +116,7 @@ int firstBitSet(int x) - #define __has_builtin(x) 0 - #endif - --int multiplyCheckOverflow(int a, int b, int *result) -+bool multiplyCheckOverflow(int a, int b, int *result) - { - #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) - return __builtin_mul_overflow(a, b, result); -diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c -index 970a3e4..367f7a5 100644 ---- a/sfcommands/sfconvert.c -+++ b/sfcommands/sfconvert.c -@@ -60,7 +60,7 @@ int firstBitSet(int x) - #define __has_builtin(x) 0 - #endif - --int multiplyCheckOverflow(int a, int b, int *result) -+bool multiplyCheckOverflow(int a, int b, int *result) - { - #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) - return __builtin_mul_overflow(a, b, result); -- cgit v1.2.3 From 29cf85b85793724aa0f1de2b5cda7f70cdb1752f Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Tue, 10 Nov 2020 16:10:17 +0100 Subject: gnu: oath-toolkit: Update to 2.6.3. * gnu/packages/authentication.scm (oath-toolkit): Update to 2.6.3. [source]: Remove obsolete patches. * gnu/packages/patches/oath-toolkit-glibc-compat.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. Signed-off-by: Leo Famulari --- gnu/local.mk | 1 - gnu/packages/authentication.scm | 16 +--- .../patches/oath-toolkit-glibc-compat.patch | 90 ---------------------- 3 files changed, 2 insertions(+), 105 deletions(-) delete mode 100644 gnu/packages/patches/oath-toolkit-glibc-compat.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 288784b427..c2b2143213 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1387,7 +1387,6 @@ dist_patch_DATA = \ %D%/packages/patches/nvi-dbpagesize-binpower.patch \ %D%/packages/patches/nvi-db4.patch \ %D%/packages/patches/nyacc-binary-literals.patch \ - %D%/packages/patches/oath-toolkit-glibc-compat.patch \ %D%/packages/patches/ocaml-bitstring-fix-configure.patch \ %D%/packages/patches/ocaml-CVE-2015-8869.patch \ %D%/packages/patches/ocaml-Add-a-.file-directive.patch \ diff --git a/gnu/packages/authentication.scm b/gnu/packages/authentication.scm index b3ff912c8f..52ab445775 100644 --- a/gnu/packages/authentication.scm +++ b/gnu/packages/authentication.scm @@ -33,26 +33,14 @@ (define-module (gnu packages authentication) (define-public oath-toolkit (package (name "oath-toolkit") - (version "2.6.2") + (version "2.6.3") (source (origin (method url-fetch) (uri (string-append "https://download.savannah.nongnu.org/releases/" name "/" name "-" version ".tar.gz")) - (patches - (append (search-patches "oath-toolkit-glibc-compat.patch") - (list (origin - ;; This huge commit updates gnulib for GCC 7 compatibility. - (method url-fetch) - (uri (string-append - "https://gitlab.com/oath-toolkit/oath-toolkit/commit/" - "2fffce2a471f74a585939c84cce16ef3015e5d3d.diff")) - (file-name "oath-toolkit-update-gnulib.patch") - (sha256 - (base32 - "088c9s4ay1b54bjqc4mwfs5l3f6357zj5vpw771zlq5g4addd4s0")))))) (sha256 - (base32 "182ah8vfbg0yhv6mh1b6ap944d0na6x7lpfkwkmzb6jl9gx4cd5h")))) + (base32 "1cjial8njck2sd7452jcxspbi5h5fnp3n8v3wbmlw8fzqmgzvxx1")))) (build-system gnu-build-system) (arguments ;; TODO ‘--enable-pskc’ causes xmlsec-related test suite failures. diff --git a/gnu/packages/patches/oath-toolkit-glibc-compat.patch b/gnu/packages/patches/oath-toolkit-glibc-compat.patch deleted file mode 100644 index 22814599e5..0000000000 --- a/gnu/packages/patches/oath-toolkit-glibc-compat.patch +++ /dev/null @@ -1,90 +0,0 @@ -Adjust the bundled Gnulib to cope with removal of libio interface in Glibc 2.28. - -Based on this upstream gnulib patch: -https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a71827c0bc5e0ec67af23edef4f15cee8e - ---- a/liboath/gl/fflush.c -+++ b/liboath/gl/fflush.c -@@ -33,7 +33,7 @@ - #undef fflush - - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ - static void -@@ -72,7 +72,7 @@ - - #endif - --#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) -+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) - - # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ -@@ -148,7 +148,7 @@ - if (stream == NULL || ! freading (stream)) - return fflush (stream); - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - clear_ungetc_buffer_preserving_position (stream); - ---- a/liboath/gl/fpurge.c -+++ b/liboath/gl/fpurge.c -@@ -62,7 +62,7 @@ - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_IO_read_end = fp->_IO_read_ptr; - fp->_IO_write_ptr = fp->_IO_write_base; - /* Avoid memory leak when there is an active ungetc buffer. */ ---- a/libaoth/gl/freading.c -+++ b/liboath/gl/freading.c -@@ -31,7 +31,7 @@ - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return ((fp->_flags & _IO_NO_WRITES) != 0 - || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 - && fp->_IO_read_base != NULL)); ---- a/liboath/gl/fseeko.c -+++ b/liboath/gl/fseeko.c -@@ -47,7 +47,7 @@ - #endif - - /* These tests are based on fpurge.c. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_read_end == fp->_IO_read_ptr - && fp->_IO_write_ptr == fp->_IO_write_base - && fp->_IO_save_base == NULL) -@@ -123,7 +123,7 @@ - return -1; - } - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_flags &= ~_IO_EOF_SEEN; - fp->_offset = pos; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ ---- a/liboath/gl/stdio-impl.h -+++ b/liboath/gl/stdio-impl.h -@@ -18,6 +18,11 @@ - the same implementation of stdio extension API, except that some fields - have different naming conventions, or their access requires some casts. */ - -+/* Glibc 2.28 made _IO_IN_BACKUP private, so define it here for now. */ -+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN -+# define _IO_IN_BACKUP 0x100 -+#endif -+ - /* BSD stdio derived implementations. */ - - #if defined __NetBSD__ /* NetBSD */ -- cgit v1.2.3 From 2c560aa217284c3152378e5c79f0519d78cba226 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sat, 14 Nov 2020 15:47:00 +0100 Subject: gnu: perl-www-curl: Fix build with curl@7.69.1. * gnu/packages/web.scm (perl-www-curl)[source]: Add perl-www-curl-fix-struct-void.patch. * gnu/packages/patches/perl-www-curl-remove-symbol.patch: Update. * gnu/packages/patches/perl-www-curl-fix-struct-void.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + .../patches/perl-www-curl-fix-struct-void.patch | 24 +++++++++++++++++++++ .../patches/perl-www-curl-remove-symbol.patch | Bin 1177 -> 984 bytes gnu/packages/web.scm | 4 ++-- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/perl-www-curl-fix-struct-void.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index b5f9c56324..6a0f378bb0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1450,6 +1450,7 @@ dist_patch_DATA = \ %D%/packages/patches/perl-text-markdown-discount-unbundle.patch \ %D%/packages/patches/perl-module-pluggable-search.patch \ %D%/packages/patches/perl-reproducible-build-date.patch \ + %D%/packages/patches/perl-www-curl-fix-struct-void.patch \ %D%/packages/patches/perl-www-curl-remove-symbol.patch \ %D%/packages/patches/picard-fix-id3-rename-test.patch \ %D%/packages/patches/picprog-non-intel-support.patch \ diff --git a/gnu/packages/patches/perl-www-curl-fix-struct-void.patch b/gnu/packages/patches/perl-www-curl-fix-struct-void.patch new file mode 100644 index 0000000000..b150950668 --- /dev/null +++ b/gnu/packages/patches/perl-www-curl-fix-struct-void.patch @@ -0,0 +1,24 @@ +From: Tobias Geerinckx-Rice +Date: Sat, 14 Nov 2020 15:40:56 +0100 +Subject: [PATCH] gnu: perl-www-curl: Fix struct void* usage. + +Copied verbatim from Gentoo[0]. Fixes: + + Curl.xs:76:12: error: expected ‘{’ before ‘void’ + struct void *curlm; + ^~~~ + Curl.xs:76:12: error: two or more data types in declaration specifiers + +[0]: https://694466.bugs.gentoo.org/attachment.cgi?id=595098 + +--- WWW-Curl-4.17/Curl.xs 2014-02-21 18:08:30.000000000 +0200 ++++ WWW-Curl-4.17.new/Curl.xs 2019-11-05 21:44:55.434395739 +0200 +@@ -73,7 +73,7 @@ typedef struct { + #ifdef __CURL_MULTI_H + struct CURLM *curlm; + #else +- struct void *curlm; ++ void *curlm; + #endif + } perl_curl_multi; + diff --git a/gnu/packages/patches/perl-www-curl-remove-symbol.patch b/gnu/packages/patches/perl-www-curl-remove-symbol.patch index ae3486708b..c32a34897b 100644 Binary files a/gnu/packages/patches/perl-www-curl-remove-symbol.patch and b/gnu/packages/patches/perl-www-curl-remove-symbol.patch differ diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 0bfaa3b9d7..8947889cd7 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -4423,14 +4423,14 @@ (define-public perl-www-curl (uri (string-append "mirror://cpan/authors/id/S/SZ/SZBALINT/WWW-Curl-" version".tar.gz")) - (patches (search-patches "perl-www-curl-remove-symbol.patch")) + (patches (search-patches "perl-www-curl-fix-struct-void.patch" + "perl-www-curl-remove-symbol.patch")) (sha256 (base32 "1fmp9aib1kaps9vhs4dwxn7b15kgnlz9f714bxvqsd1j1q8spzsj")))) (build-system perl-build-system) (arguments '(#:tests? #f ;XXX: tests require network access - #:phases (modify-phases %standard-phases (add-before 'configure 'set-search-path (lambda _ -- cgit v1.2.3 From 80817b509855f2e4f473372fc546c3132fa57fe7 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 15 Nov 2020 00:02:18 +0100 Subject: gnu: multipath-tools: Update to 0.8.5. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/linux.scm (multipath-tools): Update to 0.8.5. [source]: Remove patch. [arguments]: Add a ‘skip-failing-tests’ phase. * gnu/packages/patches/multipath-tools-sans-systemd.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/linux.scm | 17 ++++- .../patches/multipath-tools-sans-systemd.patch | 83 ---------------------- 3 files changed, 14 insertions(+), 87 deletions(-) delete mode 100644 gnu/packages/patches/multipath-tools-sans-systemd.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 6a0f378bb0..91a3295e75 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1357,7 +1357,6 @@ dist_patch_DATA = \ %D%/packages/patches/mozjs38-version-detection.patch \ %D%/packages/patches/mrrescue-support-love-11.patch \ %D%/packages/patches/mtools-mformat-uninitialized.patch \ - %D%/packages/patches/multipath-tools-sans-systemd.patch \ %D%/packages/patches/mumps-build-parallelism.patch \ %D%/packages/patches/mumps-shared-libseq.patch \ %D%/packages/patches/mumps-shared-mumps.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 8abeb976af..39abf6e2ba 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -4430,7 +4430,7 @@ (define-public mdadm-static (define-public multipath-tools (package (name "multipath-tools") - (version "0.8.4") + (version "0.8.5") (source (origin (method git-fetch) (uri (git-reference @@ -4439,8 +4439,7 @@ (define-public multipath-tools (file-name (git-file-name name version)) (sha256 (base32 - "14n8pcgnliicqxzc40xvjxk4cafm4qx7a3rsx5qva74r3ydzx8rn")) - (patches (search-patches "multipath-tools-sans-systemd.patch")) + "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg")) (modules '((guix build utils))) (snippet '(begin @@ -4498,6 +4497,18 @@ (define-public multipath-tools (("-lmultipath -lcmocka") "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka")) #t)) + (add-after 'unpack 'skip-failing-tests + (lambda _ + ;; This test and the module's setup() test an arbitrary block + ;; device node name, but the build environment has none. + (substitute* "tests/devt.c" + (("return get_one_devt.*") "return 0;\n") + (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") "")) + ;; The above triggers -Werror=unused-function. Ignore it. + (substitute* "tests/Makefile" + (("CFLAGS \\+= " match) + (string-append match "-Wno-error=unused-function "))) + #t)) (delete 'configure)))) ; no configure script (native-inputs `(("perl" ,perl) diff --git a/gnu/packages/patches/multipath-tools-sans-systemd.patch b/gnu/packages/patches/multipath-tools-sans-systemd.patch deleted file mode 100644 index 8f3144718c..0000000000 --- a/gnu/packages/patches/multipath-tools-sans-systemd.patch +++ /dev/null @@ -1,83 +0,0 @@ -Fix various compiler warnings when built without systemd. - -Submitted upstream at . - -diff --git a/libmultipath/config.c b/libmultipath/config.c ---- a/libmultipath/config.c -+++ b/libmultipath/config.c -@@ -696,7 +696,7 @@ process_config_dir(struct config *conf, char *dir) - pthread_cleanup_pop(1); - } - --static void set_max_checkint_from_watchdog(struct config *conf) -+static void set_max_checkint_from_watchdog(__attribute__((unused)) struct config *conf) - { - #ifdef USE_SYSTEMD - char *envp = getenv("WATCHDOG_USEC"); -diff --git a/multipathd/main.c b/multipathd/main.c ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -176,6 +176,7 @@ daemon_status(void) - /* - * I love you too, systemd ... - */ -+#ifdef USE_SYSTEMD - static const char * - sd_notify_status(enum daemon_status state) - { -@@ -195,7 +196,6 @@ sd_notify_status(enum daemon_status state) - return NULL; - } - --#ifdef USE_SYSTEMD - static void do_sd_notify(enum daemon_status old_state, - enum daemon_status new_state) - { -@@ -247,7 +247,9 @@ enum daemon_status wait_for_state_change_if(enum daemon_status oldstate, - static void __post_config_state(enum daemon_status state) - { - if (state != running_state && running_state != DAEMON_SHUTDOWN) { -- enum daemon_status old_state = running_state; -+ /* save state for sd_notify */ -+ enum daemon_status -+ __attribute__((unused)) old_state = running_state; - - running_state = state; - pthread_cond_broadcast(&config_cond); -@@ -272,7 +274,9 @@ int set_config_state(enum daemon_status state) - pthread_cleanup_push(config_cleanup, NULL); - pthread_mutex_lock(&config_lock); - if (running_state != state) { -- enum daemon_status old_state = running_state; -+ /* save state for sd_notify */ -+ enum daemon_status -+ __attribute__((unused)) old_state = running_state; - - if (running_state == DAEMON_SHUTDOWN) - rc = EINVAL; -@@ -2280,7 +2284,6 @@ checkerloop (void *ap) - struct timespec last_time; - struct config *conf; - int foreign_tick = 0; -- bool use_watchdog; - - pthread_cleanup_push(rcu_unregister, NULL); - rcu_register_thread(); -@@ -2292,11 +2295,15 @@ checkerloop (void *ap) - get_monotonic_time(&last_time); - last_time.tv_sec -= 1; - -- /* use_watchdog is set from process environment and never changes */ - conf = get_multipath_config(); -- use_watchdog = conf->use_watchdog; - put_multipath_config(conf); - -+#ifdef USE_SYSTEMD -+ /* use_watchdog is set from process environment and never changes */ -+ bool use_watchdog; -+ use_watchdog = conf->use_watchdog; -+#endif -+ - while (1) { - struct timespec diff_time, start_time, end_time; - int num_paths = 0, strict_timing, rc = 0; -- cgit v1.2.3