me
/
guix
Archived
1
0
Fork 0

Merge branch 'origin/core-updates-next' into core-updates

master
Ricardo Wurmus 2018-06-06 23:01:48 +02:00
commit 8709624756
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
22 changed files with 397 additions and 191 deletions

View File

@ -621,6 +621,7 @@ dist_patch_DATA = \
%D%/packages/patches/crossmap-allow-system-pysam.patch \
%D%/packages/patches/clucene-contribs-lib.patch \
%D%/packages/patches/cube-nocheck.patch \
%D%/packages/patches/cups-fix-builds-without-PAM.patch \
%D%/packages/patches/cursynth-wave-rand.patch \
%D%/packages/patches/cvs-2017-12836.patch \
%D%/packages/patches/cyrus-sasl-CVE-2013-4122.patch \
@ -806,7 +807,6 @@ dist_patch_DATA = \
%D%/packages/patches/java-xerces-bootclasspath.patch \
%D%/packages/patches/java-xerces-build_dont_unzip.patch \
%D%/packages/patches/java-xerces-xjavac_taskdef.patch \
%D%/packages/patches/jemalloc-arm-address-bits.patch \
%D%/packages/patches/jbig2dec-ignore-testtest.patch \
%D%/packages/patches/json-glib-fix-tests-32bit.patch \
%D%/packages/patches/jq-CVE-2015-8863.patch \
@ -856,7 +856,6 @@ dist_patch_DATA = \
%D%/packages/patches/libgdata-glib-duplicate-tests.patch \
%D%/packages/patches/libgnome-encoding.patch \
%D%/packages/patches/libgnomeui-utf8.patch \
%D%/packages/patches/libgpg-error-aarch64-logging-fix.patch \
%D%/packages/patches/libgxps-CVE-2017-11590.patch \
%D%/packages/patches/libffi-3.2.1-complex-alpha.patch \
%D%/packages/patches/libjxr-fix-function-signature.patch \

View File

