From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1121108-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 91D051392F4
	for <garchives@archives.gentoo.org>; Fri,  8 Nov 2019 23:26:11 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E3477E085B;
	Fri,  8 Nov 2019 23:26:09 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 33B09E085B
	for <gentoo-commits@lists.gentoo.org>; Fri,  8 Nov 2019 23:26:07 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id DE36134CAC6
	for <gentoo-commits@lists.gentoo.org>; Fri,  8 Nov 2019 23:26:04 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 292ED889
	for <gentoo-commits@lists.gentoo.org>; Fri,  8 Nov 2019 23:26:02 +0000 (UTC)
From: "Patrick McLean" <chutzpah@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Patrick McLean" <chutzpah@gentoo.org>
Message-ID: <1573255523.8c9da308d9c8ee174b4627b75bbfc30bc91c6f65.chutzpah@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-cluster/ceph/, sys-cluster/ceph/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-cluster/ceph/ceph-14.2.4-r1.ebuild sys-cluster/ceph/ceph-14.2.4.ebuild sys-cluster/ceph/files/ceph-14.2.4-python-executable.patch sys-cluster/ceph/files/ceph-14.2.4-undefined-behaviour.patch
X-VCS-Directories: sys-cluster/ceph/files/ sys-cluster/ceph/
X-VCS-Committer: chutzpah
X-VCS-Committer-Name: Patrick McLean
X-VCS-Revision: 8c9da308d9c8ee174b4627b75bbfc30bc91c6f65
X-VCS-Branch: master
Date: Fri,  8 Nov 2019 23:26:02 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: b56d84ba-cece-4d20-831c-c42220923366
X-Archives-Hash: 64982b7b419a8f287a5654550af384d4

commit:     8c9da308d9c8ee174b4627b75bbfc30bc91c6f65
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Fri Nov  8 23:25:23 2019 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Fri Nov  8 23:25:23 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c9da308

sys-cluster/ceph: revbump to 14.2.4-r1, misc fixes

Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.78, Repoman-2.3.17
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 .../{ceph-14.2.4.ebuild => ceph-14.2.4-r1.ebuild}  |  4 ++
 .../ceph/files/ceph-14.2.4-python-executable.patch | 29 +++++++++
 .../files/ceph-14.2.4-undefined-behaviour.patch    | 76 ++++++++++++++++++++++
 3 files changed, 109 insertions(+)

diff --git a/sys-cluster/ceph/ceph-14.2.4.ebuild b/sys-cluster/ceph/ceph-14.2.4-r1.ebuild
similarity index 98%
rename from sys-cluster/ceph/ceph-14.2.4.ebuild
rename to sys-cluster/ceph/ceph-14.2.4-r1.ebuild
index 82af9e6a844..02af6882fd5 100644
--- a/sys-cluster/ceph/ceph-14.2.4.ebuild
+++ b/sys-cluster/ceph/ceph-14.2.4-r1.ebuild
@@ -154,6 +154,8 @@ PATCHES=(
 	"${FILESDIR}/ceph-14.2.0-cython-0.29.patch"
 	"${FILESDIR}/ceph-14.2.3-boost-1.70.patch"
 	"${FILESDIR}/ceph-14.2.3-dpdk-compile-fix-1.patch"
+	"${FILESDIR}/ceph-14.2.4-python-executable.patch"
+	"${FILESDIR}/ceph-14.2.4-undefined-behaviour.patch"
 )
 
 # dpdk and ninja don't get along
