From owner-svn-ports-head@freebsd.org Fri Jul 15 03:05:28 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69AA3B97C37; Fri, 15 Jul 2016 03:05:28 +0000 (UTC) (envelope-from mi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A4961157; Fri, 15 Jul 2016 03:05:28 +0000 (UTC) (envelope-from mi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6F35RAg023983; Fri, 15 Jul 2016 03:05:27 GMT (envelope-from mi@FreeBSD.org) Received: (from mi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6F35RIV023980; Fri, 15 Jul 2016 03:05:27 GMT (envelope-from mi@FreeBSD.org) Message-Id: <201607150305.u6F35RIV023980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mi set sender to mi@FreeBSD.org using -f From: Mikhail Teterin Date: Fri, 15 Jul 2016 03:05:27 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r418568 - in head/graphics/lepton: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2016 03:05:28 -0000 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_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(),