@ -43,7 +43,7 @@
(define-public boost
(package
(name "boost")
(version "1.66.0")
(version "1.67.0")
(source (origin
(method url-fetch)
(uri (string-append
@ -52,7 +52,7 @@
".tar.bz2"))
(sha256
(base32
"1aaw48cmimsskzgiclwn0iifp62a5iw9cbqrhfari876af1828ap"))
"1fmdlmkzsrd46wwk834jsi2ypxj68w2by0rfcg2pzrafk5rck116"))
(patches (search-patches "boost-fix-icu-build.patch"))))
(build-system gnu-build-system)
(inputs `(("icu4c" ,icu4c)

View File

@ -43,7 +43,7 @@
(define-public cmake
(package
(name "cmake")
(version "3.11.0")
(version "3.11.1")
(source (origin
(method url-fetch)
(uri (string-append "https://www.cmake.org/files/v"
@ -51,7 +51,7 @@
"/cmake-" version ".tar.gz"))
(sha256
(base32
"0sv5k9q6braa8hhw0y3w19avqn0xn5czv5jf5fz5blnlf7ivw4y3"))
"033x45q0lyaqr32pv92pv87pw20nja6i9794hmijrm6ilinbrgjp"))
(modules '((guix build utils)))
(snippet
'(begin
@ -86,6 +86,13 @@
" --exclude-regex ^\\(" (string-join skipped-tests "\\|") "\\)$")))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'split-package
;; Remove files that have been packaged in other package recipes.
(lambda _
(delete-file "Auxiliary/cmake-mode.el")
(substitute* "Auxiliary/CMakeLists.txt"
((".*cmake-mode.el.*") ""))
#t))
(add-before 'configure 'patch-bin-sh
(lambda _
;; Replace "/bin/sh" by the right path in... a lot of

View File

@ -374,7 +374,7 @@ compressed with pbzip2 can be decompressed with bzip2).")
(define-public xz
(package
(name "xz")
(version "5.2.3")
(version "5.2.4")
(source (origin
(method url-fetch)
(uri (list (string-append "http://tukaani.org/xz/xz-" version
@ -383,7 +383,7 @@ compressed with pbzip2 can be decompressed with bzip2).")
version ".tar.gz")))
(sha256
(base32
"1jr8pxnz55ifc8cvp3ivgl79ph9iik5aypsc9cma228aglsqp4ki"))))
"0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
(build-system gnu-build-system)
(synopsis "General-purpose data compression")
(description

View File

@ -50,7 +50,7 @@
(define-public cups-filters
(package
(name "cups-filters")
(version "1.20.1")
(version "1.20.3")
(source(origin
(method url-fetch)
(uri
@ -58,7 +58,7 @@
"cups-filters-" version ".tar.xz"))
(sha256
(base32
"0qix1whz5n4ijnl6d44f1v8nzkpv99wqjyrby8vx6xnpskw5hsxk"))
"1g18qkvl9zdxickiblgs2vvkip4b6p2jalw4d30zzz3hh8f1g6iv"))
(modules '((guix build utils)))
(snippet
;; install backends, banners and filters to cups-filters output
@ -173,7 +173,7 @@ filters for the PDF-centric printing workflow introduced by OpenPrinting.")
(define-public cups-minimal
(package
(name "cups-minimal")
(version "2.2.6")
(version "2.2.7")
(source
(origin
(method url-fetch)
@ -181,7 +181,10 @@ filters for the PDF-centric printing workflow introduced by OpenPrinting.")
version "/cups-" version "-source.tar.gz"))
(sha256
(base32
"16qn41b84xz6khrr2pa2wdwlqxr29rrrkjfi618gbgdkq9w5ff20"))))
"0spaqv943bzzq31gqdp73934jgyhhlbzdmgvrmf5cxvhfdxn6jrw"))
;; “PAM will soon [in 2.3.x] be required for authentication, period.”
;; <https://github.com/apple/cups/pull/5253#issuecomment-368066917>
(patches (search-patches "cups-fix-builds-without-PAM.patch"))))
(build-system gnu-build-system)
(arguments
`(#:configure-flags

View File

@ -1008,7 +1008,7 @@ for example from a shell script.")
(define-public sqlite
(package
(name "sqlite")
(version "3.23.0")
(version "3.23.1")
(source (origin
(method url-fetch)
(uri (let ((numeric-version
@ -1024,7 +1024,7 @@ for example from a shell script.")
numeric-version ".tar.gz")))
(sha256
(base32
"0jbf78g3cm5wq77k7sfg8fb6rz44hnp9hs7p5d66fwd000c1lwdp"))))
"09ggapjhqjb2pzk0wkfczil77plijg3d77m2bpzlwx2y7ql2p14j"))))
(build-system gnu-build-system)
(inputs `(("readline" ,readline)))
(arguments

View File

@ -2,6 +2,7 @@
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@ -28,14 +29,14 @@
(define-public file
(package
(name "file")
(version "5.32")
(version "5.33")
(source (origin
(method url-fetch)
(uri (string-append "ftp://ftp.astron.com/pub/file/file-"
version ".tar.gz"))
(sha256
(base32
"0l1bfa0icng9vdwya00ff48fhvjazi5610ylbhl35qi13d6xqfc6"))))
"1iipnwjkag7q04zjkaqic41r9nlw0ml6mhqian6qkkbisb1whlhw"))))
(build-system gnu-build-system)
;; When cross-compiling, this package depends upon a native install of

View File

@ -80,7 +80,7 @@
(define dbus
(package
(name "dbus")
(version "1.12.6")
(version "1.12.8")
(source (origin
(method url-fetch)
(uri (string-append
@ -88,7 +88,7 @@
version ".tar.gz"))
(sha256
(base32
"05picaq8j60wlwyi84qvw5liw3nd0cws9va3krnc3pms0wm906v2"))
"1cvfi7jiby12h0f5gbysphhk99m6mch87ab3cqxkj0w36gkrkp72"))
(patches (search-patches "dbus-helper-search-path.patch"))))
(build-system gnu-build-system)
(arguments
@ -150,7 +150,7 @@ shared NFS home directories.")
(define glib
(package
(name "glib")
(version "2.56.0")
(version "2.56.1")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnome/sources/"
@ -158,7 +158,7 @@ shared NFS home directories.")
name "-" version ".tar.xz"))
(sha256
(base32
"1iqgi90fmpl3l23jm2iv44qp7hqsxvnv7978s18933bvx4bnxvzc"))
"138b3hi7glfpbia49gi07lyz1dh9k0jl9vpd3aiwflf6y923zvs0"))
(patches (search-patches "glib-tests-timer.patch"))))
(build-system gnu-build-system)
(outputs '("out" ; everything
@ -303,14 +303,14 @@ dynamic loading, and an object system.")
(define gobject-introspection
(package
(name "gobject-introspection")
(version "1.56.0")
(version "1.56.1")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnome/sources/"
"gobject-introspection/" (version-major+minor version)
"/gobject-introspection-" version ".tar.xz"))
(sha256
(base32 "1y50pbn5qqbcv2h9rkz96wvv5jls2gma9bkqjq6wapmaszx5jw0d"))
(base32 "0jx2kryjd7l0vl5gb3qp1qjfy3cjiizvcd1snsm7pzwrzz67aa2v"))
(modules '((guix build utils)))
(snippet
'(begin

View File

@ -70,7 +70,7 @@
(define-public libgpg-error
(package
(name "libgpg-error")
(version "1.28")
(version "1.29")
(source
(origin
(method url-fetch)
@ -78,8 +78,7 @@
version ".tar.bz2"))
(sha256
(base32
"0jfsfnh9bxlxiwxws60yah4ybjw2hshmvqp31pri4m4h8ivrbnry"))
(patches (search-patches "libgpg-error-aarch64-logging-fix.patch"))))
"1smihcrhkfy58kazjaigmfbagy52rw98fqfsv1x7ml8razx2dsgc"))))
(build-system gnu-build-system)
(home-page "https://gnupg.org")
(synopsis "Library of error values for GnuPG components")

View File

@ -111,14 +111,14 @@ tools have full access to view and control running applications.")
(define-public cairo
(package
(name "cairo")
(version "1.14.10")
(version "1.14.12")
(source (origin
(method url-fetch)
(uri (string-append "https://cairographics.org/releases/cairo-"
version ".tar.xz"))
(sha256
(base32
"02banr0wxckq62nbhc3mqidfdh2q956i2r7w2hd9bjgjb238g1vy"))
"05mzyxkvsfc1annjw2dja8vka01ampp9pp93lg09j8hba06g144c"))
(patches (search-patches "cairo-CVE-2016-9082.patch"))))
(build-system gnu-build-system)
(propagated-inputs
@ -216,7 +216,7 @@ affine transformation (scale, rotation, shear, etc.).")
(define-public pango
(package
(name "pango")
(version "1.42.0")
(version "1.42.1")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnome/sources/pango/"
@ -224,7 +224,7 @@ affine transformation (scale, rotation, shear, etc.).")
name "-" version ".tar.xz"))
(sha256
(base32
"0illn78nfwpa8y5knh9ir74wa1skc2hi8f3ny19zgpyf7n5dh94r"))))
"0cnfgcya3wbs9m8g44cl5ww6wbp6qbw96qvsgkr8ymwqn9b6fnli"))))
(build-system gnu-build-system)
(propagated-inputs
;; These are all in Requires or Requires.private of the '.pc' files.

View File

@ -253,13 +253,13 @@ files. It can compress them as much as 40% losslessly.")
(define-public libjpeg
(package
(name "libjpeg")
(version "9b")
(version "9c")
(source (origin
(method url-fetch)
(uri (string-append "http://www.ijg.org/files/jpegsrc.v"
version ".tar.gz"))
(sha256 (base32
"0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
"08kixcf3a7s9x91174abjnk1xbvj4v8crdc73zi4k9h3jfbm00k5"))))
(build-system gnu-build-system)
(synopsis "Library for handling JPEG files")
(description

View File

@ -32,7 +32,7 @@
(define-public jemalloc
(package
(name "jemalloc")
(version "5.0.1")
(version "5.1.0")
(source (origin
(method url-fetch)
(uri (string-append
@ -40,8 +40,7 @@
version "/jemalloc-" version ".tar.bz2"))
(sha256
(base32
"1sf3lzgb0y8nnyzmp4zrca3sngdxw3kfh20sna9z03jv74fph528"))
(patches (search-patches "jemalloc-arm-address-bits.patch"))))
"0s3jpcyhzia8d4k0xyc67is78kg416p9yc3c2f9w6fhhqqffd5jk"))))
(build-system gnu-build-system)
(arguments
`(#:phases

View File

@ -121,14 +121,14 @@ limited support for fork events.")
(define-public libuv
(package
(name "libuv")
(version "1.19.2")
(version "1.20.3")
(source (origin
(method url-fetch)
(uri (string-append "https://dist.libuv.org/dist/v" version
"/libuv-v" version ".tar.gz"))
(sha256
(base32
"1msk9ac1z69whww88ibrwjqkd1apdla6l77cm2fwy5kigq0z5g3w"))))
"0yc569q47gidqsdsbx30l6i60lwh97pavdnwac0gv9f72vcsmdrv"))))
(build-system gnu-build-system)
(arguments
'(#:phases (modify-phases %standard-phases

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2012, 2013, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
@ -38,20 +38,23 @@
(home-page "https://www.gnu.org/software/libsigsegv/")
(synopsis "Library for handling page faults")
(arguments
;; On MIPS, work around this error:
;;
;; In file included from fault-linux-mips-old.h:18:0,
;; [...]
;; linux-libre-headers-cross-mips64el-linux-gnu-3.3.8/include/asm/sigcontext.h:57:8: error: redefinition of 'struct sigcontext'
(if (string-contains (or (%current-target-system) (%current-system))
"mips64el")
`(#:phases (modify-phases %standard-phases
(add-before 'configure 'patch-mips-old-h
(lambda _
(substitute* "src/fault-linux-mips-old.h"
(("#include <asm/sigcontext\\.h>") ""))
#t))))
'()))
`(;; The shared library isn't built by default but some packages need it.
#:configure-flags '("--enable-shared")
;; On MIPS, work around this error:
;;
;; In file included from fault-linux-mips-old.h:18:0,
;; [...]
;; linux-libre-headers-cross-mips64el-linux-gnu-3.3.8/include/asm/sigcontext.h:57:8: error: redefinition of 'struct sigcontext'
,@(if (string-contains (or (%current-target-system) (%current-system))
"mips64el")
`(#:phases (modify-phases %standard-phases
(add-before 'configure 'patch-mips-old-h
(lambda _
(substitute* "src/fault-linux-mips-old.h"
(("#include <asm/sigcontext\\.h>") ""))
#t))))
'())))
(description
"GNU libsigsegv is a library to handle page faults, which occur when a
program tries to access an unavailable region of memory, in user mode. By

View File

@ -0,0 +1,201 @@
From 570933a6a3597371bae1beeb754ee8711d6305ab Mon Sep 17 00:00:00 2001
From: Michael R Sweet <michael.r.sweet@gmail.com>
Date: Mon, 2 Apr 2018 20:05:13 -0400
Subject: [PATCH] Fix builds without PAM (Issue #5283)
---
CHANGES.md | 8 +++-
scheduler/auth.c | 134 ++-----------------------------------------------------
2 files changed, 11 insertions(+), 131 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index f568f35af..e8fc1fbdd 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,7 +1,13 @@
-CHANGES - 2.2.7 - 2018-03-22
+CHANGES - 2.2.8 - 2018-04-02
============================
+Changes in CUPS v2.2.8
+----------------------
+
+- Fixed builds without PAM (Issue #5283)
+
+
Changes in CUPS v2.2.7
----------------------
diff --git a/scheduler/auth.c b/scheduler/auth.c
index 8b134b5d7..fa4e2715d 100644
--- a/scheduler/auth.c
+++ b/scheduler/auth.c
@@ -1,8 +1,8 @@
/*
* Authorization routines for the CUPS scheduler.
*
- * Copyright 2007-2016 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
* Jelmer Vernooij.
@@ -71,9 +71,6 @@ static int check_authref(cupsd_client_t *con, const char *right);
static int compare_locations(cupsd_location_t *a,
cupsd_location_t *b);
static cupsd_authmask_t *copy_authmask(cupsd_authmask_t *am, void *data);
-#if !HAVE_LIBPAM
-static char *cups_crypt(const char *pw, const char *salt);
-#endif /* !HAVE_LIBPAM */
static void free_authmask(cupsd_authmask_t *am, void *data);
#if HAVE_LIBPAM
static int pam_func(int, const struct pam_message **,
@@ -694,14 +691,14 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
* client...
*/
- pass = cups_crypt(password, pw->pw_passwd);
+ pass = crypt(password, pw->pw_passwd);
if (!pass || strcmp(pw->pw_passwd, pass))
{
# ifdef HAVE_SHADOW_H
if (spw)
{
- pass = cups_crypt(password, spw->sp_pwdp);
+ pass = crypt(password, spw->sp_pwdp);
if (pass == NULL || strcmp(spw->sp_pwdp, pass))
{
@@ -1995,129 +1992,6 @@ copy_authmask(cupsd_authmask_t *mask, /* I - Existing auth mask */
}
-#if !HAVE_LIBPAM
-/*
- * 'cups_crypt()' - Encrypt the password using the DES or MD5 algorithms,
- * as needed.
- */
-
-static char * /* O - Encrypted password */
-cups_crypt(const char *pw, /* I - Password string */
- const char *salt) /* I - Salt (key) string */
-{
- if (!strncmp(salt, "$1$", 3))
- {
- /*
- * Use MD5 passwords without the benefit of PAM; this is for
- * Slackware Linux, and the algorithm was taken from the
- * old shadow-19990827/lib/md5crypt.c source code... :(
- */
-
- int i; /* Looping var */
- unsigned long n; /* Output number */
- int pwlen; /* Length of password string */
- const char *salt_end; /* End of "salt" data for MD5 */
- char *ptr; /* Pointer into result string */
- _cups_md5_state_t state; /* Primary MD5 state info */
- _cups_md5_state_t state2; /* Secondary MD5 state info */
- unsigned char digest[16]; /* MD5 digest result */
- static char result[120]; /* Final password string */
-
-
- /*
- * Get the salt data between dollar signs, e.g. $1$saltdata$md5.
- * Get a maximum of 8 characters of salt data after $1$...
- */
-
- for (salt_end = salt + 3; *salt_end && (salt_end - salt) < 11; salt_end ++)
- if (*salt_end == '$')
- break;
-
- /*
- * Compute the MD5 sum we need...
- */
-
- pwlen = strlen(pw);
-
- _cupsMD5Init(&state);
- _cupsMD5Append(&state, (unsigned char *)pw, pwlen);
- _cupsMD5Append(&state, (unsigned char *)salt, salt_end - salt);
-
- _cupsMD5Init(&state2);
- _cupsMD5Append(&state2, (unsigned char *)pw, pwlen);
- _cupsMD5Append(&state2, (unsigned char *)salt + 3, salt_end - salt - 3);
- _cupsMD5Append(&state2, (unsigned char *)pw, pwlen);
- _cupsMD5Finish(&state2, digest);
-
- for (i = pwlen; i > 0; i -= 16)
- _cupsMD5Append(&state, digest, i > 16 ? 16 : i);
-
- for (i = pwlen; i > 0; i >>= 1)
- _cupsMD5Append(&state, (unsigned char *)((i & 1) ? "" : pw), 1);
-
- _cupsMD5Finish(&state, digest);
-
- for (i = 0; i < 1000; i ++)
- {
- _cupsMD5Init(&state);
-
- if (i & 1)
- _cupsMD5Append(&state, (unsigned char *)pw, pwlen);
- else
- _cupsMD5Append(&state, digest, 16);
-
- if (i % 3)
- _cupsMD5Append(&state, (unsigned char *)salt + 3, salt_end - salt - 3);
-
- if (i % 7)
- _cupsMD5Append(&state, (unsigned char *)pw, pwlen);
-
- if (i & 1)
- _cupsMD5Append(&state, digest, 16);
- else
- _cupsMD5Append(&state, (unsigned char *)pw, pwlen);
-
- _cupsMD5Finish(&state, digest);
- }
-
- /*
- * Copy the final sum to the result string and return...
- */
-
- memcpy(result, salt, (size_t)(salt_end - salt));
- ptr = result + (salt_end - salt);
- *ptr++ = '$';
-
- for (i = 0; i < 5; i ++, ptr += 4)
- {
- n = ((((unsigned)digest[i] << 8) | (unsigned)digest[i + 6]) << 8);
-
- if (i < 4)
- n |= (unsigned)digest[i + 12];
- else
- n |= (unsigned)digest[5];
-
- to64(ptr, n, 4);
- }
-
- to64(ptr, (unsigned)digest[11], 2);
- ptr += 2;
- *ptr = '\0';
-
- return (result);
- }
- else
- {
- /*
- * Use the standard crypt() function...
- */
-
- return (crypt(pw, salt));
- }
-}
-#endif /* !HAVE_LIBPAM */
-
-
/*
* 'free_authmask()' - Free function for auth masks.
*/

View File

@ -1,39 +0,0 @@
From 8cfc9dec37b312a2686f602bbcdd102ca07cca99 Mon Sep 17 00:00:00 2001
From: David Goldblatt <davidgoldblatt@fb.com>
Date: Fri, 29 Sep 2017 13:54:08 -0700
Subject: [PATCH] ARM: Don't extend bit LG_VADDR to compute high address bits.
In userspace ARM on Linux, zero-ing the high bits is the correct way to do this.
This doesn't fix the fact that we currently set LG_VADDR to 48 on ARM, when in
fact larger virtual address sizes are coming soon. We'll cross that bridge when
we come to it.
---
include/jemalloc/internal/rtree.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/jemalloc/internal/rtree.h b/include/jemalloc/internal/rtree.h
index b5d4db39..4563db23 100644
--- a/include/jemalloc/internal/rtree.h
+++ b/include/jemalloc/internal/rtree.h
@@ -178,9 +178,21 @@ rtree_leaf_elm_bits_read(tsdn_t *tsdn, rtree_t *rtree, rtree_leaf_elm_t *elm,
JEMALLOC_ALWAYS_INLINE extent_t *
rtree_leaf_elm_bits_extent_get(uintptr_t bits) {
+# ifdef __aarch64__
+ /*
+ * aarch64 doesn't sign extend the highest virtual address bit to set
+ * the higher ones. Instead, the high bits gets zeroed.
+ */
+ uintptr_t high_bit_mask = ((uintptr_t)1 << LG_VADDR) - 1;
+ /* Mask off the slab bit. */
+ uintptr_t low_bit_mask = ~(uintptr_t)1;
+ uintptr_t mask = high_bit_mask & low_bit_mask;
+ return (extent_t *)(bits & mask);
+# else
/* Restore sign-extended high bits, mask slab bit. */
return (extent_t *)((uintptr_t)((intptr_t)(bits << RTREE_NHIB) >>
RTREE_NHIB) & ~((uintptr_t)0x1));
+# endif
}
JEMALLOC_ALWAYS_INLINE szind_t

View File

@ -1,58 +0,0 @@
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=patch;h=791177de023574223eddf7288eb7c5a0721ac623
From 791177de023574223eddf7288eb7c5a0721ac623 Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Sun, 18 Mar 2018 17:39:43 +0100
Subject: [PATCH] core: Fix regression on arm64 due to invalid use of va_list.
* src/logging.c (_gpgrt_log_printhex): Provide a dummy arg instead of
NULL.
--
Fix
Suggested-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Werner Koch <wk@gnupg.org>
---
src/logging.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/logging.c b/src/logging.c
index 1a4f620..d01f974 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -1090,9 +1090,10 @@ _gpgrt_log_flush (void)
/* Print a hexdump of (BUFFER,LENGTH). With FMT passed as NULL print
- * just the raw dump, with FMT being an empty string, print a trailing
- * linefeed, otherwise print an entire debug line with the expanded
- * FMT followed by a possible wrapped hexdump and a final LF. */
+ * just the raw dump (in this case ARG_PTR is not used), with FMT
+ * being an empty string, print a trailing linefeed, otherwise print
+ * an entire debug line with the expanded FMT followed by a possible
+ * wrapped hexdump and a final LF. */
void
_gpgrt_logv_printhex (const void *buffer, size_t length,
const char *fmt, va_list arg_ptr)
@@ -1150,7 +1151,16 @@ _gpgrt_log_printhex (const void *buffer, size_t length,
va_end (arg_ptr);
}
else
- _gpgrt_logv_printhex (buffer, length, NULL, NULL);
+ {
+ /* va_list is not necessary a pointer and thus we can't use NULL
+ * because that would conflict with platforms using a straight
+ * struct for it (e.g. arm64). We use a dummy variable instead;
+ * the static is a simple way zero it out so to not get
+ * complains about uninitialized use. */
+ static va_list dummy_argptr;
+
+ _gpgrt_logv_printhex (buffer, length, NULL, dummy_argptr);
+ }
}
--
2.8.0.rc3

View File

@ -13,7 +13,7 @@
;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@ -79,14 +79,14 @@
(define-public poppler
(package
(name "poppler")
(version "0.63.0")
(version "0.64.0")
(source (origin
(method url-fetch)
(uri (string-append "https://poppler.freedesktop.org/poppler-"
version ".tar.xz"))
(sha256
(base32
"04d1z1ygyb3llzc6s6c99wxafvljj2sc5b76djif34f7mzfqmk17"))))
"1cb4gz3h7cfqyphhx71qc9mp417bdphchbfghmvhcy4zm4ngj7dj"))))
(build-system cmake-build-system)
;; FIXME:
;; use libcurl: no

View File

@ -143,7 +143,7 @@
(define-public python-2.7
(package
(name "python2")
(version "2.7.14")
(version "2.7.15")
(source
(origin
(method url-fetch)
@ -151,7 +151,7 @@
version "/Python-" version ".tar.xz"))
(sha256
(base32
"0rka541ys16jwzcnnvjp2v12m4cwgd2jp6wj4kj511p715pb5zvi"))
"0x2mvz9dp11wj7p5ccvmk9s0hzjk2fa1m462p395l4r6bfnb3n92"))
(patches (search-patches "python-2.7-search-paths.patch"
"python-2-deterministic-build-info.patch"
"python-2.7-site-prefixes.patch"

View File

@ -41,7 +41,8 @@
elf-dynamic-info-runpath
expand-origin
validate-needed-in-runpath))
validate-needed-in-runpath
strip-runpath))
;;; Commentary:
;;;
@ -99,10 +100,16 @@ dynamic linking information."
;; } d_un;
;; } Elf64_Dyn;
(define-record-type <dynamic-entry>
(dynamic-entry type value offset)
dynamic-entry?
(type dynamic-entry-type) ;DT_*
(value dynamic-entry-value) ;string | number | ...
(offset dynamic-entry-offset)) ;integer
(define (raw-dynamic-entries elf segment)
"Return as a list of type/value pairs all the dynamic entries found in
SEGMENT, the 'PT_DYNAMIC' segment of ELF. In the result, each car is a DT_
value, and the interpretation of the cdr depends on the type."
"Return as a list of <dynamic-entry> for the dynamic entries found in
SEGMENT, the 'PT_DYNAMIC' segment of ELF."
(define start
(elf-segment-offset segment))
(define bytes
@ -123,7 +130,9 @@ value, and the interpretation of the cdr depends on the type."
(if (= type DT_NULL) ;finished?
(reverse result)
(loop (+ offset (* 2 word-size))
(alist-cons type value result)))))))
(cons (dynamic-entry type value
(+ start offset word-size))
result)))))))
(define (vma->offset elf vma)
"Convert VMA, a virtual memory address, to an offset within ELF.
@ -148,35 +157,33 @@ offset."
(define (dynamic-entries elf segment)
"Return all the dynamic entries found in SEGMENT, the 'PT_DYNAMIC' segment
of ELF, as a list of type/value pairs. The type is a DT_ value, and the value
may be a string or an integer depending on the entry type (for instance, the
value of DT_NEEDED entries is a string.)"
of ELF, as a list of <dynamic-entry>. The value of each entry may be a string
or an integer depending on the entry type (for instance, the value of
DT_NEEDED entries is a string.) Likewise the offset is the offset within the
string table if the type is a string."
(define entries
(raw-dynamic-entries elf segment))
(define string-table-offset
(any (match-lambda
((type . value)
(and (= type DT_STRTAB) value))
(_ #f))
(any (lambda (entry)
(and (= (dynamic-entry-type entry) DT_STRTAB)
(dynamic-entry-value entry)))
entries))
(define (interpret-dynamic-entry type value)
(cond ((memv type (list DT_NEEDED DT_SONAME DT_RPATH DT_RUNPATH))
(if string-table-offset
(pointer->string
(bytevector->pointer (elf-bytes elf)
(vma->offset
elf
(+ string-table-offset value))))
value))
(else
value)))
(define (interpret-dynamic-entry entry)
(let ((type (dynamic-entry-type entry))
(value (dynamic-entry-value entry)))
(cond ((memv type (list DT_NEEDED DT_SONAME DT_RPATH DT_RUNPATH))
(if string-table-offset
(let* ((offset (vma->offset elf (+ string-table-offset value)))
(value (pointer->string
(bytevector->pointer (elf-bytes elf) offset))))
(dynamic-entry type value offset))
(dynamic-entry type value (dynamic-entry-offset entry))))
(else
(dynamic-entry type value (dynamic-entry-offset entry))))))
(map (match-lambda
((type . value)
(cons type (interpret-dynamic-entry type value))))
entries))
(map interpret-dynamic-entry entries))
;;;
@ -200,21 +207,29 @@ value of DT_NEEDED entries is a string.)"
(define (elf-dynamic-info elf)
"Return dynamic-link information for ELF as an <elf-dynamic-info> object, or
#f if ELF lacks dynamic-link information."
(define (matching-entry type)
(lambda (entry)
(= type (dynamic-entry-type entry))))
(match (dynamic-link-segment elf)
(#f #f)
((? elf-segment? dynamic)
(let ((entries (dynamic-entries elf dynamic)))
(%elf-dynamic-info (assv-ref entries DT_SONAME)
(filter-map (match-lambda
((type . value)
(and (= type DT_NEEDED) value))
(_ #f))
(%elf-dynamic-info (find (matching-entry DT_SONAME) entries)
(filter-map (lambda (entry)
(and (= (dynamic-entry-type entry)
DT_NEEDED)
(dynamic-entry-value entry)))
entries)
(or (and=> (assv-ref entries DT_RPATH)
search-path->list)
(or (and=> (find (matching-entry DT_RPATH)
entries)
(compose search-path->list
dynamic-entry-value))
'())
(or (and=> (assv-ref entries DT_RUNPATH)
search-path->list)
(or (and=> (find (matching-entry DT_RUNPATH)
entries)
(compose search-path->list
dynamic-entry-value))
'()))))))
(define %libc-libraries
@ -306,4 +321,47 @@ be found in RUNPATH ~s~%"
;; (format (current-error-port) "~a is OK~%" file))
(null? not-found))))))
(define (strip-runpath file)
"Remove from the DT_RUNPATH of FILE any entries that are not necessary
according to DT_NEEDED."
(define (minimal-runpath needed runpath)
(filter (lambda (directory)
(and (string-prefix? "/" directory)
(any (lambda (lib)
(file-exists? (string-append directory "/" lib)))
needed)))
runpath))
(define port
(open-file file "r+b"))
(catch #t
(lambda ()
(let* ((elf (parse-elf (get-bytevector-all port)))
(entries (dynamic-entries elf (dynamic-link-segment elf)))
(needed (filter-map (lambda (entry)
(and (= (dynamic-entry-type entry)
DT_NEEDED)
(dynamic-entry-value entry)))
entries))
(runpath (find (lambda (entry)
(= DT_RUNPATH (dynamic-entry-type entry)))
entries))
(old (search-path->list
(dynamic-entry-value runpath)))
(new (minimal-runpath needed old)))
(unless (equal? old new)
(format (current-error-port)
"~a: stripping RUNPATH to ~s (removed ~s)~%"
file new
(lset-difference string=? old new))
(seek port (dynamic-entry-offset runpath) SEEK_SET)
(put-bytevector port (string->utf8 (string-join new ":")))
(put-u8 port 0))
(close-port port)
new))
(lambda (key . args)
(false-if-exception (close-port port))
(apply throw key args))))
;;; gremlin.scm ends here

View File

@ -135,7 +135,7 @@ for example libraries only needed for the tests."
(find-files dir elf-pred))
existing-elf-dirs))))
(for-each (lambda (elf-file)
(system* "patchelf" "--shrink-rpath" elf-file)
(strip-runpath elf-file)
(handle-file elf-file elf-list))
elf-list)))))
(for-each handle-output outputs)

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@ -18,12 +18,14 @@
(define-module (test-gremlin)
#:use-module (guix elf)
#:use-module ((guix utils) #:select (call-with-temporary-directory))
#:use-module (guix build utils)
#:use-module (guix build gremlin)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-64)
#:use-module (rnrs io ports)
#:use-module (ice-9 popen)
#:use-module (ice-9 match))
(define %guile-executable
@ -37,6 +39,9 @@
(define read-elf
(compose parse-elf get-bytevector-all))
(define c-compiler
(or (which "gcc") (which "cc") (which "g++")))
(test-begin "gremlin")
@ -63,4 +68,32 @@
"../${ORIGIN}/bar/$ORIGIN/baz"
"ORIGIN/foo")))
(unless c-compiler
(test-skip 1))
(test-equal "strip-runpath"
"hello\n"
(call-with-temporary-directory
(lambda (directory)
(with-directory-excursion directory
(call-with-output-file "t.c"
(lambda (port)
(display "int main () { puts(\"hello\"); }" port)))
(invoke c-compiler "t.c"
"-Wl,-rpath=/foo" "-Wl,-rpath=/bar")
(let* ((dyninfo (elf-dynamic-info
(parse-elf (call-with-input-file "a.out"
get-bytevector-all))))
(old (elf-dynamic-info-runpath dyninfo))
(new (strip-runpath "a.out"))
(new* (strip-runpath "a.out")))
(validate-needed-in-runpath "a.out")
(and (member "/foo" old) (member "/bar" old)
(not (member "/foo" new))
(not (member "/bar" new))
(equal? new* new)
(let* ((pipe (open-input-pipe "./a.out"))
(str (get-string-all pipe)))
(close-pipe pipe)
str)))))))
(test-end "gremlin")