Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Aug 2019 19:12:17 +0000 (UTC)
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r507823 - in head/devel/crc32c: . files
Message-ID:  <201908011912.x71JCHkI012176@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pkubaj
Date: Thu Aug  1 19:12:17 2019
New Revision: 507823
URL: https://svnweb.freebsd.org/changeset/ports/507823

Log:
  devel/crc32c: fix build on big-endian architectures
  
  C++11 compiler is needed:
  
  Target "crc32c" requires the language dialect "CXX11" , but CMake does not
  know the compile flags to use to enable it.
  
  Additionally, big-endian code in src/crc32c_read_le.h needs fixing - the value is 64 bits wide, not 32 bits.
  
  PR:		239420
  Approved by:	amzo1337@gmail.com (maintainer), tcberner (mentor)
  Differential Revision:	https://reviews.freebsd.org/D21054

Added:
  head/devel/crc32c/files/
  head/devel/crc32c/files/patch-src_crc32c__read__le.h   (contents, props changed)
Modified:
  head/devel/crc32c/Makefile

Modified: head/devel/crc32c/Makefile
==============================================================================
--- head/devel/crc32c/Makefile	Thu Aug  1 19:11:59 2019	(r507822)
+++ head/devel/crc32c/Makefile	Thu Aug  1 19:12:17 2019	(r507823)
@@ -11,7 +11,7 @@ COMMENT=	CRC32C implementation supporting CPU-specific
 LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-USES=		cmake
+USES=		cmake compiler:c++11-lang
 USE_GITHUB=	yes
 GH_ACCOUNT=	google
 USE_LDCONFIG=	yes

Added: head/devel/crc32c/files/patch-src_crc32c__read__le.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/crc32c/files/patch-src_crc32c__read__le.h	Thu Aug  1 19:12:17 2019	(r507823)
@@ -0,0 +1,25 @@
+--- src/crc32c_read_le.h.orig	2019-07-24 07:21:23 UTC
++++ src/crc32c_read_le.h
+@@ -30,14 +30,14 @@ inline uint32_t ReadUint32LE(const uint8_t* buffer) {
+ // Reads a little-endian 64-bit integer from a 64-bit-aligned buffer.
+ inline uint64_t ReadUint64LE(const uint8_t* buffer) {
+ #if BYTE_ORDER_BIG_ENDIAN
+-  return ((static_cast<uint32_t>(static_cast<uint8_t>(buffer[0]))) |
+-          (static_cast<uint32_t>(static_cast<uint8_t>(buffer[1])) << 8) |
+-          (static_cast<uint32_t>(static_cast<uint8_t>(buffer[2])) << 16) |
+-          (static_cast<uint32_t>(static_cast<uint8_t>(buffer[3])) << 24) |
+-          (static_cast<uint32_t>(static_cast<uint8_t>(buffer[4])) << 32) |
+-          (static_cast<uint32_t>(static_cast<uint8_t>(buffer[5])) << 40) |
+-          (static_cast<uint32_t>(static_cast<uint8_t>(buffer[6])) << 48) |
+-          (static_cast<uint32_t>(static_cast<uint8_t>(buffer[7])) << 56));
++  return ((static_cast<uint64_t>(static_cast<uint8_t>(buffer[0]))) |
++          (static_cast<uint64_t>(static_cast<uint8_t>(buffer[1])) << 8) |
++          (static_cast<uint64_t>(static_cast<uint8_t>(buffer[2])) << 16) |
++          (static_cast<uint64_t>(static_cast<uint8_t>(buffer[3])) << 24) |
++          (static_cast<uint64_t>(static_cast<uint8_t>(buffer[4])) << 32) |
++          (static_cast<uint64_t>(static_cast<uint8_t>(buffer[5])) << 40) |
++          (static_cast<uint64_t>(static_cast<uint8_t>(buffer[6])) << 48) |
++          (static_cast<uint64_t>(static_cast<uint8_t>(buffer[7])) << 56));
+ #else   // !BYTE_ORDER_BIG_ENDIAN
+   uint64_t result;
+   // This should be optimized to a single instruction.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908011912.x71JCHkI012176>