Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jul 2016 03:05:27 +0000 (UTC)
From:      Mikhail Teterin <mi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r418568 - in head/graphics/lepton: . files
Message-ID:  <201607150305.u6F35RIV023980@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mi
Date: Fri Jul 15 03:05:26 2016
New Revision: 418568
URL: https://svnweb.freebsd.org/changeset/ports/418568

Log:
  Finish up the port, which got committed too early by accident:
  
  	. Note, that it works on CPUs with at least SSSE3
  	  instruction set -- the original code assumes SSE4,
  	  but that was relatively easy to patch
  	. Do not attempt to build, if SSSE3 not among CPU-options
  	. Fix up formatting warnings (reported upstream)
  	. Fix a crash on i386. Unfortunately, 5 of the 40
  	  self-tests still fail on i386 -- the problem reported
  	  upstream

Added:
  head/graphics/lepton/files/patch-cpu
     - copied, changed from r418567, head/graphics/lepton/files/patch-sse2
  head/graphics/lepton/files/patch-warnings   (contents, props changed)
Deleted:
  head/graphics/lepton/files/patch-sse2
Modified:
  head/graphics/lepton/Makefile

Modified: head/graphics/lepton/Makefile
==============================================================================
--- head/graphics/lepton/Makefile	Fri Jul 15 01:27:43 2016	(r418567)
+++ head/graphics/lepton/Makefile	Fri Jul 15 03:05:26 2016	(r418568)
@@ -17,13 +17,17 @@ GH_TAGNAME=	a34ee2f4b0a6454eff8ebe334750
 USES=		autoreconf
 GNU_CONFIGURE=	yes
 TEST_TARGET=	check
-CFLAGS+=	-DBSD
+CFLAGS+=	-DBSD -DGIT_REVISION='\"${GH_TAGNAME}\"'
 .ifndef WITH_DEBUG
 CFLAGS+=	-DNDEBUG
 .endif
 EXTRACT_AFTER_ARGS=--no-same-owner --no-same-permissions --exclude dependencies
 PLIST_FILES=	bin/lepton
 
+.if !${MACHINE_CPU:Mssse3}
+IGNORE=	requires SSSE3 features in the processor
+.endif
+
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/lepton ${STAGEDIR}${PREFIX}/bin
 

Copied and modified: head/graphics/lepton/files/patch-cpu (from r418567, head/graphics/lepton/files/patch-sse2)
==============================================================================
--- head/graphics/lepton/files/patch-sse2	Fri Jul 15 01:27:43 2016	(r418567, copy source)
+++ head/graphics/lepton/files/patch-cpu	Fri Jul 15 03:05:26 2016	(r418568)
@@ -1,4 +1,4 @@
-Make -- or attempt to -- the code work on CPUs with only SSE2
+Make -- or attempt to -- the code work on CPUs with only SSE3
 instruction set...
 
 	-mi
@@ -207,3 +207,11 @@ instruction set...
 +	    _mm_shuffle_epi32(tmp2, _MM_SHUFFLE (0,0,2,0)));
 +}
 +#endif
++++ src/lepton/recoder.cc
+@@ -99,5 +99,5 @@
+ 
+ static bool aligned_memchr16ff(const unsigned char *local_huff_data) {
+-#if 1
++#if !defined(__i386__)
+     __m128i buf = _mm_load_si128((__m128i const*)local_huff_data);
+     __m128i ff = _mm_set1_epi8(-1);

Added: head/graphics/lepton/files/patch-warnings
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/lepton/files/patch-warnings	Fri Jul 15 03:05:26 2016	(r418568)
@@ -0,0 +1,52 @@
++++ src/io/MemMgrAllocator.cc
+@@ -185,5 +185,5 @@
+     }
+     if (!data) {
+-        fprintf(stderr, "Insufficient memory: unable to mmap or calloc %ld bytes\n", total_size);
++        fprintf(stderr, "Insufficient memory: unable to mmap or calloc %zu bytes\n", total_size);
+         fflush(stderr);
+         exit(37);
++++ test_suite/timing_driver.cc
+@@ -79,5 +81,5 @@
+         }
+     } else {
+-        fprintf(stderr, "Files differ in size %ld != %ld\n", data_size, roundtrip_size);
++        fprintf(stderr, "Files differ in size %zu != %zu\n", data_size, roundtrip_size);
+     }
+     int status;
+@@ -396,5 +398,5 @@
+                                                     leptonBuffer.size());
+         if (result != testImage.size()) {
+-            fprintf(stderr, "Output Size %ld != %ld\n", result, testImage.size());
++            fprintf(stderr, "Output Size %zu != %zu\n", result, testImage.size());
+         }
+         always_assert(result == (size_t)testImage.size() &&
+@@ -508,5 +510,5 @@
+     for (std::vector<const char *>::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
+         testImage = load(*filename);
+-        fprintf(stderr, "Loading iPhone %ld\n", testImage.size());
++        fprintf(stderr, "Loading iPhone %u\n", testImage.size());
+         int retval = run_test(testImage,
+                               use_lepton, jailed, inject_syscall_level, allow_progressive_files, multithread,
++++ src/lepton/validation.cc
+@@ -159,5 +159,5 @@
+     }
+     if (roundtrip_size != size || memcmp(&md5[0], &rtmd5[0], md5.size()) != 0) {
+-        fprintf(stderr, "Input Size %ld != Roundtrip Size %ld\n", size, roundtrip_size);
++        fprintf(stderr, "Input Size %zu != Roundtrip Size %zu\n", size, roundtrip_size);
+         for (size_t i = 0; i < md5.size(); ++i) {
+             fprintf(stderr, "%02x", md5[i]);            
++++ src/io/ioutil.cc
+@@ -339,3 +339,3 @@
+     static_assert(sizeof(buffer) >= header.size(), "Buffer must be able to hold header");
+-    uint32_t cursor = 0;
++    ssize_t cursor = 0;
+     bool finished = false;
++++ src/lepton/jpgcoder.cc
+@@ -1101,5 +1098,5 @@
+     if (false) {
+         fprintf(stderr,
+-                "Predicted Decompress %ld\nAllocated This Run %ld vs Max allocated %ld\nMax Peak Size %ld vs %ld\naug-gbg %ld, garbage %ld\nbit_writer %ld\nmux %d\n",
++                "Predicted Decompress %zu\nAllocated This Run %zu vs Max allocated %zu\nMax Peak Size %zu vs %zu\naug-gbg %zu, garbage %zu\nbit_writer %zu\nmux %d\n",
+                 decom_memory_bound,
+                 Sirikata::memmgr_size_allocated(),



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