@@ -294,6 +296,8 @@ python_install() {
 	pushd "${BUILD_DIR}/src/pybind" >/dev/null || die
 	DESTDIR="${ED}" emake VERBOSE=1 install
 	popd >/dev/null || die
+
+	python_optimize
 }
 
 src_install() {

diff --git a/sys-cluster/ceph/files/ceph-14.2.4-python-executable.patch b/sys-cluster/ceph/files/ceph-14.2.4-python-executable.patch
new file mode 100644
index 00000000000..40feaf11ad3
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph-14.2.4-python-executable.patch
@@ -0,0 +1,29 @@
+diff --git a/src/ceph-crash.in b/src/ceph-crash.in
+index 5bfb50c474..d53c4eeb6a 100755
+--- a/src/ceph-crash.in
++++ b/src/ceph-crash.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON_EXECUTABLE@
++#!@PYTHON3_EXECUTABLE@
+ # -*- mode:python -*-
+ # vim: ts=4 sw=4 smarttab expandtab
+ 
+diff --git a/src/ceph.in b/src/ceph.in
+index f060023f57..3a84263ccc 100755
+--- a/src/ceph.in
++++ b/src/ceph.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON_EXECUTABLE@
++#!@PYTHON3_EXECUTABLE@
+ # -*- mode:python -*-
+ # vim: ts=4 sw=4 smarttab expandtab
+ #
+@@ -66,7 +66,7 @@ DEVMODEMSG = '*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH *
+ def respawn_in_path(lib_path, pybind_path, pythonlib_path, asan_lib_path):
+     execv_cmd = []
+     if 'CEPH_DBG' in os.environ:
+-        execv_cmd += ['@PYTHON_EXECUTABLE@', '-mpdb']
++        execv_cmd += ['@PYTHON3_EXECUTABLE@', '-mpdb']
+ 
+     if platform.system() == "Darwin":
+         lib_path_var = "DYLD_LIBRARY_PATH"

diff --git a/sys-cluster/ceph/files/ceph-14.2.4-undefined-behaviour.patch b/sys-cluster/ceph/files/ceph-14.2.4-undefined-behaviour.patch
new file mode 100644
index 00000000000..99249fb01a0
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph-14.2.4-undefined-behaviour.patch
@@ -0,0 +1,76 @@
+diff --git a/src/include/blobhash.h b/src/include/blobhash.h
+index 597884e4c9..97f2065ce3 100644
+--- a/src/include/blobhash.h
++++ b/src/include/blobhash.h
+@@ -14,33 +14,40 @@
+ #ifndef CEPH_BLOBHASH_H
+ #define CEPH_BLOBHASH_H
+ 
++#include <cstdint>
+ #include "hash.h"
+ 
+-/*
+-- this is to make some of the STL types work with 64 bit values, string hash keys, etc.
+-- added when i was using an old STL.. maybe try taking these out and see if things 
+-  compile now?
+-*/
+-
+ class blobhash {
+ public:
+-  uint32_t operator()(const char *p, unsigned len) {
+-    static rjhash<uint32_t> H;
+-    uint32_t acc = 0;
++  uint32_t operator()(const void* p, size_t len) {
++    static rjhash<std::uint32_t> H;
++    std::uint32_t acc = 0;
++    auto buf = static_cast<const unsigned char*>(p);
+     while (len >= sizeof(acc)) {
+-      acc ^= *(uint32_t*)p;
+-      p += sizeof(uint32_t);
+-      len -= sizeof(uint32_t);
++      acc ^= unaligned_load(buf);
++      buf += sizeof(std::uint32_t);
++      len -= sizeof(std::uint32_t);
+     }
+-    int sh = 0;
+-    while (len) {
+-      acc ^= (uint32_t)*p << sh;
+-      sh += 8;
+-      len--;
+-      p++;
++    // handle the last few bytes of p[-(len % 4):]
++    switch (len) {
++    case 3:
++      acc ^= buf[2] << 16;
++      [[fallthrough]];
++    case 2:
++      acc ^= buf[1] << 8;
++      [[fallthrough]];
++    case 1:
++      acc ^= buf[0];
++      [[fallthrough]];
+     }
+     return H(acc);
+   }
++private:
++  static inline std::uint32_t unaligned_load(const unsigned char* p) {
++    std::uint32_t result;
++    __builtin_memcpy(&result, p, sizeof(result));
++    return result;
++  }
+ };
+ 
+ 
+diff --git a/src/msg/msg_types.h b/src/msg/msg_types.h
+index b6952ca498..576b7d6b8a 100644
+--- a/src/msg/msg_types.h
++++ b/src/msg/msg_types.h
+@@ -566,7 +566,7 @@ namespace std {
+     size_t operator()( const entity_addr_t& x ) const
+     {
+       static blobhash H;
+-      return H((const char*)&x, sizeof(x));
++      return H(&x, sizeof(x));
+     }
+   };
+ } // namespace std