From owner-svn-src-vendor@FreeBSD.ORG Mon Dec 26 08:59:18 2011 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06F85106564A; Mon, 26 Dec 2011 08:59:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B05988FC08; Mon, 26 Dec 2011 08:59:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBQ8xHMA097903; Mon, 26 Dec 2011 08:59:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBQ8xH6P097901; Mon, 26 Dec 2011 08:59:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201112260859.pBQ8xH6P097901@svn.freebsd.org> From: Xin LI Date: Mon, 26 Dec 2011 08:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228894 - vendor/netcat/dist X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2011 08:59:18 -0000 Author: delphij Date: Mon Dec 26 08:59:17 2011 New Revision: 228894 URL: http://svn.freebsd.org/changeset/base/228894 Log: Import nc from OpenBSD 5.0. Modified: vendor/netcat/dist/netcat.c Modified: vendor/netcat/dist/netcat.c ============================================================================== --- vendor/netcat/dist/netcat.c Mon Dec 26 08:21:29 2011 (r228893) +++ vendor/netcat/dist/netcat.c Mon Dec 26 08:59:17 2011 (r228894) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.100 2011/01/09 22:16:46 jeremy Exp $ */ +/* $OpenBSD: netcat.c,v 1.101 2011/06/21 17:31:07 mikeb Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -552,7 +552,7 @@ remote_connect(const char *host, const c continue; if (rtableid) { - if (setsockopt(s, IPPROTO_IP, SO_RTABLE, &rtableid, + if (setsockopt(s, SOL_SOCKET, SO_RTABLE, &rtableid, sizeof(rtableid)) == -1) err(1, "setsockopt SO_RTABLE"); } From owner-svn-src-vendor@FreeBSD.ORG Mon Dec 26 09:03:29 2011 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D4081065673; Mon, 26 Dec 2011 09:03:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4204E8FC14; Mon, 26 Dec 2011 09:03:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBQ93TKP098078; Mon, 26 Dec 2011 09:03:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBQ93TWo098077; Mon, 26 Dec 2011 09:03:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201112260903.pBQ93TWo098077@svn.freebsd.org> From: Xin LI Date: Mon, 26 Dec 2011 09:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228895 - vendor/netcat/5.0 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2011 09:03:29 -0000 Author: delphij Date: Mon Dec 26 09:03:28 2011 New Revision: 228895 URL: http://svn.freebsd.org/changeset/base/228895 Log: Tag nc from OpenBSD 5.0. Added: vendor/netcat/5.0/ - copied from r228894, vendor/netcat/dist/ From owner-svn-src-vendor@FreeBSD.ORG Mon Dec 26 22:25:58 2011 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4DD9106566C; Mon, 26 Dec 2011 22:25:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCCCB8FC0A; Mon, 26 Dec 2011 22:25:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBQMPwSN024609; Mon, 26 Dec 2011 22:25:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBQMPwYJ024582; Mon, 26 Dec 2011 22:25:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201112262225.pBQMPwYJ024582@svn.freebsd.org> From: Martin Matuska Date: Mon, 26 Dec 2011 22:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228905 - in vendor/libarchive/dist: . cpio libarchive libarchive/test libarchive_fe tar tar/test X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2011 22:25:58 -0000 Author: mm Date: Mon Dec 26 22:25:58 2011 New Revision: 228905 URL: http://svn.freebsd.org/changeset/base/228905 Log: Update to vendor revision 3982 Obtained from: http://libarchive.googlecode.com/svn/release/2.8 Added: vendor/libarchive/dist/libarchive/test/test_compat_zip_2.zip.uu (contents, props changed) Modified: vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/cpio/bsdcpio.1 vendor/libarchive/dist/cpio/cmdline.c vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/cpio/cpio.h vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_entry.3 vendor/libarchive/dist/libarchive/archive_private.h vendor/libarchive/dist/libarchive/archive_read.3 vendor/libarchive/dist/libarchive/archive_read.c vendor/libarchive/dist/libarchive/archive_read_disk.3 vendor/libarchive/dist/libarchive/archive_read_disk.c vendor/libarchive/dist/libarchive/archive_read_extract.c vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_util.3 vendor/libarchive/dist/libarchive/archive_virtual.c vendor/libarchive/dist/libarchive/archive_write.3 vendor/libarchive/dist/libarchive/archive_write.c vendor/libarchive/dist/libarchive/archive_write_disk.3 vendor/libarchive/dist/libarchive/archive_write_disk.c vendor/libarchive/dist/libarchive/archive_write_set_format_cpio.c vendor/libarchive/dist/libarchive/cpio.5 vendor/libarchive/dist/libarchive/libarchive-formats.5 vendor/libarchive/dist/libarchive/libarchive.3 vendor/libarchive/dist/libarchive/tar.5 vendor/libarchive/dist/libarchive/test/test_acl_freebsd.c vendor/libarchive/dist/libarchive/test/test_compat_zip.c vendor/libarchive/dist/libarchive_fe/pathmatch.c vendor/libarchive/dist/tar/bsdtar.1 vendor/libarchive/dist/tar/read.c vendor/libarchive/dist/tar/test/test_option_s.c vendor/libarchive/dist/tar/tree.c vendor/libarchive/dist/tar/util.c vendor/libarchive/dist/tar/write.c Modified: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/CMakeLists.txt Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/CMakeLists.txt Mon Dec 26 22:25:58 2011 (r228905) @@ -857,12 +857,6 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRE IF(MSVC) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) ENDIF(MSVC) -# Especially for early development, we want to be a little -# aggressive about diagnosing build problems; this can get -# relaxed somewhat in final shipping versions. -IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") - ADD_DEFINITIONS(-Wall -Werror) -ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") IF(ENABLE_TEST) ADD_CUSTOM_TARGET(run_all_tests) Modified: vendor/libarchive/dist/cpio/bsdcpio.1 ============================================================================== --- vendor/libarchive/dist/cpio/bsdcpio.1 Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/cpio/bsdcpio.1 Mon Dec 26 22:25:58 2011 (r228905) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 21, 2007 +.Dd September 5, 2010 .Dt BSDCPIO 1 .Os .Sh NAME @@ -140,7 +140,7 @@ The POSIX.1 tar format. The default format is .Ar odc . See -.Xr libarchive_formats 5 +.Xr libarchive-formats 5 for more complete information about the formats currently supported by the underlying .Xr libarchive 3 @@ -295,7 +295,7 @@ for more information. .Sh EXAMPLES The .Nm -command is traditionally used to copy file heirarchies in conjunction +command is traditionally used to copy file hierarchies in conjunction with the .Xr find 1 command. Modified: vendor/libarchive/dist/cpio/cmdline.c ============================================================================== --- vendor/libarchive/dist/cpio/cmdline.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/cpio/cmdline.c Mon Dec 26 22:25:58 2011 (r228905) @@ -285,6 +285,8 @@ cpio_getopt(struct cpio *cpio) * A period can be used instead of the colon. * * Sets uid/gid return as appropriate, -1 indicates uid/gid not specified. + * TODO: If the spec uses uname/gname, then return those to the caller + * as well. If the spec provides uid/gid, just return names as NULL. * * Returns NULL if no error, otherwise returns error string for display. * Modified: vendor/libarchive/dist/cpio/cpio.c ============================================================================== --- vendor/libarchive/dist/cpio/cpio.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/cpio/cpio.c Mon Dec 26 22:25:58 2011 (r228905) @@ -273,15 +273,21 @@ main(int argc, char *argv[]) cpio->quiet = 1; break; case 'R': /* GNU cpio, also --owner */ + /* TODO: owner_parse should return uname/gname + * also; use that to set [ug]name_override. */ errmsg = owner_parse(cpio->optarg, &uid, &gid); if (errmsg) { lafe_warnc(-1, "%s", errmsg); usage(); } - if (uid != -1) + if (uid != -1) { cpio->uid_override = uid; - if (gid != -1) + cpio->uname_override = NULL; + } + if (gid != -1) { cpio->gid_override = gid; + cpio->gname_override = NULL; + } break; case 'r': /* POSIX 1997 */ cpio->option_rename = 1; @@ -575,10 +581,14 @@ file_to_archive(struct cpio *cpio, const return (r); } - if (cpio->uid_override >= 0) + if (cpio->uid_override >= 0) { archive_entry_set_uid(entry, cpio->uid_override); - if (cpio->gid_override >= 0) + archive_entry_set_uname(entry, cpio->uname_override); + } + if (cpio->gid_override >= 0) { archive_entry_set_gid(entry, cpio->gid_override); + archive_entry_set_gname(entry, cpio->gname_override); + } /* * Generate a destination path for this entry. Modified: vendor/libarchive/dist/cpio/cpio.h ============================================================================== --- vendor/libarchive/dist/cpio/cpio.h Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/cpio/cpio.h Mon Dec 26 22:25:58 2011 (r228905) @@ -68,7 +68,9 @@ struct cpio { size_t pass_destpath_alloc; char *pass_destpath; int uid_override; + char *uname_override; int gid_override; + char *gname_override; int day_first; /* true if locale prefers day/mon */ /* If >= 0, then close this when done. */ Modified: vendor/libarchive/dist/libarchive/archive.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive.h Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive.h Mon Dec 26 22:25:58 2011 (r228905) @@ -493,11 +493,10 @@ __LA_DECL void archive_read_extract_set /* Close the file and release most resources. */ __LA_DECL int archive_read_close(struct archive *); /* Release all resources and destroy the object. */ -/* Note that archive_read_finish will call archive_read_close for you. */ -#if ARCHIVE_VERSION_NUMBER < 2000000 -/* Erroneously declared to return void in libarchive 1.x */ -__LA_DECL void archive_read_finish(struct archive *); -#else +/* Note that archive_read_free will call archive_read_close for you. */ +__LA_DECL int archive_read_free(struct archive *); +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Synonym for archive_read_free() for backwards compatibility. */ __LA_DECL int archive_read_finish(struct archive *); #endif @@ -514,7 +513,7 @@ __LA_DECL int archive_read_finish(stru * - archive_write_header to write the header * - archive_write_data to write the entry data * 5) archive_write_close to close the output - * 6) archive_write_finish to cleanup the writer and release resources + * 6) archive_write_free to cleanup the writer and release resources */ __LA_DECL struct archive *archive_write_new(void); __LA_DECL int archive_write_set_bytes_per_block(struct archive *, @@ -595,13 +594,12 @@ __LA_DECL __LA_SSIZE_T archive_write_da #endif __LA_DECL int archive_write_finish_entry(struct archive *); __LA_DECL int archive_write_close(struct archive *); -#if ARCHIVE_VERSION_NUMBER < 2000000 -/* Return value was incorrect in libarchive 1.x. */ -__LA_DECL void archive_write_finish(struct archive *); -#else -/* Libarchive 2.x and later returns an error if this fails. */ -/* It can fail if the archive wasn't already closed, in which case - * archive_write_finish() will implicitly call archive_write_close(). */ + +/* This can fail if the archive wasn't already closed, in which case + * archive_write_free() will implicitly call archive_write_close(). */ +__LA_DECL int archive_write_free(struct archive *); +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Synonym for archive_write_free() for backwards compatibility. */ __LA_DECL int archive_write_finish(struct archive *); #endif @@ -630,7 +628,7 @@ __LA_DECL int archive_write_set_options * - construct an appropriate struct archive_entry structure * - archive_write_header to create the file/dir/etc on disk * - archive_write_data to write the entry data - * 4) archive_write_finish to cleanup the writer and release resources + * 4) archive_write_free to cleanup the writer and release resources * * In particular, you can use this in conjunction with archive_read() * to pull entries out of an archive and create them on disk. Modified: vendor/libarchive/dist/libarchive/archive_entry.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry.3 Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_entry.3 Mon Dec 26 22:25:58 2011 (r228905) @@ -25,7 +25,7 @@ .\" $FreeBSD: src/lib/libarchive/archive_entry.3,v 1.18 2008/05/26 17:00:22 kientzle Exp $ .\" .Dd May 12, 2008 -.Dt archive_entry 3 +.Dt ARCHIVE_ENTRY 3 .Os .Sh NAME .Nm archive_entry_acl_add_entry , Modified: vendor/libarchive/dist/libarchive/archive_private.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_private.h Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_private.h Mon Dec 26 22:25:58 2011 (r228905) @@ -58,7 +58,7 @@ struct archive_vtable { int (*archive_close)(struct archive *); - int (*archive_finish)(struct archive *); + int (*archive_free)(struct archive *); int (*archive_write_header)(struct archive *, struct archive_entry *); int (*archive_write_finish_entry)(struct archive *); Modified: vendor/libarchive/dist/libarchive/archive_read.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read.3 Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_read.3 Mon Dec 26 22:25:58 2011 (r228905) @@ -25,7 +25,7 @@ .\" $FreeBSD: head/lib/libarchive/archive_read.3 191595 2009-04-27 20:13:13Z kientzle $ .\" .Dd April 13, 2009 -.Dt archive_read 3 +.Dt ARCHIVE_READ 3 .Os .Sh NAME .Nm archive_read_new , @@ -69,7 +69,7 @@ .Nm archive_read_extract2 , .Nm archive_read_extract_set_progress_callback , .Nm archive_read_close , -.Nm archive_read_finish +.Nm archive_read_free .Nd functions for reading streaming archives .Sh SYNOPSIS .In archive.h @@ -196,7 +196,7 @@ .Ft int .Fn archive_read_close "struct archive *" .Ft int -.Fn archive_read_finish "struct archive *" +.Fn archive_read_free "struct archive *" .Sh DESCRIPTION These functions provide a complete API for reading streaming archives. The general process is to first create the @@ -457,7 +457,7 @@ object and the archive_entry object so t can be retrieved for the progress display. .It Fn archive_read_close Complete the archive and invoke the close callback. -.It Fn archive_read_finish +.It Fn archive_read_free Invokes .Fn archive_read_close if it was not invoked manually, then release all resources. @@ -600,7 +600,7 @@ list_archive(const char *name) printf("%s\en",archive_entry_pathname(entry)); archive_read_data_skip(a); } - archive_read_finish(a); + archive_read_free(a); free(mydata); } Modified: vendor/libarchive/dist/libarchive/archive_read.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_read.c Mon Dec 26 22:25:58 2011 (r228905) @@ -60,7 +60,7 @@ static int choose_format(struct archive_ static int cleanup_filters(struct archive_read *); static struct archive_vtable *archive_read_vtable(void); static int _archive_read_close(struct archive *); -static int _archive_read_finish(struct archive *); +static int _archive_read_free(struct archive *); static struct archive_vtable * archive_read_vtable(void) @@ -69,7 +69,7 @@ archive_read_vtable(void) static int inited = 0; if (!inited) { - av.archive_finish = _archive_read_finish; + av.archive_free = _archive_read_free; av.archive_close = _archive_read_close; } return (&av); @@ -779,7 +779,7 @@ cleanup_filters(struct archive_read *a) * Release memory and other resources. */ static int -_archive_read_finish(struct archive *_a) +_archive_read_free(struct archive *_a) { struct archive_read *a = (struct archive_read *)_a; int i; @@ -787,7 +787,7 @@ _archive_read_finish(struct archive *_a) int r = ARCHIVE_OK; __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_ANY, - "archive_read_finish"); + "archive_read_free"); if (a->archive.state != ARCHIVE_STATE_CLOSED) r = archive_read_close(&a->archive); Modified: vendor/libarchive/dist/libarchive/archive_read_disk.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk.3 Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_read_disk.3 Mon Dec 26 22:25:58 2011 (r228905) @@ -25,7 +25,7 @@ .\" $FreeBSD: head/lib/libarchive/archive_read_disk.3 190957 2009-04-12 05:04:02Z kientzle $ .\" .Dd March 10, 2009 -.Dt archive_read_disk 3 +.Dt ARCHIVE_READ_DISK 3 .Os .Sh NAME .Nm archive_read_disk_new , @@ -39,7 +39,7 @@ .Nm archive_read_disk_set_gname_lookup , .Nm archive_read_disk_set_standard_lookup , .Nm archive_read_close , -.Nm archive_read_finish +.Nm archive_read_free .Nd functions for reading objects from disk .Sh SYNOPSIS .In archive.h @@ -81,7 +81,7 @@ .Ft int .Fn archive_read_close "struct archive *" .Ft int -.Fn archive_read_finish "struct archive *" +.Fn archive_read_free "struct archive *" .Sh DESCRIPTION These functions provide an API for reading information about objects on disk. @@ -178,9 +178,9 @@ This affects the file ownership fields a object. .It Fn archive_read_close This currently does nothing. -.It Fn archive_write_finish +.It Fn archive_read_free Invokes -.Fn archive_write_close +.Fn archive_read_close if it was not invoked manually, then releases all resources. .El More information about the @@ -213,7 +213,7 @@ file_to_archive(struct archive *a, const while ((bytes_read = read(fd, buff, sizeof(buff))) > 0) archive_write_data(a, buff, bytes_read); archive_write_finish_entry(a); - archive_read_finish(ard); + archive_read_free(ard); archive_entry_free(entry); } .Ed @@ -276,7 +276,7 @@ and first appeared in The .Nm libarchive library was written by -.An Tim Kientzle Aq kientzle@freebsd.org . +.An Tim Kientzle Aq kientzle@FreeBSD.org . .Sh BUGS The .Dq standard Modified: vendor/libarchive/dist/libarchive/archive_read_disk.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_read_disk.c Mon Dec 26 22:25:58 2011 (r228905) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/ #include "archive_private.h" #include "archive_read_disk_private.h" -static int _archive_read_finish(struct archive *); +static int _archive_read_free(struct archive *); static int _archive_read_close(struct archive *); static const char *trivial_lookup_gname(void *, gid_t gid); static const char *trivial_lookup_uname(void *, uid_t uid); @@ -45,7 +45,7 @@ archive_read_disk_vtable(void) static int inited = 0; if (!inited) { - av.archive_finish = _archive_read_finish; + av.archive_free = _archive_read_free; av.archive_close = _archive_read_close; } return (&av); @@ -129,7 +129,7 @@ archive_read_disk_new(void) } static int -_archive_read_finish(struct archive *_a) +_archive_read_free(struct archive *_a) { struct archive_read_disk *a = (struct archive_read_disk *)_a; Modified: vendor/libarchive/dist/libarchive/archive_read_extract.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_extract.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_read_extract.c Mon Dec 26 22:25:58 2011 (r228905) @@ -173,10 +173,7 @@ archive_read_extract_cleanup(struct arch { int ret = ARCHIVE_OK; -#if ARCHIVE_API_VERSION > 1 - ret = -#endif - archive_write_finish(a->extract->ad); + ret = archive_write_free(a->extract->ad); free(a->extract); a->extract = NULL; return (ret); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c Mon Dec 26 22:25:58 2011 (r228905) @@ -42,6 +42,10 @@ __FBSDID("$FreeBSD: head/lib/libarchive/ #include "archive_private.h" #include "archive_read_private.h" +#ifdef _MSC_VER +#define __packed +#pragma pack(push, 1) +#endif struct cpio_bin_header { unsigned char c_magic[2]; unsigned char c_dev[2]; @@ -54,7 +58,7 @@ struct cpio_bin_header { unsigned char c_mtime[4]; unsigned char c_namesize[2]; unsigned char c_filesize[4]; -}; +} __packed; struct cpio_odc_header { char c_magic[6]; @@ -68,7 +72,7 @@ struct cpio_odc_header { char c_mtime[11]; char c_namesize[6]; char c_filesize[11]; -}; +} __packed; struct cpio_newc_header { char c_magic[6]; @@ -85,7 +89,12 @@ struct cpio_newc_header { char c_rdevminor[8]; char c_namesize[8]; char c_crc[8]; -}; +} __packed; + +#ifdef _MSC_VER +#undef __packed +#pragma pack(pop) +#endif struct links_entry { struct links_entry *next; Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Mon Dec 26 22:25:58 2011 (r228905) @@ -302,8 +302,6 @@ struct file_info { struct file_info *first; struct file_info **last; } rede_files; - /* To check a ininity loop. */ - struct file_info *loop_by; }; struct heap_queue { @@ -1799,26 +1797,82 @@ parse_file_info(struct archive_read *a, file->re = 0; parent->subdirs--; } else if (file->re) { - /* This file's parent is not rr_moved, clear invalid - * "RE" mark. */ - if (parent == NULL || parent->rr_moved == 0) - file->re = 0; - else if ((flags & 0x02) == 0) { - file->rr_moved_has_re_only = 0; - file->re = 0; + /* + * Sanity check: file's parent is rr_moved. + */ + if (parent == NULL || parent->rr_moved == 0) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Invalid Rockridge RE"); + return (NULL); + } + /* + * Sanity check: file does not have "CL" extension. + */ + if (file->cl_offset) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Invalid Rockridge RE and CL"); + return (NULL); + } + /* + * Sanity check: The file type must be a directory. + */ + if ((flags & 0x02) == 0) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Invalid Rockridge RE"); + return (NULL); } } else if (parent != NULL && parent->rr_moved) file->rr_moved_has_re_only = 0; else if (parent != NULL && (flags & 0x02) && (parent->re || parent->re_descendant)) file->re_descendant = 1; - if (file->cl_offset != 0) { + if (file->cl_offset) { + struct file_info *p; + + if (parent == NULL || parent->parent == NULL) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Invalid Rockridge CL"); + return (NULL); + } + /* + * Sanity check: The file type must be a regular file. + */ + if ((flags & 0x02) != 0) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Invalid Rockridge CL"); + return (NULL); + } parent->subdirs++; /* Overwrite an offset and a number of this "CL" entry * to appear before other dirs. "+1" to those is to * make sure to appear after "RE" entry which this * "CL" entry should be connected with. */ file->offset = file->number = file->cl_offset + 1; + + /* + * Sanity check: cl_offset does not point at its + * the parents or itself. + */ + for (p = parent; p; p = p->parent) { + if (p->offset == file->cl_offset) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Invalid Rockridge CL"); + return (NULL); + } + } + if (file->cl_offset == file->offset || + parent->rr_moved) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Invalid Rockridge CL"); + return (NULL); + } } } @@ -1922,6 +1976,13 @@ parse_rockridge(struct archive_read *a, */ break; } + if (p[0] == 'P' && p[1] == 'L') { + /* + * PL extension won't appear; + * contents are always ignored. + */ + break; + } if (p[0] == 'P' && p[1] == 'N') { if (version == 1 && data_length == 16) { file->rdev = toi(data,4); @@ -2697,15 +2758,12 @@ rede_add_entry(struct file_info *file) { struct file_info *re; + /* + * Find "RE" entry. + */ re = file->parent; - while (re != NULL && !re->re) { - /* Sanity check to prevent a infinity loop - * cause by a currupted iso file. */ - if (re->loop_by == file) - return (-1); - re->loop_by = file; + while (re != NULL && !re->re) re = re->parent; - } if (re == NULL) return (-1); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Mon Dec 26 22:25:58 2011 (r228905) @@ -128,6 +128,7 @@ static int archive_read_format_zip_read_ static int archive_read_format_zip_read_data_skip(struct archive_read *a); static int archive_read_format_zip_read_header(struct archive_read *, struct archive_entry *); +static int search_next_signature(struct archive_read *); static int zip_read_data_deflate(struct archive_read *a, const void **buff, size_t *size, off_t *offset); static int zip_read_data_none(struct archive_read *a, const void **buff, @@ -317,10 +318,17 @@ archive_read_format_zip_read_header(stru signature = (const char *)h; } + /* If we don't see a PK signature here, scan forward. */ if (signature[0] != 'P' || signature[1] != 'K') { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, - "Bad ZIP file"); - return (ARCHIVE_FATAL); + r = search_next_signature(a); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Bad ZIP file"); + return (ARCHIVE_FATAL); + } + if ((h = __archive_read_ahead(a, 4, NULL)) == NULL) + return (ARCHIVE_FATAL); + signature = (const char *)h; } /* @@ -375,6 +383,42 @@ archive_read_format_zip_read_header(stru } static int +search_next_signature(struct archive_read *a) +{ + const void *h; + const char *p, *q; + size_t skip; + ssize_t bytes; + int64_t skipped = 0; + + for (;;) { + h = __archive_read_ahead(a, 4, &bytes); + if (h == NULL) + return (ARCHIVE_FATAL); + p = h; + q = p + bytes; + + while (p + 4 <= q) { + if (p[0] == 'P' && p[1] == 'K') { + if ((p[2] == '\001' && p[3] == '\002') + || (p[2] == '\003' && p[3] == '\004') + || (p[2] == '\005' && p[3] == '\006') + || (p[2] == '\007' && p[3] == '\010') + || (p[2] == '0' && p[3] == '0')) { + skip = p - (const char *)h; + __archive_read_consume(a, skip); + return (ARCHIVE_OK); + } + } + ++p; + } + skip = p - (const char *)h; + __archive_read_consume(a, skip); + skipped += skip; + } +} + +static int zip_read_file_header(struct archive_read *a, struct archive_entry *entry, struct zip *zip) { @@ -888,6 +932,9 @@ process_extra(const void* extra, struct if (datasize >= 4) zip->gid = archive_le16dec(p + offset + 2); break; + case 0x7875: + /* Info-Zip Unix Extra Field (type 3) "ux". */ + break; default: break; } Modified: vendor/libarchive/dist/libarchive/archive_util.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_util.3 Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_util.3 Mon Dec 26 22:25:58 2011 (r228905) @@ -25,7 +25,7 @@ .\" $FreeBSD: head/lib/libarchive/archive_util.3 201098 2009-12-28 02:58:14Z kientzle $ .\" .Dd January 8, 2005 -.Dt archive_util 3 +.Dt ARCHIVE_UTIL 3 .Os .Sh NAME .Nm archive_clear_error , Modified: vendor/libarchive/dist/libarchive/archive_virtual.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_virtual.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_virtual.c Mon Dec 26 22:25:58 2011 (r228905) @@ -42,26 +42,35 @@ archive_read_close(struct archive *a) return ((a->vtable->archive_close)(a)); } -#if ARCHIVE_API_VERSION > 1 int -archive_write_finish(struct archive *a) +archive_write_free(struct archive *a) { - return ((a->vtable->archive_finish)(a)); + return ((a->vtable->archive_free)(a)); } -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ -void + +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* For backwards compatibility; will be removed with libarchive 4.0. */ +int archive_write_finish(struct archive *a) { - (void)(a->vtable->archive_finish)(a); + return ((a->vtable->archive_free)(a)); } #endif int +archive_read_free(struct archive *a) +{ + return ((a->vtable->archive_free)(a)); +} + +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* For backwards compatibility; will be removed with libarchive 4.0. */ +int archive_read_finish(struct archive *a) { - return ((a->vtable->archive_finish)(a)); + return ((a->vtable->archive_free)(a)); } +#endif int archive_write_header(struct archive *a, struct archive_entry *entry) @@ -76,12 +85,7 @@ archive_write_finish_entry(struct archiv return ((a->vtable->archive_write_finish_entry)(a)); } -#if ARCHIVE_API_VERSION > 1 ssize_t -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ -int -#endif archive_write_data(struct archive *a, const void *buff, size_t s) { return ((a->vtable->archive_write_data)(a, buff, s)); Modified: vendor/libarchive/dist/libarchive/archive_write.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write.3 Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_write.3 Mon Dec 26 22:25:58 2011 (r228905) @@ -25,7 +25,7 @@ .\" $FreeBSD: head/lib/libarchive/archive_write.3 201110 2009-12-28 03:31:29Z kientzle $ .\" .Dd May 11, 2008 -.Dt archive_write 3 +.Dt ARCHIVE_WRITE 3 .Os .Sh NAME .Nm archive_write_new , @@ -55,7 +55,7 @@ .Nm archive_write_data , .Nm archive_write_finish_entry , .Nm archive_write_close , -.Nm archive_write_finish +.Nm archive_write_free .Nd functions for creating archives .Sh SYNOPSIS .In archive.h @@ -125,7 +125,7 @@ .Ft int .Fn archive_write_close "struct archive *" .Ft int -.Fn archive_write_finish "struct archive *" +.Fn archive_write_free "struct archive *" .Sh DESCRIPTION These functions provide a complete API for creating streaming archive files. @@ -363,16 +363,16 @@ and as needed. .It Fn archive_write_close Complete the archive and invoke the close callback. -.It Fn archive_write_finish +.It Fn archive_write_free Invokes .Fn archive_write_close -if it was not invoked manually, then releases all resources. -Note that this function was declared to return -.Ft void -in libarchive 1.x, which made it impossible to detect errors when +if necessary, then releases all resources. +If you need detailed information about .Fn archive_write_close -was invoked implicitly from this function. -This is corrected beginning with libarchive 2.0. +failures, you should be careful to call it separately, as +you cannot obtain error information after +.Fn archive_write_free +returns. .El More information about the .Va struct archive @@ -529,7 +529,7 @@ write_archive(const char *outname, const archive_entry_free(entry); filename++; } - archive_write_finish(a); + archive_write_free(a); } int main(int argc, const char **argv) @@ -580,7 +580,7 @@ may include .Fn archive_write_data , .Fn archive_write_close , or -.Fn archive_write_finish . +.Fn archive_write_free . The client callback can call .Fn archive_set_error to provide values that can then be retrieved by Modified: vendor/libarchive/dist/libarchive/archive_write.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_write.c Mon Dec 26 22:25:58 2011 (r228905) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/ static struct archive_vtable *archive_write_vtable(void); static int _archive_write_close(struct archive *); -static int _archive_write_finish(struct archive *); +static int _archive_write_free(struct archive *); static int _archive_write_header(struct archive *, struct archive_entry *); static int _archive_write_finish_entry(struct archive *); static ssize_t _archive_write_data(struct archive *, const void *, size_t); @@ -73,7 +73,7 @@ archive_write_vtable(void) if (!inited) { av.archive_close = _archive_write_close; - av.archive_finish = _archive_write_finish; + av.archive_free = _archive_write_free; av.archive_write_header = _archive_write_header; av.archive_write_finish_entry = _archive_write_finish_entry; av.archive_write_data = _archive_write_data; @@ -383,13 +383,13 @@ _archive_write_close(struct archive *_a) * Destroy the archive structure. */ static int -_archive_write_finish(struct archive *_a) +_archive_write_free(struct archive *_a) { struct archive_write *a = (struct archive_write *)_a; int r = ARCHIVE_OK; __archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, - ARCHIVE_STATE_ANY, "archive_write_finish"); + ARCHIVE_STATE_ANY, "archive_write_free"); if (a->archive.state != ARCHIVE_STATE_CLOSED) r = archive_write_close(&a->archive); Modified: vendor/libarchive/dist/libarchive/archive_write_disk.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk.3 Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_write_disk.3 Mon Dec 26 22:25:58 2011 (r228905) @@ -25,7 +25,7 @@ .\" $FreeBSD: src/lib/libarchive/archive_write_disk.3,v 1.4 2008/09/04 05:22:00 kientzle Exp $ .\" .Dd August 5, 2008 -.Dt archive_write_disk 3 +.Dt ARCHIVE_WRITE_DISK 3 .Os .Sh NAME .Nm archive_write_disk_new , @@ -38,7 +38,7 @@ .Nm archive_write_data , .Nm archive_write_finish_entry , .Nm archive_write_close , -.Nm archive_write_finish +.Nm archive_write_free .Nd functions for creating objects on disk .Sh SYNOPSIS .In archive.h @@ -73,7 +73,7 @@ .Ft int .Fn archive_write_close "struct archive *" .Ft int -.Fn archive_write_finish "struct archive *" +.Fn archive_write_free "struct archive *" .Sh DESCRIPTION These functions provide a complete API for creating objects on disk from @@ -239,7 +239,7 @@ The .Nm library maintains a list of all such deferred attributes and sets them when this function is invoked. -.It Fn archive_write_finish +.It Fn archive_write_free Invokes .Fn archive_write_close if it was not invoked manually, then releases all resources. @@ -339,7 +339,7 @@ In particular, the directory .Pa aa is created as well as the final object .Pa bb . -In theory, this can be exploited to create an entire directory heirarchy +In theory, this can be exploited to create an entire directory hierarchy with a single request. Of course, this does not work if the .Cm ARCHIVE_EXTRACT_NODOTDOT @@ -371,5 +371,5 @@ compact implementation when appropriate. .Pp There should be a corresponding .Nm archive_read_disk -interface that walks a directory heirarchy and returns archive +interface that walks a directory hierarchy and returns archive entry objects. \ No newline at end of file Modified: vendor/libarchive/dist/libarchive/archive_write_disk.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_write_disk.c Mon Dec 26 22:25:58 2011 (r228905) @@ -252,7 +252,7 @@ static ssize_t write_data_block(struct a static struct archive_vtable *archive_write_disk_vtable(void); static int _archive_write_close(struct archive *); -static int _archive_write_finish(struct archive *); +static int _archive_write_free(struct archive *); static int _archive_write_header(struct archive *, struct archive_entry *); static int _archive_write_finish_entry(struct archive *); static ssize_t _archive_write_data(struct archive *, const void *, size_t); @@ -291,7 +291,7 @@ archive_write_disk_vtable(void) if (!inited) { av.archive_close = _archive_write_close; - av.archive_finish = _archive_write_finish; + av.archive_free = _archive_write_free; av.archive_write_header = _archive_write_header; av.archive_write_finish_entry = _archive_write_finish_entry; av.archive_write_data = _archive_write_data; @@ -1295,7 +1295,7 @@ _archive_write_close(struct archive *_a) } static int -_archive_write_finish(struct archive *_a) +_archive_write_free(struct archive *_a) { struct archive_write_disk *a = (struct archive_write_disk *)_a; int ret; Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_cpio.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_cpio.c Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_cpio.c Mon Dec 26 22:25:58 2011 (r228905) @@ -62,6 +62,11 @@ struct cpio { size_t ino_list_next; }; +#ifdef _MSC_VER +#define __packed +#pragma pack(push, 1) +#endif + struct cpio_header { char c_magic[6]; char c_dev[6]; @@ -74,7 +79,12 @@ struct cpio_header { char c_mtime[11]; char c_namesize[6]; char c_filesize[11]; -}; +} __packed; + +#ifdef _MSC_VER +#undef __packed +#pragma pack(pop) +#endif /* * Set output format to 'cpio' format. Modified: vendor/libarchive/dist/libarchive/cpio.5 ============================================================================== --- vendor/libarchive/dist/libarchive/cpio.5 Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/cpio.5 Mon Dec 26 22:25:58 2011 (r228905) @@ -268,31 +268,6 @@ data, including ACLs and extended attrib entries in cpio archives. .Pp XXX Others? XXX -.Sh BUGS -The -.Dq CRC -format is mis-named, as it uses a simple checksum and -not a cyclic redundancy check. -.Pp -The old binary format is limited to 16 bits for user id, -group id, device, and inode numbers. -It is limited to 4 gigabyte file sizes. -.Pp -The old ASCII format is limited to 18 bits for -the user id, group id, device, and inode numbers. -It is limited to 8 gigabyte file sizes. -.Pp -The new ASCII format is limited to 4 gigabyte file sizes. -.Pp -None of the cpio formats store user or group names, -which are essential when moving files between systems with -dissimilar user or group numbering. -.Pp -Especially when writing older cpio variants, it may be necessary -to map actual device/inode values to synthesized values that -fit the available fields. -With very large filesystems, this may be necessary even for -the newer formats. .Sh SEE ALSO .Xr cpio 1 , .Xr tar 5 @@ -323,3 +298,28 @@ license. The character format was adopted as part of .St -p1003.1-88 . XXX when did "newc" appear? Who invented it? When did HP come out with their variant? When did Sun introduce ACLs and extended attributes? XXX +.Sh BUGS +The +.Dq CRC +format is mis-named, as it uses a simple checksum and +not a cyclic redundancy check. +.Pp +The old binary format is limited to 16 bits for user id, +group id, device, and inode numbers. +It is limited to 4 gigabyte file sizes. +.Pp +The old ASCII format is limited to 18 bits for +the user id, group id, device, and inode numbers. +It is limited to 8 gigabyte file sizes. +.Pp +The new ASCII format is limited to 4 gigabyte file sizes. +.Pp +None of the cpio formats store user or group names, +which are essential when moving files between systems with +dissimilar user or group numbering. +.Pp +Especially when writing older cpio variants, it may be necessary +to map actual device/inode values to synthesized values that +fit the available fields. +With very large filesystems, this may be necessary even for +the newer formats. Modified: vendor/libarchive/dist/libarchive/libarchive-formats.5 ============================================================================== --- vendor/libarchive/dist/libarchive/libarchive-formats.5 Mon Dec 26 21:51:53 2011 (r228904) +++ vendor/libarchive/dist/libarchive/libarchive-formats.5 Mon Dec 26 22:25:58 2011 (r228905) @@ -25,7 +25,7 @@ .\" $FreeBSD: head/lib/libarchive/libarchive-formats.5 201077 2009-12-28 01:50:23Z kientzle $ .\" .Dd December 27, 2009 -.Dt libarchive-formats 5 +.Dt LIBARCHIVE-FORMATS 5 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Tue Dec 27 10:21:29 2011 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB74E1065672; Tue, 27 Dec 2011 10:21:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA6438FC12; Tue, 27 Dec 2011 10:21:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBRALTkr048599; Tue, 27 Dec 2011 10:21:29 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBRALT5R048597; Tue, 27 Dec 2011 10:21:29 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201112271021.pBRALT5R048597@svn.freebsd.org> From: Martin Matuska Date: Tue, 27 Dec 2011 10:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228908 - vendor/libarchive/dist/libarchive X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2011 10:21:30 -0000 Author: mm Date: Tue Dec 27 10:21:29 2011 New Revision: 228908 URL: http://svn.freebsd.org/changeset/base/228908 Log: Update to vendor revision 4016 Obtained from: http://libarchive.googlecode.com/svn/release/2.8 Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Tue Dec 27 10:16:24 2011 (r228907) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Tue Dec 27 10:21:29 2011 (r228908) @@ -1830,7 +1830,7 @@ parse_file_info(struct archive_read *a, (parent->re || parent->re_descendant)) file->re_descendant = 1; if (file->cl_offset) { - struct file_info *p; + struct file_info *r; if (parent == NULL || parent->parent == NULL) { archive_set_error(&a->archive, @@ -1858,8 +1858,8 @@ parse_file_info(struct archive_read *a, * Sanity check: cl_offset does not point at its * the parents or itself. */ - for (p = parent; p; p = p->parent) { - if (p->offset == file->cl_offset) { + for (r = parent; r; r = r->parent) { + if (r->offset == file->cl_offset) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Invalid Rockridge CL"); From owner-svn-src-vendor@FreeBSD.ORG Sat Dec 31 14:55:24 2011 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFF491065673; Sat, 31 Dec 2011 14:55:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D64528FC0A; Sat, 31 Dec 2011 14:55:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBVEtORL069405; Sat, 31 Dec 2011 14:55:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBVEtOkJ069353; Sat, 31 Dec 2011 14:55:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201112311455.pBVEtOkJ069353@svn.freebsd.org> From: Ed Schouten Date: Sat, 31 Dec 2011 14:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229109 - in vendor/compiler-rt/dist: . SDKs SDKs/darwin SDKs/darwin/usr SDKs/darwin/usr/include SDKs/darwin/usr/include/sys SDKs/linux SDKs/linux/usr SDKs/linux/usr/include SDKs/linux/... X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2011 14:55:25 -0000 Author: ed Date: Sat Dec 31 14:55:23 2011 New Revision: 229109 URL: http://svn.freebsd.org/changeset/base/229109 Log: Import compiler-rt r147390. Added: vendor/compiler-rt/dist/SDKs/ vendor/compiler-rt/dist/SDKs/README.txt vendor/compiler-rt/dist/SDKs/darwin/ vendor/compiler-rt/dist/SDKs/darwin/README.txt vendor/compiler-rt/dist/SDKs/darwin/usr/ vendor/compiler-rt/dist/SDKs/darwin/usr/include/ vendor/compiler-rt/dist/SDKs/darwin/usr/include/limits.h vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/ vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/stat.h vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/types.h vendor/compiler-rt/dist/SDKs/linux/ vendor/compiler-rt/dist/SDKs/linux/README.txt vendor/compiler-rt/dist/SDKs/linux/usr/ vendor/compiler-rt/dist/SDKs/linux/usr/include/ vendor/compiler-rt/dist/SDKs/linux/usr/include/endian.h vendor/compiler-rt/dist/SDKs/linux/usr/include/limits.h vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/ vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/stat.h vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/types.h vendor/compiler-rt/dist/SDKs/linux/usr/include/unistd.h vendor/compiler-rt/dist/lib/asan/ vendor/compiler-rt/dist/lib/asan/Makefile.mk vendor/compiler-rt/dist/lib/asan/Makefile.old vendor/compiler-rt/dist/lib/asan/README.txt vendor/compiler-rt/dist/lib/asan/asan_allocator.cc vendor/compiler-rt/dist/lib/asan/asan_allocator.h vendor/compiler-rt/dist/lib/asan/asan_globals.cc vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc vendor/compiler-rt/dist/lib/asan/asan_interceptors.h vendor/compiler-rt/dist/lib/asan/asan_interface.h vendor/compiler-rt/dist/lib/asan/asan_internal.h vendor/compiler-rt/dist/lib/asan/asan_linux.cc vendor/compiler-rt/dist/lib/asan/asan_lock.h vendor/compiler-rt/dist/lib/asan/asan_mac.cc vendor/compiler-rt/dist/lib/asan/asan_mac.h vendor/compiler-rt/dist/lib/asan/asan_malloc_linux.cc vendor/compiler-rt/dist/lib/asan/asan_malloc_mac.cc vendor/compiler-rt/dist/lib/asan/asan_mapping.h vendor/compiler-rt/dist/lib/asan/asan_poisoning.cc vendor/compiler-rt/dist/lib/asan/asan_printf.cc vendor/compiler-rt/dist/lib/asan/asan_rtl.cc vendor/compiler-rt/dist/lib/asan/asan_stack.cc vendor/compiler-rt/dist/lib/asan/asan_stack.h vendor/compiler-rt/dist/lib/asan/asan_stats.cc vendor/compiler-rt/dist/lib/asan/asan_stats.h vendor/compiler-rt/dist/lib/asan/asan_thread.cc vendor/compiler-rt/dist/lib/asan/asan_thread.h vendor/compiler-rt/dist/lib/asan/asan_thread_registry.cc vendor/compiler-rt/dist/lib/asan/asan_thread_registry.h vendor/compiler-rt/dist/lib/asan/mach_override/ vendor/compiler-rt/dist/lib/asan/mach_override/LICENSE.TXT vendor/compiler-rt/dist/lib/asan/mach_override/Makefile.mk vendor/compiler-rt/dist/lib/asan/mach_override/README.txt vendor/compiler-rt/dist/lib/asan/mach_override/mach_override.c vendor/compiler-rt/dist/lib/asan/mach_override/mach_override.h vendor/compiler-rt/dist/lib/asan/scripts/ vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py (contents, props changed) vendor/compiler-rt/dist/lib/asan/sysinfo/ vendor/compiler-rt/dist/lib/asan/sysinfo/LICENSE.TXT vendor/compiler-rt/dist/lib/asan/sysinfo/Makefile.mk vendor/compiler-rt/dist/lib/asan/sysinfo/basictypes.h vendor/compiler-rt/dist/lib/asan/sysinfo/sysinfo.cc vendor/compiler-rt/dist/lib/asan/sysinfo/sysinfo.h vendor/compiler-rt/dist/lib/asan/tests/ vendor/compiler-rt/dist/lib/asan/tests/asan_benchmarks_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_break_optimization.cc vendor/compiler-rt/dist/lib/asan/tests/asan_exceptions_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_globals_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_interface_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test.h vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test.mm vendor/compiler-rt/dist/lib/asan/tests/asan_noinst_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_test.ignore vendor/compiler-rt/dist/lib/asan/tests/asan_test_config.h vendor/compiler-rt/dist/lib/asan/tests/asan_test_utils.h vendor/compiler-rt/dist/lib/asan/tests/dlclose-test-so.cc vendor/compiler-rt/dist/lib/asan/tests/dlclose-test.cc vendor/compiler-rt/dist/lib/asan/tests/dlclose-test.tmpl vendor/compiler-rt/dist/lib/asan/tests/global-overflow.cc vendor/compiler-rt/dist/lib/asan/tests/global-overflow.tmpl vendor/compiler-rt/dist/lib/asan/tests/heap-overflow.cc vendor/compiler-rt/dist/lib/asan/tests/heap-overflow.tmpl vendor/compiler-rt/dist/lib/asan/tests/heap-overflow.tmpl.Darwin vendor/compiler-rt/dist/lib/asan/tests/large_func_test.cc vendor/compiler-rt/dist/lib/asan/tests/large_func_test.tmpl vendor/compiler-rt/dist/lib/asan/tests/match_output.py (contents, props changed) vendor/compiler-rt/dist/lib/asan/tests/null_deref.cc vendor/compiler-rt/dist/lib/asan/tests/null_deref.tmpl vendor/compiler-rt/dist/lib/asan/tests/shared-lib-test-so.cc vendor/compiler-rt/dist/lib/asan/tests/shared-lib-test.cc vendor/compiler-rt/dist/lib/asan/tests/shared-lib-test.tmpl vendor/compiler-rt/dist/lib/asan/tests/stack-overflow.cc vendor/compiler-rt/dist/lib/asan/tests/stack-overflow.tmpl vendor/compiler-rt/dist/lib/asan/tests/stack-use-after-return.cc vendor/compiler-rt/dist/lib/asan/tests/stack-use-after-return.disabled vendor/compiler-rt/dist/lib/asan/tests/strncpy-overflow.cc vendor/compiler-rt/dist/lib/asan/tests/strncpy-overflow.tmpl vendor/compiler-rt/dist/lib/asan/tests/test_output.sh (contents, props changed) vendor/compiler-rt/dist/lib/asan/tests/use-after-free.c vendor/compiler-rt/dist/lib/asan/tests/use-after-free.cc vendor/compiler-rt/dist/lib/asan/tests/use-after-free.tmpl vendor/compiler-rt/dist/lib/int_endianness.h vendor/compiler-rt/dist/lib/int_math.h vendor/compiler-rt/dist/lib/int_types.h vendor/compiler-rt/dist/lib/int_util.c vendor/compiler-rt/dist/lib/int_util.h vendor/compiler-rt/dist/lib/mulodi4.c vendor/compiler-rt/dist/lib/mulosi4.c vendor/compiler-rt/dist/lib/muloti4.c vendor/compiler-rt/dist/lib/profile/ vendor/compiler-rt/dist/lib/profile/GCDAProfiling.c vendor/compiler-rt/dist/lib/profile/Makefile.mk vendor/compiler-rt/dist/make/platform/clang_darwin_test_input.c vendor/compiler-rt/dist/make/platform/clang_linux.mk vendor/compiler-rt/dist/test/Unit/mulodi4_test.c vendor/compiler-rt/dist/test/Unit/mulosi4_test.c vendor/compiler-rt/dist/test/Unit/muloti4_test.c Deleted: vendor/compiler-rt/dist/lib/abi.h vendor/compiler-rt/dist/lib/endianness.h Modified: vendor/compiler-rt/dist/.gitignore vendor/compiler-rt/dist/LICENSE.TXT vendor/compiler-rt/dist/Makefile vendor/compiler-rt/dist/README.txt vendor/compiler-rt/dist/lib/Makefile.mk vendor/compiler-rt/dist/lib/absvdi2.c vendor/compiler-rt/dist/lib/absvsi2.c vendor/compiler-rt/dist/lib/absvti2.c vendor/compiler-rt/dist/lib/adddf3.c vendor/compiler-rt/dist/lib/addsf3.c vendor/compiler-rt/dist/lib/addvdi3.c vendor/compiler-rt/dist/lib/addvsi3.c vendor/compiler-rt/dist/lib/addvti3.c vendor/compiler-rt/dist/lib/arm/Makefile.mk vendor/compiler-rt/dist/lib/arm/adddf3vfp.S vendor/compiler-rt/dist/lib/arm/addsf3vfp.S vendor/compiler-rt/dist/lib/arm/divdf3vfp.S vendor/compiler-rt/dist/lib/arm/divsf3vfp.S vendor/compiler-rt/dist/lib/arm/eqdf2vfp.S vendor/compiler-rt/dist/lib/arm/eqsf2vfp.S vendor/compiler-rt/dist/lib/arm/extendsfdf2vfp.S vendor/compiler-rt/dist/lib/arm/fixdfsivfp.S vendor/compiler-rt/dist/lib/arm/fixsfsivfp.S vendor/compiler-rt/dist/lib/arm/fixunsdfsivfp.S vendor/compiler-rt/dist/lib/arm/fixunssfsivfp.S vendor/compiler-rt/dist/lib/arm/floatsidfvfp.S vendor/compiler-rt/dist/lib/arm/floatsisfvfp.S vendor/compiler-rt/dist/lib/arm/floatunssidfvfp.S vendor/compiler-rt/dist/lib/arm/floatunssisfvfp.S vendor/compiler-rt/dist/lib/arm/gedf2vfp.S vendor/compiler-rt/dist/lib/arm/gesf2vfp.S vendor/compiler-rt/dist/lib/arm/gtdf2vfp.S vendor/compiler-rt/dist/lib/arm/gtsf2vfp.S vendor/compiler-rt/dist/lib/arm/ledf2vfp.S vendor/compiler-rt/dist/lib/arm/lesf2vfp.S vendor/compiler-rt/dist/lib/arm/ltdf2vfp.S vendor/compiler-rt/dist/lib/arm/ltsf2vfp.S vendor/compiler-rt/dist/lib/arm/muldf3vfp.S vendor/compiler-rt/dist/lib/arm/mulsf3vfp.S vendor/compiler-rt/dist/lib/arm/nedf2vfp.S vendor/compiler-rt/dist/lib/arm/negdf2vfp.S vendor/compiler-rt/dist/lib/arm/negsf2vfp.S vendor/compiler-rt/dist/lib/arm/nesf2vfp.S vendor/compiler-rt/dist/lib/arm/subdf3vfp.S vendor/compiler-rt/dist/lib/arm/subsf3vfp.S vendor/compiler-rt/dist/lib/arm/truncdfsf2vfp.S vendor/compiler-rt/dist/lib/arm/unorddf2vfp.S vendor/compiler-rt/dist/lib/arm/unordsf2vfp.S vendor/compiler-rt/dist/lib/ashldi3.c vendor/compiler-rt/dist/lib/ashrdi3.c vendor/compiler-rt/dist/lib/assembly.h vendor/compiler-rt/dist/lib/clear_cache.c vendor/compiler-rt/dist/lib/clzdi2.c vendor/compiler-rt/dist/lib/clzsi2.c vendor/compiler-rt/dist/lib/cmpdi2.c vendor/compiler-rt/dist/lib/ctzdi2.c vendor/compiler-rt/dist/lib/ctzsi2.c vendor/compiler-rt/dist/lib/divdc3.c vendor/compiler-rt/dist/lib/divdf3.c vendor/compiler-rt/dist/lib/divdi3.c vendor/compiler-rt/dist/lib/divmoddi4.c vendor/compiler-rt/dist/lib/divmodsi4.c vendor/compiler-rt/dist/lib/divsc3.c vendor/compiler-rt/dist/lib/divsf3.c vendor/compiler-rt/dist/lib/divsi3.c vendor/compiler-rt/dist/lib/divxc3.c vendor/compiler-rt/dist/lib/enable_execute_stack.c vendor/compiler-rt/dist/lib/eprintf.c vendor/compiler-rt/dist/lib/extendsfdf2.c vendor/compiler-rt/dist/lib/ffsdi2.c vendor/compiler-rt/dist/lib/fixdfdi.c vendor/compiler-rt/dist/lib/fixdfsi.c vendor/compiler-rt/dist/lib/fixsfdi.c vendor/compiler-rt/dist/lib/fixsfsi.c vendor/compiler-rt/dist/lib/fixunsdfdi.c vendor/compiler-rt/dist/lib/fixunsdfsi.c vendor/compiler-rt/dist/lib/fixunssfdi.c vendor/compiler-rt/dist/lib/fixunssfsi.c vendor/compiler-rt/dist/lib/floatdidf.c vendor/compiler-rt/dist/lib/floatdisf.c vendor/compiler-rt/dist/lib/floatsidf.c vendor/compiler-rt/dist/lib/floatsisf.c vendor/compiler-rt/dist/lib/floattidf.c vendor/compiler-rt/dist/lib/floattisf.c vendor/compiler-rt/dist/lib/floattixf.c vendor/compiler-rt/dist/lib/floatundidf.c vendor/compiler-rt/dist/lib/floatundisf.c vendor/compiler-rt/dist/lib/floatunsidf.c vendor/compiler-rt/dist/lib/floatunsisf.c vendor/compiler-rt/dist/lib/floatuntidf.c vendor/compiler-rt/dist/lib/floatuntisf.c vendor/compiler-rt/dist/lib/floatuntixf.c vendor/compiler-rt/dist/lib/fp_lib.h vendor/compiler-rt/dist/lib/gcc_personality_v0.c vendor/compiler-rt/dist/lib/i386/Makefile.mk vendor/compiler-rt/dist/lib/int_lib.h vendor/compiler-rt/dist/lib/lshrdi3.c vendor/compiler-rt/dist/lib/moddi3.c vendor/compiler-rt/dist/lib/modsi3.c vendor/compiler-rt/dist/lib/muldc3.c vendor/compiler-rt/dist/lib/muldf3.c vendor/compiler-rt/dist/lib/muldi3.c vendor/compiler-rt/dist/lib/mulsc3.c vendor/compiler-rt/dist/lib/mulsf3.c vendor/compiler-rt/dist/lib/mulvdi3.c vendor/compiler-rt/dist/lib/mulvsi3.c vendor/compiler-rt/dist/lib/mulvti3.c vendor/compiler-rt/dist/lib/mulxc3.c vendor/compiler-rt/dist/lib/negdf2.c vendor/compiler-rt/dist/lib/negsf2.c vendor/compiler-rt/dist/lib/negvdi2.c vendor/compiler-rt/dist/lib/negvsi2.c vendor/compiler-rt/dist/lib/negvti2.c vendor/compiler-rt/dist/lib/paritydi2.c vendor/compiler-rt/dist/lib/paritysi2.c vendor/compiler-rt/dist/lib/popcountdi2.c vendor/compiler-rt/dist/lib/popcountsi2.c vendor/compiler-rt/dist/lib/powidf2.c vendor/compiler-rt/dist/lib/powisf2.c vendor/compiler-rt/dist/lib/ppc/DD.h vendor/compiler-rt/dist/lib/ppc/Makefile.mk vendor/compiler-rt/dist/lib/ppc/divtc3.c vendor/compiler-rt/dist/lib/ppc/fixtfdi.c vendor/compiler-rt/dist/lib/ppc/fixunstfdi.c vendor/compiler-rt/dist/lib/ppc/floatditf.c vendor/compiler-rt/dist/lib/ppc/floatunditf.c vendor/compiler-rt/dist/lib/ppc/multc3.c vendor/compiler-rt/dist/lib/subdf3.c vendor/compiler-rt/dist/lib/subsf3.c vendor/compiler-rt/dist/lib/subvdi3.c vendor/compiler-rt/dist/lib/subvsi3.c vendor/compiler-rt/dist/lib/subvti3.c vendor/compiler-rt/dist/lib/trampoline_setup.c vendor/compiler-rt/dist/lib/truncdfsf2.c vendor/compiler-rt/dist/lib/ucmpdi2.c vendor/compiler-rt/dist/lib/udivdi3.c vendor/compiler-rt/dist/lib/udivmoddi4.c vendor/compiler-rt/dist/lib/udivmodsi4.c vendor/compiler-rt/dist/lib/udivmodti4.c vendor/compiler-rt/dist/lib/udivsi3.c vendor/compiler-rt/dist/lib/umoddi3.c vendor/compiler-rt/dist/lib/umodsi3.c vendor/compiler-rt/dist/lib/x86_64/Makefile.mk vendor/compiler-rt/dist/lib/x86_64/floatdidf.c vendor/compiler-rt/dist/lib/x86_64/floatdisf.c vendor/compiler-rt/dist/lib/x86_64/floatdixf.c vendor/compiler-rt/dist/make/AppleBI.mk vendor/compiler-rt/dist/make/config.mk vendor/compiler-rt/dist/make/lib_info.mk vendor/compiler-rt/dist/make/options.mk vendor/compiler-rt/dist/make/platform/clang_darwin.mk vendor/compiler-rt/dist/make/platform/darwin_bni.mk vendor/compiler-rt/dist/make/platform/darwin_fat.mk vendor/compiler-rt/dist/make/platform/multi_arch.mk vendor/compiler-rt/dist/make/subdir.mk vendor/compiler-rt/dist/www/index.html Modified: vendor/compiler-rt/dist/.gitignore ============================================================================== --- vendor/compiler-rt/dist/.gitignore Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/.gitignore Sat Dec 31 14:55:23 2011 (r229109) @@ -1,4 +1,4 @@ *~ -Debug -Release -Profile +darwin_fat +clang_darwin +multi_arch Modified: vendor/compiler-rt/dist/LICENSE.TXT ============================================================================== --- vendor/compiler-rt/dist/LICENSE.TXT Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/LICENSE.TXT Sat Dec 31 14:55:23 2011 (r229109) @@ -74,3 +74,25 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE F LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +============================================================================== +Copyrights and Licenses for Third Party Software Distributed with LLVM: +============================================================================== +The LLVM software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the LLVM Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + +The following pieces of software have additional or alternate copyrights, +licenses, and/or restrictions: + +Program Directory +------- --------- +sysinfo lib/asan/sysinfo +mach_override lib/asan/mach_override Modified: vendor/compiler-rt/dist/Makefile ============================================================================== --- vendor/compiler-rt/dist/Makefile Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/Makefile Sat Dec 31 14:55:23 2011 (r229109) @@ -164,6 +164,7 @@ define PerPlatformConfigArch_template $(call Set,Tmp.Arch,$(1)) $(call Set,Tmp.ObjPath,$(ProjObjRoot)/$(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch)) $(call Set,Tmp.Functions,$(strip \ + $(AlwaysRequiredModules) \ $(call GetCNAVar,FUNCTIONS,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) $(call Set,Tmp.Optimized,$(strip \ $(call GetCNAVar,OPTIMIZED,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) @@ -226,7 +227,10 @@ $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.S $ $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c -o $$@ $$< $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.c $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir $(Summary) " COMPILE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" - $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c -o $$@ $$< + $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c $(COMMON_CFLAGS) -o $$@ $$< +$(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.cc $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir + $(Summary) " COMPILE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" + $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c $(COMMON_CXXFLAGS) -o $$@ $$< .PRECIOUS: $(Tmp.ObjPath)/.dir endef Modified: vendor/compiler-rt/dist/README.txt ============================================================================== --- vendor/compiler-rt/dist/README.txt Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/README.txt Sat Dec 31 14:55:23 2011 (r229109) @@ -106,6 +106,15 @@ si_int __mulvsi3(si_int a, si_int b); / di_int __mulvdi3(di_int a, di_int b); // a * b ti_int __mulvti3(ti_int a, ti_int b); // a * b + +// Integral arithmetic which returns if overflow + +si_int __mulosi4(si_int a, si_int b, int* overflow); // a * b, overflow set to one if result not in signed range +di_int __mulodi4(di_int a, di_int b, int* overflow); // a * b, overflow set to one if result not in signed range +ti_int __muloti4(ti_int a, ti_int b, int* overflow); // a * b, overflow set to + one if result not in signed range + + // Integral comparison: a < b -> 0 // a == b -> 1 // a > b -> 2 Added: vendor/compiler-rt/dist/SDKs/README.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/README.txt Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,9 @@ +It is often convenient to be able to build compiler-rt libraries for a certain +platform without having a full SDK or development environment installed. + +This makes it easy for users to build a compiler which can target a number of +different platforms, without having to actively maintain full development +environments for those platforms. + +Since compiler-rt's libraries typically have minimal interaction with the +system, we achieve this by stubbing out the SDKs of certain platforms. Added: vendor/compiler-rt/dist/SDKs/darwin/README.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/README.txt Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,3 @@ +The Darwin platforms are all similar enough we roll them into one SDK, and use +preprocessor tricks to get the right definitions for the few things which +diverge between OS X and iOS. Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/limits.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/limits.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,23 @@ +/* ===-- limits.h - stub SDK header for compiler-rt -------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __LIMITS_H__ +#define __LIMITS_H__ + +/* This is only here as a landing pad for the include_next from the compiler's + built-in limits.h. */ + +#endif /* __LIMITS_H__ */ Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,61 @@ +/* ===-- stdio.h - stub SDK header for compiler-rt --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __STDIO_H__ +#define __STDIO_H__ + +typedef struct __sFILE FILE; +typedef __SIZE_TYPE__ size_t; + +/* Determine the appropriate fopen() and fwrite() functions. */ +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) +# if defined(__i386) +# define __FOPEN_NAME "_fopen$UNIX2003" +# define __FWRITE_NAME "_fwrite$UNIX2003" +# elif defined(__x86_64__) +# define __FOPEN_NAME "_fopen" +# define __FWRITE_NAME "_fwrite" +# elif defined(__arm) +# define __FOPEN_NAME "_fopen" +# define __FWRITE_NAME "_fwrite" +# else +# error "unrecognized architecture for targetting OS X" +# endif +#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) +# if defined(__i386) || defined (__x86_64) +# define __FOPEN_NAME "_fopen" +# define __FWRITE_NAME "_fwrite" +# elif defined(__arm) +# define __FOPEN_NAME "_fopen" +# define __FWRITE_NAME "_fwrite" +# else +# error "unrecognized architecture for targetting iOS" +# endif +#else +# error "unrecognized architecture for targetting Darwin" +#endif + +# define stderr __stderrp +extern FILE *__stderrp; + +int fclose(FILE *); +int fflush(FILE *); +FILE *fopen(const char * restrict, const char * restrict) __asm(__FOPEN_NAME); +int fprintf(FILE * restrict, const char * restrict, ...); +size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict) + __asm(__FWRITE_NAME); + +#endif /* __STDIO_H__ */ Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,29 @@ +/* ===-- stdlib.h - stub SDK header for compiler-rt -------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __STDLIB_H__ +#define __STDLIB_H__ + +#define NULL ((void *)0) + +typedef __SIZE_TYPE__ size_t; + +void abort(void) __attribute__((__noreturn__)); +void free(void *); +char *getenv(const char *); +void *malloc(size_t); + +#endif /* __STDLIB_H__ */ Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,28 @@ +/* ===-- string.h - stub SDK header for compiler-rt -------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __STRING_H__ +#define __STRING_H__ + +typedef __SIZE_TYPE__ size_t; + +char *strcat(char *, const char *); +char *strcpy(char *, const char *); +char *strdup(const char *); +size_t strlen(const char *); +char *strncpy(char *, const char *, size_t); + +#endif /* __STRING_H__ */ Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/stat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/stat.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,25 @@ +/* ===-- stat.h - stub SDK header for compiler-rt ---------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __SYS_STAT_H__ +#define __SYS_STAT_H__ + +typedef unsigned short uint16_t; +typedef uint16_t mode_t; + +int mkdir(const char *, mode_t); + +#endif /* __SYS_STAT_H__ */ Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/types.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,20 @@ +/* ===-- types.h - stub SDK header for compiler-rt --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __SYS_TYPES_H__ +#define __SYS_TYPES_H__ + +#endif /* __SYS_TYPES_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/README.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/README.txt Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,2 @@ +This is a stub SDK for Linux. Currently, this has only been tested on i386 and +x86_64 using the Clang compiler. Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/endian.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/endian.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,29 @@ +/* ===-- endian.h - stub SDK header for compiler-rt -------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __ENDIAN_H__ +#define __ENDIAN_H__ + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 + +#if defined(__LITTLE_ENDIAN__) || defined(__ORDER_LITTLE_ENDIAN__) +#define __BYTE_ORDER __LITTLE_ENDIAN +#else +#define __BYTE_ORDER __BIG_ENDIAN +#endif + +#endif /* __ENDIAN_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/limits.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/limits.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,23 @@ +/* ===-- limits.h - stub SDK header for compiler-rt -------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __LIMITS_H__ +#define __LIMITS_H__ + +/* This is only here as a landing pad for the include_next from the compiler's + built-in limits.h. */ + +#endif /* __LIMITS_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,35 @@ +/* ===-- stdio.h - stub SDK header for compiler-rt --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __STDIO_H__ +#define __STDIO_H__ + +typedef __SIZE_TYPE__ size_t; + +struct _IO_FILE; +typedef struct _IO_FILE FILE; + +extern struct _IO_FILE *stdin; +extern struct _IO_FILE *stdout; +extern struct _IO_FILE *stderr; + +extern int fclose(FILE *); +extern int fflush(FILE *); +extern FILE *fopen(const char * restrict, const char * restrict); +extern int fprintf(FILE * restrict, const char * restrict, ...); +extern size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict); + +#endif /* __STDIO_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,32 @@ +/* ===-- stdlib.h - stub SDK header for compiler-rt -------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __STDLIB_H__ +#define __STDLIB_H__ + +#define NULL ((void *)0) + +typedef __SIZE_TYPE__ size_t; + +void abort(void) __attribute__((__nothrow__)) __attribute__((__noreturn__)); +void free(void *) __attribute__((__nothrow__)); +char *getenv(const char *) __attribute__((__nothrow__)) + __attribute__((__nonnull__(1))); + __attribute__((__warn_unused_result__)); +void *malloc(size_t) __attribute__((__nothrow__)) __attribute((__malloc__)) + __attribute__((__warn_unused_result__)); + +#endif /* __STDLIB_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,28 @@ +/* ===-- string.h - stub SDK header for compiler-rt -------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __STRING_H__ +#define __STRING_H__ + +typedef __SIZE_TYPE__ size_t; + +char *strcat(char *, const char *); +char *strcpy(char *, const char *); +char *strdup(const char *); +size_t strlen(const char *); +char *strncpy(char *, const char *, size_t); + +#endif /* __STRING_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,29 @@ +/* ===-- limits.h - stub SDK header for compiler-rt -------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __SYS_MMAN_H__ +#define __SYS_MMAN_H__ + +typedef __SIZE_TYPE__ size_t; + +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +#define PROT_EXEC 0x4 + +extern int mprotect (void *__addr, size_t __len, int __prot) + __attribute__((__nothrow__)); + +#endif /* __SYS_MMAN_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/stat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/stat.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,24 @@ +/* ===-- stat.h - stub SDK header for compiler-rt ---------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __SYS_STAT_H__ +#define __SYS_STAT_H__ + +typedef unsigned int mode_t; + +int mkdir(const char *, mode_t); + +#endif /* __SYS_STAT_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/types.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,20 @@ +/* ===-- stat.h - stub SDK header for compiler-rt ---------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __SYS_TYPES_H__ +#define __SYS_TYPES_H__ + +#endif /* __SYS_TYPES_H__ */ Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/unistd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/unistd.h Sat Dec 31 14:55:23 2011 (r229109) @@ -0,0 +1,26 @@ +/* ===-- unistd.h - stub SDK header for compiler-rt -------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef __UNISTD_H__ +#define __UNISTD_H__ + +enum { + _SC_PAGESIZE = 30 +}; + +extern long int sysconf (int __name) __attribute__ ((__nothrow__)); + +#endif /* __UNISTD_H__ */ Modified: vendor/compiler-rt/dist/lib/Makefile.mk ============================================================================== --- vendor/compiler-rt/dist/lib/Makefile.mk Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/Makefile.mk Sat Dec 31 14:55:23 2011 (r229109) @@ -7,8 +7,17 @@ # #===------------------------------------------------------------------------===# -SubDirs := i386 ppc x86_64 arm +ModuleName := builtins +SubDirs := +# Add arch specific optimized implementations. +SubDirs += i386 ppc x86_64 arm + +# Add other submodules. +SubDirs += asan +SubDirs += profile + +# Define the variables for this specific directory. Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file))) ObjNames := $(Sources:%.c=%.o) Implementation := Generic Modified: vendor/compiler-rt/dist/lib/absvdi2.c ============================================================================== --- vendor/compiler-rt/dist/lib/absvdi2.c Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/absvdi2.c Sat Dec 31 14:55:23 2011 (r229109) @@ -11,10 +11,8 @@ * *===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" -#include /* Returns: absolute value */ Modified: vendor/compiler-rt/dist/lib/absvsi2.c ============================================================================== --- vendor/compiler-rt/dist/lib/absvsi2.c Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/absvsi2.c Sat Dec 31 14:55:23 2011 (r229109) @@ -11,10 +11,8 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" -#include /* Returns: absolute value */ Modified: vendor/compiler-rt/dist/lib/absvti2.c ============================================================================== --- vendor/compiler-rt/dist/lib/absvti2.c Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/absvti2.c Sat Dec 31 14:55:23 2011 (r229109) @@ -15,7 +15,6 @@ #if __x86_64 #include "int_lib.h" -#include /* Returns: absolute value */ Modified: vendor/compiler-rt/dist/lib/adddf3.c ============================================================================== --- vendor/compiler-rt/dist/lib/adddf3.c Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/adddf3.c Sat Dec 31 14:55:23 2011 (r229109) @@ -12,8 +12,6 @@ // //===----------------------------------------------------------------------===// -#include "abi.h" - #define DOUBLE_PRECISION #include "fp_lib.h" Modified: vendor/compiler-rt/dist/lib/addsf3.c ============================================================================== --- vendor/compiler-rt/dist/lib/addsf3.c Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/addsf3.c Sat Dec 31 14:55:23 2011 (r229109) @@ -12,8 +12,6 @@ // //===----------------------------------------------------------------------===// -#include "abi.h" - #define SINGLE_PRECISION #include "fp_lib.h" Modified: vendor/compiler-rt/dist/lib/addvdi3.c ============================================================================== --- vendor/compiler-rt/dist/lib/addvdi3.c Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/addvdi3.c Sat Dec 31 14:55:23 2011 (r229109) @@ -11,10 +11,8 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" -#include /* Returns: a + b */ Modified: vendor/compiler-rt/dist/lib/addvsi3.c ============================================================================== --- vendor/compiler-rt/dist/lib/addvsi3.c Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/addvsi3.c Sat Dec 31 14:55:23 2011 (r229109) @@ -11,10 +11,8 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" -#include /* Returns: a + b */ Modified: vendor/compiler-rt/dist/lib/addvti3.c ============================================================================== --- vendor/compiler-rt/dist/lib/addvti3.c Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/addvti3.c Sat Dec 31 14:55:23 2011 (r229109) @@ -15,7 +15,6 @@ #if __x86_64 #include "int_lib.h" -#include /* Returns: a + b */ Modified: vendor/compiler-rt/dist/lib/arm/Makefile.mk ============================================================================== --- vendor/compiler-rt/dist/lib/arm/Makefile.mk Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/Makefile.mk Sat Dec 31 14:55:23 2011 (r229109) @@ -7,6 +7,7 @@ # #===------------------------------------------------------------------------===# +ModuleName := builtins SubDirs := OnlyArchs := armv5 armv6 armv7 Modified: vendor/compiler-rt/dist/lib/arm/adddf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/adddf3vfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/adddf3vfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -15,10 +15,11 @@ // Adds two double precision floating point numbers using the Darwin // calling convention where double arguments are passsed in GPR pairs // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__adddf3vfp) - fmdrr d6, r0, r1 // move first param from r0/r1 pair into d6 - fmdrr d7, r2, r3 // move second param from r2/r3 pair into d7 - faddd d6, d6, d7 - fmrrd r0, r1, d6 // move result back to r0/r1 pair + vmov d6, r0, r1 // move first param from r0/r1 pair into d6 + vmov d7, r2, r3 // move second param from r2/r3 pair into d7 + vadd.f64 d6, d6, d7 + vmov r0, r1, d6 // move result back to r0/r1 pair bx lr Modified: vendor/compiler-rt/dist/lib/arm/addsf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/addsf3vfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/addsf3vfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -15,10 +15,11 @@ // Adds two single precision floating point numbers using the Darwin // calling convention where single arguments are passsed in GPRs // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__addsf3vfp) - fmsr s14, r0 // move first param from r0 into float register - fmsr s15, r1 // move second param from r1 into float register - fadds s14, s14, s15 - fmrs r0, s14 // move result back to r0 + vmov s14, r0 // move first param from r0 into float register + vmov s15, r1 // move second param from r1 into float register + vadd.f32 s14, s14, s15 + vmov r0, s14 // move result back to r0 bx lr Modified: vendor/compiler-rt/dist/lib/arm/divdf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/divdf3vfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/divdf3vfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -15,10 +15,11 @@ // Divides two double precision floating point numbers using the Darwin // calling convention where double arguments are passsed in GPR pairs // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__divdf3vfp) - fmdrr d6, r0, r1 // move first param from r0/r1 pair into d6 - fmdrr d7, r2, r3 // move second param from r2/r3 pair into d7 - fdivd d5, d6, d7 - fmrrd r0, r1, d5 // move result back to r0/r1 pair + vmov d6, r0, r1 // move first param from r0/r1 pair into d6 + vmov d7, r2, r3 // move second param from r2/r3 pair into d7 + vdiv.f64 d5, d6, d7 + vmov r0, r1, d5 // move result back to r0/r1 pair bx lr Modified: vendor/compiler-rt/dist/lib/arm/divsf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/divsf3vfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/divsf3vfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -15,10 +15,11 @@ // Divides two single precision floating point numbers using the Darwin // calling convention where single arguments are passsed like 32-bit ints. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__divsf3vfp) - fmsr s14, r0 // move first param from r0 into float register - fmsr s15, r1 // move second param from r1 into float register - fdivs s13, s14, s15 - fmrs r0, s13 // move result back to r0 + vmov s14, r0 // move first param from r0 into float register + vmov s15, r1 // move second param from r1 into float register + vdiv.f32 s13, s14, s15 + vmov r0, s13 // move result back to r0 bx lr Modified: vendor/compiler-rt/dist/lib/arm/eqdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/eqdf2vfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/eqdf2vfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where double precision arguments are passsed // like in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__eqdf2vfp) - fmdrr d6, r0, r1 // load r0/r1 pair in double register - fmdrr d7, r2, r3 // load r2/r3 pair in double register - fcmpd d6, d7 - fmstat + vmov d6, r0, r1 // load r0/r1 pair in double register + vmov d7, r2, r3 // load r2/r3 pair in double register + vcmp.f64 d6, d7 + vmrs apsr_nzcv, fpscr moveq r0, #1 // set result register to 1 if equal movne r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/arm/eqsf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/eqsf2vfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/eqsf2vfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where single precision arguments are passsed // like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__eqsf2vfp) - fmsr s14, r0 // move from GPR 0 to float register - fmsr s15, r1 // move from GPR 1 to float register - fcmps s14, s15 - fmstat + vmov s14, r0 // move from GPR 0 to float register + vmov s15, r1 // move from GPR 1 to float register + vcmp.f32 s14, s15 + vmrs apsr_nzcv, fpscr moveq r0, #1 // set result register to 1 if equal movne r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/arm/extendsfdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/extendsfdf2vfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/extendsfdf2vfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a single precision parameter is // passed in a GPR and a double precision result is returned in R0/R1 pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__extendsfdf2vfp) - fmsr s15, r0 // load float register from R0 - fcvtds d7, s15 // convert single to double - fmrrd r0, r1, d7 // return result in r0/r1 pair + vmov s15, r0 // load float register from R0 + vcvt.f64.f32 d7, s15 // convert single to double + vmov r0, r1, d7 // return result in r0/r1 pair bx lr Modified: vendor/compiler-rt/dist/lib/arm/fixdfsivfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/fixdfsivfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/fixdfsivfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a double precision parameter is // passed in GPR register pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__fixdfsivfp) - fmdrr d7, r0, r1 // load double register from R0/R1 - ftosizd s15, d7 // convert double to 32-bit int into s15 - fmrs r0, s15 // move s15 to result register + vmov d7, r0, r1 // load double register from R0/R1 + vcvt.s32.f64 s15, d7 // convert double to 32-bit int into s15 + vmov r0, s15 // move s15 to result register bx lr Modified: vendor/compiler-rt/dist/lib/arm/fixsfsivfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/fixsfsivfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/fixsfsivfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a single precision parameter is // passed in a GPR.. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__fixsfsivfp) - fmsr s15, r0 // load float register from R0 - ftosizs s15, s15 // convert single to 32-bit int into s15 - fmrs r0, s15 // move s15 to result register + vmov s15, r0 // load float register from R0 + vcvt.s32.f32 s15, s15 // convert single to 32-bit int into s15 + vmov r0, s15 // move s15 to result register bx lr Modified: vendor/compiler-rt/dist/lib/arm/fixunsdfsivfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/fixunsdfsivfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/fixunsdfsivfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -17,9 +17,10 @@ // Uses Darwin calling convention where a double precision parameter is // passed in GPR register pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__fixunsdfsivfp) - fmdrr d7, r0, r1 // load double register from R0/R1 - ftouizd s15, d7 // convert double to 32-bit int into s15 - fmrs r0, s15 // move s15 to result register + vmov d7, r0, r1 // load double register from R0/R1 + vcvt.u32.f64 s15, d7 // convert double to 32-bit int into s15 + vmov r0, s15 // move s15 to result register bx lr Modified: vendor/compiler-rt/dist/lib/arm/fixunssfsivfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/fixunssfsivfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/fixunssfsivfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -17,9 +17,10 @@ // Uses Darwin calling convention where a single precision parameter is // passed in a GPR.. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__fixunssfsivfp) - fmsr s15, r0 // load float register from R0 - ftouizs s15, s15 // convert single to 32-bit unsigned into s15 - fmrs r0, s15 // move s15 to result register + vmov s15, r0 // load float register from R0 + vcvt.u32.f32 s15, s15 // convert single to 32-bit unsigned into s15 + vmov r0, s15 // move s15 to result register bx lr Modified: vendor/compiler-rt/dist/lib/arm/floatsidfvfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/floatsidfvfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/floatsidfvfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a double precision result is // return in GPR register pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__floatsidfvfp) - fmsr s15, r0 // move int to float register s15 - fsitod d7, s15 // convert 32-bit int in s15 to double in d7 - fmrrd r0, r1, d7 // move d7 to result register pair r0/r1 + vmov s15, r0 // move int to float register s15 + vcvt.f64.s32 d7, s15 // convert 32-bit int in s15 to double in d7 + vmov r0, r1, d7 // move d7 to result register pair r0/r1 bx lr Modified: vendor/compiler-rt/dist/lib/arm/floatsisfvfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/floatsisfvfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/floatsisfvfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a single precision result is // return in a GPR.. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__floatsisfvfp) - fmsr s15, r0 // move int to float register s15 - fsitos s15, s15 // convert 32-bit int in s15 to float in s15 - fmrs r0, s15 // move s15 to result register + vmov s15, r0 // move int to float register s15 + vcvt.f32.s32 s15, s15 // convert 32-bit int in s15 to float in s15 + vmov r0, s15 // move s15 to result register bx lr Modified: vendor/compiler-rt/dist/lib/arm/floatunssidfvfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/floatunssidfvfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/floatunssidfvfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a double precision result is // return in GPR register pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__floatunssidfvfp) - fmsr s15, r0 // move int to float register s15 - fuitod d7, s15 // convert 32-bit int in s15 to double in d7 - fmrrd r0, r1, d7 // move d7 to result register pair r0/r1 + vmov s15, r0 // move int to float register s15 + vcvt.f64.u32 d7, s15 // convert 32-bit int in s15 to double in d7 + vmov r0, r1, d7 // move d7 to result register pair r0/r1 bx lr Modified: vendor/compiler-rt/dist/lib/arm/floatunssisfvfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/floatunssisfvfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/floatunssisfvfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a single precision result is // return in a GPR.. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__floatunssisfvfp) - fmsr s15, r0 // move int to float register s15 - fuitos s15, s15 // convert 32-bit int in s15 to float in s15 - fmrs r0, s15 // move s15 to result register + vmov s15, r0 // move int to float register s15 + vcvt.f32.u32 s15, s15 // convert 32-bit int in s15 to float in s15 + vmov r0, s15 // move s15 to result register bx lr Modified: vendor/compiler-rt/dist/lib/arm/gedf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/gedf2vfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/gedf2vfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where double precision arguments are passsed // like in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__gedf2vfp) - fmdrr d6, r0, r1 // load r0/r1 pair in double register - fmdrr d7, r2, r3 // load r2/r3 pair in double register - fcmpd d6, d7 - fmstat + vmov d6, r0, r1 // load r0/r1 pair in double register + vmov d7, r2, r3 // load r2/r3 pair in double register + vcmp.f64 d6, d7 + vmrs apsr_nzcv, fpscr movge r0, #1 // set result register to 1 if greater than or equal movlt r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/arm/gesf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/gesf2vfp.S Sat Dec 31 14:54:30 2011 (r229108) +++ vendor/compiler-rt/dist/lib/arm/gesf2vfp.S Sat Dec 31 14:55:23 2011 (r229109) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where single precision arguments are passsed // like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__gesf2vfp) - fmsr s14, r0 // move from GPR 0 to float register - fmsr s15, r1 // move from GPR 1 to float register - fcmps s14, s15 - fmstat + vmov s14, r0 // move from GPR 0 to float register + vmov s15, r1 // move from GPR 1 to float register + vcmp.f32 s14, s15 + vmrs apsr_nzcv, fpscr movge r0, #1 // set result register to 1 if greater than or equal movlt r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/arm/gtdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/arm/gtdf2vfp.S Sat Dec 31 14:54:30 2011 (r229108) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Sat Dec 31 14:56:27 2011 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 530E31065673; Sat, 31 Dec 2011 14:56:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 238CA8FC0A; Sat, 31 Dec 2011 14:56:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBVEuQu5069493; Sat, 31 Dec 2011 14:56:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBVEuQX4069492; Sat, 31 Dec 2011 14:56:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201112311456.pBVEuQX4069492@svn.freebsd.org> From: Ed Schouten Date: Sat, 31 Dec 2011 14:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229110 - vendor/compiler-rt/compiler-rt-r147390 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2011 14:56:27 -0000 Author: ed Date: Sat Dec 31 14:56:26 2011 New Revision: 229110 URL: http://svn.freebsd.org/changeset/base/229110 Log: Tag compiler-rt r147390. Added: vendor/compiler-rt/compiler-rt-r147390/ - copied from r229109, vendor/compiler-rt/dist/ From owner-svn-src-vendor@FreeBSD.ORG Sat Dec 31 22:35:47 2011 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4502E106564A; Sat, 31 Dec 2011 22:35:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FBED8FC1B; Sat, 31 Dec 2011 22:35:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBVMZlrg085979; Sat, 31 Dec 2011 22:35:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBVMZll5085971; Sat, 31 Dec 2011 22:35:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201112312235.pBVMZll5085971@svn.freebsd.org> From: Adrian Chadd Date: Sat, 31 Dec 2011 22:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229159 - in vendor/xz-embedded: . dist dist/linux dist/linux/Documentation dist/linux/include dist/linux/include/linux dist/linux/include/linux/decompress dist/linux/lib dist/linux/lib... X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2011 22:35:47 -0000 Author: adrian Date: Sat Dec 31 22:35:46 2011 New Revision: 229159 URL: http://svn.freebsd.org/changeset/base/229159 Log: Import xz-embedded from git. This is from commit hash '48f4588342f4a4e0182a6740e25675fd8e6c6295'. Added: vendor/xz-embedded/ vendor/xz-embedded/dist/ vendor/xz-embedded/dist/COPYING vendor/xz-embedded/dist/README vendor/xz-embedded/dist/linux/ vendor/xz-embedded/dist/linux/Documentation/ vendor/xz-embedded/dist/linux/Documentation/xz.txt vendor/xz-embedded/dist/linux/include/ vendor/xz-embedded/dist/linux/include/linux/ vendor/xz-embedded/dist/linux/include/linux/decompress/ vendor/xz-embedded/dist/linux/include/linux/decompress/unxz.h vendor/xz-embedded/dist/linux/include/linux/xz.h vendor/xz-embedded/dist/linux/lib/ vendor/xz-embedded/dist/linux/lib/decompress_unxz.c vendor/xz-embedded/dist/linux/lib/xz/ vendor/xz-embedded/dist/linux/lib/xz/Kconfig vendor/xz-embedded/dist/linux/lib/xz/Makefile vendor/xz-embedded/dist/linux/lib/xz/xz_crc32.c vendor/xz-embedded/dist/linux/lib/xz/xz_dec_bcj.c vendor/xz-embedded/dist/linux/lib/xz/xz_dec_lzma2.c vendor/xz-embedded/dist/linux/lib/xz/xz_dec_stream.c vendor/xz-embedded/dist/linux/lib/xz/xz_dec_syms.c vendor/xz-embedded/dist/linux/lib/xz/xz_dec_test.c vendor/xz-embedded/dist/linux/lib/xz/xz_lzma2.h vendor/xz-embedded/dist/linux/lib/xz/xz_private.h vendor/xz-embedded/dist/linux/lib/xz/xz_stream.h vendor/xz-embedded/dist/linux/scripts/ vendor/xz-embedded/dist/linux/scripts/xz_wrap.sh (contents, props changed) vendor/xz-embedded/dist/userspace/ vendor/xz-embedded/dist/userspace/Makefile vendor/xz-embedded/dist/userspace/boottest.c vendor/xz-embedded/dist/userspace/buftest.c vendor/xz-embedded/dist/userspace/xz_config.h vendor/xz-embedded/dist/userspace/xzminidec.c Added: vendor/xz-embedded/dist/COPYING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/xz-embedded/dist/COPYING Sat Dec 31 22:35:46 2011 (r229159) @@ -0,0 +1,10 @@ + +Licensing of XZ Embedded +======================== + + All the files in this package have been written by Lasse Collin + and/or Igor Pavlov. All these files have been put into the + public domain. You can do whatever you want with these files. + + As usual, this software is provided "as is", without any warranty. + Added: vendor/xz-embedded/dist/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/xz-embedded/dist/README Sat Dec 31 22:35:46 2011 (r229159) @@ -0,0 +1,127 @@ + +XZ Embedded +=========== + + XZ Embedded is a relatively small, limited implementation of the .xz + file format. Currently only decoding is implemented. + + XZ Embedded was written for use in the Linux kernel, but the code can + be easily used in other environments too, including regular userspace + applications. + + This README contains information that is useful only when the copy + of XZ Embedded isn't part of the Linux kernel tree. You should also + read linux/Documentation/xz.txt even if you aren't using XZ Embedded + as part of Linux; information in that file is not repeated in this + README. + +Compiling the Linux kernel module + + The xz_dec module depends on crc32 module, so make sure that you have + it enabled (CONFIG_CRC32). + + Building the xz_dec and xz_dec_test modules without support for BCJ + filters: + + cd linux/lib/xz + make -C /path/to/kernel/source \ + KCPPFLAGS=-I"$(pwd)/../../include" M="$(pwd)" \ + CONFIG_XZ_DEC=m CONFIG_XZ_DEC_TEST=m + + Building the xz_dec and xz_dec_test modules with support for BCJ + filters: + + cd linux/lib/xz + make -C /path/to/kernel/source \ + KCPPFLAGS=-I"$(pwd)/../../include" M="$(pwd)" \ + CONFIG_XZ_DEC=m CONFIG_XZ_DEC_TEST=m CONFIG_XZ_DEC_BCJ=y \ + CONFIG_XZ_DEC_X86=y CONFIG_XZ_DEC_POWERPC=y \ + CONFIG_XZ_DEC_IA64=y CONFIG_XZ_DEC_ARM=y \ + CONFIG_XZ_DEC_ARMTHUMB=y CONFIG_XZ_DEC_SPARC=y + + If you want only one or a few of the BCJ filters, omit the appropriate + variables. CONFIG_XZ_DEC_BCJ=y is always required to build the support + code shared between all BCJ filters. + + Most people don't need the xz_dec_test module. You can skip building + it by omitting CONFIG_XZ_DEC_TEST=m from the make command line. + +Compiler requirements + + XZ Embedded should compile as either GNU-C89 (used in the Linux + kernel) or with any C99 compiler. Getting the code to compile with + non-GNU C89 compiler or a C++ compiler should be quite easy as + long as there is a data type for unsigned 64-bit integer (or the + code is modified not to support large files, which needs some more + care than just using 32-bit integer instead of 64-bit). + + If you use GCC, try to use a recent version. For example, on x86-32, + xz_dec_lzma2.c compiled with GCC 3.3.6 is 15-25 % slower than when + compiled with GCC 4.3.3. + +Embedding into userspace applications + + To embed the XZ decoder, copy the following files into a single + directory in your source code tree: + + linux/include/linux/xz.h + linux/lib/xz/xz_crc32.c + linux/lib/xz/xz_dec_lzma2.c + linux/lib/xz/xz_dec_stream.c + linux/lib/xz/xz_lzma2.h + linux/lib/xz/xz_private.h + linux/lib/xz/xz_stream.h + userspace/xz_config.h + + Alternatively, xz.h may be placed into a different directory but then + that directory must be in the compiler include path when compiling + the .c files. + + Your code should use only the functions declared in xz.h. The rest of + the .h files are meant only for internal use in XZ Embedded. + + You may want to modify xz_config.h to be more suitable for your build + environment. Probably you should at least skim through it even if the + default file works as is. + +BCJ filter support + + If you want support for one or more BCJ filters, you need to copy also + linux/lib/xz/xz_dec_bcj.c into your application, and use appropriate + #defines in xz_config.h or in compiler flags. You don't need these + #defines in the code that just uses XZ Embedded via xz.h, but having + them always #defined doesn't hurt either. + + #define Instruction set BCJ filter endianness + XZ_DEC_X86 x86-32 or x86-64 Little endian only + XZ_DEC_POWERPC PowerPC Big endian only + XZ_DEC_IA64 Itanium (IA-64) Big or little endian + XZ_DEC_ARM ARM Little endian only + XZ_DEC_ARMTHUMB ARM-Thumb Little endian only + XZ_DEC_SPARC SPARC Big or little endian + + While some architectures are (partially) bi-endian, the endianness + setting doesn't change the endianness of the instructions on all + architectures. That's why Itanium and SPARC filters work for both big + and little endian executables (Itanium has little endian instructions + and SPARC has big endian instructions). + + There currently is no filter for little endian PowerPC or big endian + ARM or ARM-Thumb. Implementing filters for them can be considered if + there is a need for such filters in real-world applications. + +Notes about shared libraries + + If you are including XZ Embedded into a shared library, you very + probably should rename the xz_* functions to prevent symbol + conflicts in case your library is linked against some other library + or application that also has XZ Embedded in it (which may even be + a different version of XZ Embedded). TODO: Provide an easy way + to do this. + + Please don't create a shared library of XZ Embedded itself unless + it is fine to rebuild everything depending on that shared library + everytime you upgrade to a newer version of XZ Embedded. There are + no API or ABI stability guarantees between different versions of + XZ Embedded. + Added: vendor/xz-embedded/dist/linux/Documentation/xz.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/xz-embedded/dist/linux/Documentation/xz.txt Sat Dec 31 22:35:46 2011 (r229159) @@ -0,0 +1,122 @@ + +XZ data compression in Linux +============================ + +Introduction + + XZ is a general purpose data compression format with high compression + ratio and relatively fast decompression. The primary compression + algorithm (filter) is LZMA2. Additional filters can be used to improve + compression ratio even further. E.g. Branch/Call/Jump (BCJ) filters + improve compression ratio of executable data. + + The XZ decompressor in Linux is called XZ Embedded. It supports + the LZMA2 filter and optionally also BCJ filters. CRC32 is supported + for integrity checking. The home page of XZ Embedded is at + , where you can find the + latest version and also information about using the code outside + the Linux kernel. + + For userspace, XZ Utils provide a zlib-like compression library + and a gzip-like command line tool. XZ Utils can be downloaded from + . + +XZ related components in the kernel + + The xz_dec module provides XZ decompressor with single-call (buffer + to buffer) and multi-call (stateful) APIs. The usage of the xz_dec + module is documented in include/linux/xz.h. + + The xz_dec_test module is for testing xz_dec. xz_dec_test is not + useful unless you are hacking the XZ decompressor. xz_dec_test + allocates a char device major dynamically to which one can write + .xz files from userspace. The decompressed output is thrown away. + Keep an eye on dmesg to see diagnostics printed by xz_dec_test. + See the xz_dec_test source code for the details. + + For decompressing the kernel image, initramfs, and initrd, there + is a wrapper function in lib/decompress_unxz.c. Its API is the + same as in other decompress_*.c files, which is defined in + include/linux/decompress/generic.h. + + scripts/xz_wrap.sh is a wrapper for the xz command line tool found + from XZ Utils. The wrapper sets compression options to values suitable + for compressing the kernel image. + + For kernel makefiles, two commands are provided for use with + $(call if_needed). The kernel image should be compressed with + $(call if_needed,xzkern) which will use a BCJ filter and a big LZMA2 + dictionary. It will also append a four-byte trailer containing the + uncompressed size of the file, which is needed by the boot code. + Other things should be compressed with $(call if_needed,xzmisc) + which will use no BCJ filter and 1 MiB LZMA2 dictionary. + +Notes on compression options + + Since the XZ Embedded supports only streams with no integrity check or + CRC32, make sure that you don't use some other integrity check type + when encoding files that are supposed to be decoded by the kernel. With + liblzma, you need to use either LZMA_CHECK_NONE or LZMA_CHECK_CRC32 + when encoding. With the xz command line tool, use --check=none or + --check=crc32. + + Using CRC32 is strongly recommended unless there is some other layer + which will verify the integrity of the uncompressed data anyway. + Double checking the integrity would probably be waste of CPU cycles. + Note that the headers will always have a CRC32 which will be validated + by the decoder; you can only change the integrity check type (or + disable it) for the actual uncompressed data. + + In userspace, LZMA2 is typically used with dictionary sizes of several + megabytes. The decoder needs to have the dictionary in RAM, thus big + dictionaries cannot be used for files that are intended to be decoded + by the kernel. 1 MiB is probably the maximum reasonable dictionary + size for in-kernel use (maybe more is OK for initramfs). The presets + in XZ Utils may not be optimal when creating files for the kernel, + so don't hesitate to use custom settings. Example: + + xz --check=crc32 --lzma2=dict=512KiB inputfile + + An exception to above dictionary size limitation is when the decoder + is used in single-call mode. Decompressing the kernel itself is an + example of this situation. In single-call mode, the memory usage + doesn't depend on the dictionary size, and it is perfectly fine to + use a big dictionary: for maximum compression, the dictionary should + be at least as big as the uncompressed data itself. + +Future plans + + Creating a limited XZ encoder may be considered if people think it is + useful. LZMA2 is slower to compress than e.g. Deflate or LZO even at + the fastest settings, so it isn't clear if LZMA2 encoder is wanted + into the kernel. + + Support for limited random-access reading is planned for the + decompression code. I don't know if it could have any use in the + kernel, but I know that it would be useful in some embedded projects + outside the Linux kernel. + +Conformance to the .xz file format specification + + There are a couple of corner cases where things have been simplified + at expense of detecting errors as early as possible. These should not + matter in practice all, since they don't cause security issues. But + it is good to know this if testing the code e.g. with the test files + from XZ Utils. + +Reporting bugs + + Before reporting a bug, please check that it's not fixed already + at upstream. See to get the + latest code. + + Report bugs to or visit #tukaani on + Freenode and talk to Larhzu. I don't actively read LKML or other + kernel-related mailing lists, so if there's something I should know, + you should email to me personally or use IRC. + + Don't bother Igor Pavlov with questions about the XZ implementation + in the kernel or about XZ Utils. While these two implementations + include essential code that is directly based on Igor Pavlov's code, + these implementations aren't maintained nor supported by him. + Added: vendor/xz-embedded/dist/linux/include/linux/decompress/unxz.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/xz-embedded/dist/linux/include/linux/decompress/unxz.h Sat Dec 31 22:35:46 2011 (r229159) @@ -0,0 +1,19 @@ +/* + * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd + * + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#ifndef DECOMPRESS_UNXZ_H +#define DECOMPRESS_UNXZ_H + +int unxz(unsigned char *in, int in_size, + int (*fill)(void *dest, unsigned int size), + int (*flush)(void *src, unsigned int size), + unsigned char *out, int *in_used, + void (*error)(char *x)); + +#endif Added: vendor/xz-embedded/dist/linux/include/linux/xz.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/xz-embedded/dist/linux/include/linux/xz.h Sat Dec 31 22:35:46 2011 (r229159) @@ -0,0 +1,273 @@ +/* + * XZ decompressor + * + * Authors: Lasse Collin + * Igor Pavlov + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#ifndef XZ_H +#define XZ_H + +#ifdef __KERNEL__ +# include +# include +#else +# include +# include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* In Linux, this is used to make extern functions static when needed. */ +#ifndef XZ_EXTERN +# define XZ_EXTERN extern +#endif + +/** + * enum xz_mode - Operation mode + * + * @XZ_SINGLE: Single-call mode. This uses less RAM than + * than multi-call modes, because the LZMA2 + * dictionary doesn't need to be allocated as + * part of the decoder state. All required data + * structures are allocated at initialization, + * so xz_dec_run() cannot return XZ_MEM_ERROR. + * @XZ_PREALLOC: Multi-call mode with preallocated LZMA2 + * dictionary buffer. All data structures are + * allocated at initialization, so xz_dec_run() + * cannot return XZ_MEM_ERROR. + * @XZ_DYNALLOC: Multi-call mode. The LZMA2 dictionary is + * allocated once the required size has been + * parsed from the stream headers. If the + * allocation fails, xz_dec_run() will return + * XZ_MEM_ERROR. + * + * It is possible to enable support only for a subset of the above + * modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC, + * or XZ_DEC_DYNALLOC. The xz_dec kernel module is always compiled + * with support for all operation modes, but the preboot code may + * be built with fewer features to minimize code size. + */ +enum xz_mode { + XZ_SINGLE, + XZ_PREALLOC, + XZ_DYNALLOC +}; + +/** + * enum xz_ret - Return codes + * @XZ_OK: Everything is OK so far. More input or more + * output space is required to continue. This + * return code is possible only in multi-call mode + * (XZ_PREALLOC or XZ_DYNALLOC). + * @XZ_STREAM_END: Operation finished successfully. + * @XZ_UNSUPPORTED_CHECK: Integrity check type is not supported. Decoding + * is still possible in multi-call mode by simply + * calling xz_dec_run() again. + * Note that this return value is used only if + * XZ_DEC_ANY_CHECK was defined at build time, + * which is not used in the kernel. Unsupported + * check types return XZ_OPTIONS_ERROR if + * XZ_DEC_ANY_CHECK was not defined at build time. + * @XZ_MEM_ERROR: Allocating memory failed. This return code is + * possible only if the decoder was initialized + * with XZ_DYNALLOC. The amount of memory that was + * tried to be allocated was no more than the + * dict_max argument given to xz_dec_init(). + * @XZ_MEMLIMIT_ERROR: A bigger LZMA2 dictionary would be needed than + * allowed by the dict_max argument given to + * xz_dec_init(). This return value is possible + * only in multi-call mode (XZ_PREALLOC or + * XZ_DYNALLOC); the single-call mode (XZ_SINGLE) + * ignores the dict_max argument. + * @XZ_FORMAT_ERROR: File format was not recognized (wrong magic + * bytes). + * @XZ_OPTIONS_ERROR: This implementation doesn't support the requested + * compression options. In the decoder this means + * that the header CRC32 matches, but the header + * itself specifies something that we don't support. + * @XZ_DATA_ERROR: Compressed data is corrupt. + * @XZ_BUF_ERROR: Cannot make any progress. Details are slightly + * different between multi-call and single-call + * mode; more information below. + * + * In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls + * to XZ code cannot consume any input and cannot produce any new output. + * This happens when there is no new input available, or the output buffer + * is full while at least one output byte is still pending. Assuming your + * code is not buggy, you can get this error only when decoding a compressed + * stream that is truncated or otherwise corrupt. + * + * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer + * is too small or the compressed input is corrupt in a way that makes the + * decoder produce more output than the caller expected. When it is + * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR + * is used instead of XZ_BUF_ERROR. + */ +enum xz_ret { + XZ_OK, + XZ_STREAM_END, + XZ_UNSUPPORTED_CHECK, + XZ_MEM_ERROR, + XZ_MEMLIMIT_ERROR, + XZ_FORMAT_ERROR, + XZ_OPTIONS_ERROR, + XZ_DATA_ERROR, + XZ_BUF_ERROR +}; + +/** + * struct xz_buf - Passing input and output buffers to XZ code + * @in: Beginning of the input buffer. This may be NULL if and only + * if in_pos is equal to in_size. + * @in_pos: Current position in the input buffer. This must not exceed + * in_size. + * @in_size: Size of the input buffer + * @out: Beginning of the output buffer. This may be NULL if and only + * if out_pos is equal to out_size. + * @out_pos: Current position in the output buffer. This must not exceed + * out_size. + * @out_size: Size of the output buffer + * + * Only the contents of the output buffer from out[out_pos] onward, and + * the variables in_pos and out_pos are modified by the XZ code. + */ +struct xz_buf { + const uint8_t *in; + size_t in_pos; + size_t in_size; + + uint8_t *out; + size_t out_pos; + size_t out_size; +}; + +/** + * struct xz_dec - Opaque type to hold the XZ decoder state + */ +struct xz_dec; + +/** + * xz_dec_init() - Allocate and initialize a XZ decoder state + * @mode: Operation mode + * @dict_max: Maximum size of the LZMA2 dictionary (history buffer) for + * multi-call decoding. This is ignored in single-call mode + * (mode == XZ_SINGLE). LZMA2 dictionary is always 2^n bytes + * or 2^n + 2^(n-1) bytes (the latter sizes are less common + * in practice), so other values for dict_max don't make sense. + * In the kernel, dictionary sizes of 64 KiB, 128 KiB, 256 KiB, + * 512 KiB, and 1 MiB are probably the only reasonable values, + * except for kernel and initramfs images where a bigger + * dictionary can be fine and useful. + * + * Single-call mode (XZ_SINGLE): xz_dec_run() decodes the whole stream at + * once. The caller must provide enough output space or the decoding will + * fail. The output space is used as the dictionary buffer, which is why + * there is no need to allocate the dictionary as part of the decoder's + * internal state. + * + * Because the output buffer is used as the workspace, streams encoded using + * a big dictionary are not a problem in single-call mode. It is enough that + * the output buffer is big enough to hold the actual uncompressed data; it + * can be smaller than the dictionary size stored in the stream headers. + * + * Multi-call mode with preallocated dictionary (XZ_PREALLOC): dict_max bytes + * of memory is preallocated for the LZMA2 dictionary. This way there is no + * risk that xz_dec_run() could run out of memory, since xz_dec_run() will + * never allocate any memory. Instead, if the preallocated dictionary is too + * small for decoding the given input stream, xz_dec_run() will return + * XZ_MEMLIMIT_ERROR. Thus, it is important to know what kind of data will be + * decoded to avoid allocating excessive amount of memory for the dictionary. + * + * Multi-call mode with dynamically allocated dictionary (XZ_DYNALLOC): + * dict_max specifies the maximum allowed dictionary size that xz_dec_run() + * may allocate once it has parsed the dictionary size from the stream + * headers. This way excessive allocations can be avoided while still + * limiting the maximum memory usage to a sane value to prevent running the + * system out of memory when decompressing streams from untrusted sources. + * + * On success, xz_dec_init() returns a pointer to struct xz_dec, which is + * ready to be used with xz_dec_run(). If memory allocation fails, + * xz_dec_init() returns NULL. + */ +XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max); + +/** + * xz_dec_run() - Run the XZ decoder + * @s: Decoder state allocated using xz_dec_init() + * @b: Input and output buffers + * + * The possible return values depend on build options and operation mode. + * See enum xz_ret for details. + * + * Note that if an error occurs in single-call mode (return value is not + * XZ_STREAM_END), b->in_pos and b->out_pos are not modified and the + * contents of the output buffer from b->out[b->out_pos] onward are + * undefined. This is true even after XZ_BUF_ERROR, because with some filter + * chains, there may be a second pass over the output buffer, and this pass + * cannot be properly done if the output buffer is truncated. Thus, you + * cannot give the single-call decoder a too small buffer and then expect to + * get that amount valid data from the beginning of the stream. You must use + * the multi-call decoder if you don't want to uncompress the whole stream. + */ +XZ_EXTERN enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b); + +/** + * xz_dec_reset() - Reset an already allocated decoder state + * @s: Decoder state allocated using xz_dec_init() + * + * This function can be used to reset the multi-call decoder state without + * freeing and reallocating memory with xz_dec_end() and xz_dec_init(). + * + * In single-call mode, xz_dec_reset() is always called in the beginning of + * xz_dec_run(). Thus, explicit call to xz_dec_reset() is useful only in + * multi-call mode. + */ +XZ_EXTERN void xz_dec_reset(struct xz_dec *s); + +/** + * xz_dec_end() - Free the memory allocated for the decoder state + * @s: Decoder state allocated using xz_dec_init(). If s is NULL, + * this function does nothing. + */ +XZ_EXTERN void xz_dec_end(struct xz_dec *s); + +/* + * Standalone build (userspace build or in-kernel build for boot time use) + * needs a CRC32 implementation. For normal in-kernel use, kernel's own + * CRC32 module is used instead, and users of this module don't need to + * care about the functions below. + */ +#ifndef XZ_INTERNAL_CRC32 +# ifdef __KERNEL__ +# define XZ_INTERNAL_CRC32 0 +# else +# define XZ_INTERNAL_CRC32 1 +# endif +#endif + +#if XZ_INTERNAL_CRC32 +/* + * This must be called before any other xz_* function to initialize + * the CRC32 lookup table. + */ +XZ_EXTERN void xz_crc32_init(void); + +/* + * Update CRC32 value using the polynomial from IEEE-802.3. To start a new + * calculation, the third argument must be zero. To continue the calculation, + * the previously returned value is passed as the third argument. + */ +XZ_EXTERN uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc); +#endif + +#ifdef __cplusplus +} +#endif + +#endif Added: vendor/xz-embedded/dist/linux/lib/decompress_unxz.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/xz-embedded/dist/linux/lib/decompress_unxz.c Sat Dec 31 22:35:46 2011 (r229159) @@ -0,0 +1,397 @@ +/* + * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd + * + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +/* + * Important notes about in-place decompression + * + * At least on x86, the kernel is decompressed in place: the compressed data + * is placed to the end of the output buffer, and the decompressor overwrites + * most of the compressed data. There must be enough safety margin to + * guarantee that the write position is always behind the read position. + * + * The safety margin for XZ with LZMA2 or BCJ+LZMA2 is calculated below. + * Note that the margin with XZ is bigger than with Deflate (gzip)! + * + * The worst case for in-place decompression is that the beginning of + * the file is compressed extremely well, and the rest of the file is + * uncompressible. Thus, we must look for worst-case expansion when the + * compressor is encoding uncompressible data. + * + * The structure of the .xz file in case of a compresed kernel is as follows. + * Sizes (as bytes) of the fields are in parenthesis. + * + * Stream Header (12) + * Block Header: + * Block Header (8-12) + * Compressed Data (N) + * Block Padding (0-3) + * CRC32 (4) + * Index (8-20) + * Stream Footer (12) + * + * Normally there is exactly one Block, but let's assume that there are + * 2-4 Blocks just in case. Because Stream Header and also Block Header + * of the first Block don't make the decompressor produce any uncompressed + * data, we can ignore them from our calculations. Block Headers of possible + * additional Blocks have to be taken into account still. With these + * assumptions, it is safe to assume that the total header overhead is + * less than 128 bytes. + * + * Compressed Data contains LZMA2 or BCJ+LZMA2 encoded data. Since BCJ + * doesn't change the size of the data, it is enough to calculate the + * safety margin for LZMA2. + * + * LZMA2 stores the data in chunks. Each chunk has a header whose size is + * a maximum of 6 bytes, but to get round 2^n numbers, let's assume that + * the maximum chunk header size is 8 bytes. After the chunk header, there + * may be up to 64 KiB of actual payload in the chunk. Often the payload is + * quite a bit smaller though; to be safe, let's assume that an average + * chunk has only 32 KiB of payload. + * + * The maximum uncompressed size of the payload is 2 MiB. The minimum + * uncompressed size of the payload is in practice never less than the + * payload size itself. The LZMA2 format would allow uncompressed size + * to be less than the payload size, but no sane compressor creates such + * files. LZMA2 supports storing uncompressible data in uncompressed form, + * so there's never a need to create payloads whose uncompressed size is + * smaller than the compressed size. + * + * The assumption, that the uncompressed size of the payload is never + * smaller than the payload itself, is valid only when talking about + * the payload as a whole. It is possible that the payload has parts where + * the decompressor consumes more input than it produces output. Calculating + * the worst case for this would be tricky. Instead of trying to do that, + * let's simply make sure that the decompressor never overwrites any bytes + * of the payload which it is currently reading. + * + * Now we have enough information to calculate the safety margin. We need + * - 128 bytes for the .xz file format headers; + * - 8 bytes per every 32 KiB of uncompressed size (one LZMA2 chunk header + * per chunk, each chunk having average payload size of 32 KiB); and + * - 64 KiB (biggest possible LZMA2 chunk payload size) to make sure that + * the decompressor never overwrites anything from the LZMA2 chunk + * payload it is currently reading. + * + * We get the following formula: + * + * safety_margin = 128 + uncompressed_size * 8 / 32768 + 65536 + * = 128 + (uncompressed_size >> 12) + 65536 + * + * For comparision, according to arch/x86/boot/compressed/misc.c, the + * equivalent formula for Deflate is this: + * + * safety_margin = 18 + (uncompressed_size >> 12) + 32768 + * + * Thus, when updating Deflate-only in-place kernel decompressor to + * support XZ, the fixed overhead has to be increased from 18+32768 bytes + * to 128+65536 bytes. + */ + +/* + * STATIC is defined to "static" if we are being built for kernel + * decompression (pre-boot code). will define + * STATIC to empty if it wasn't already defined. Since we will need to + * know later if we are being used for kernel decompression, we define + * XZ_PREBOOT here. + */ +#ifdef STATIC +# define XZ_PREBOOT +#endif +#ifdef __KERNEL__ +# include +#endif +#define XZ_EXTERN STATIC + +#ifndef XZ_PREBOOT +# include +# include +#else +/* + * Use the internal CRC32 code instead of kernel's CRC32 module, which + * is not available in early phase of booting. + */ +#define XZ_INTERNAL_CRC32 1 + +/* + * For boot time use, we enable only the BCJ filter of the current + * architecture or none if no BCJ filter is available for the architecture. + */ +#ifdef CONFIG_X86 +# define XZ_DEC_X86 +#endif +#ifdef CONFIG_PPC +# define XZ_DEC_POWERPC +#endif +#ifdef CONFIG_ARM +# define XZ_DEC_ARM +#endif +#ifdef CONFIG_IA64 +# define XZ_DEC_IA64 +#endif +#ifdef CONFIG_SPARC +# define XZ_DEC_SPARC +#endif + +/* + * This will get the basic headers so that memeq() and others + * can be defined. + */ +#include "xz/xz_private.h" + +/* + * Replace the normal allocation functions with the versions from + * . vfree() needs to support vfree(NULL) + * when XZ_DYNALLOC is used, but the pre-boot free() doesn't support it. + * Workaround it here because the other decompressors don't need it. + */ +#undef kmalloc +#undef kfree +#undef vmalloc +#undef vfree +#define kmalloc(size, flags) malloc(size) +#define kfree(ptr) free(ptr) +#define vmalloc(size) malloc(size) +#define vfree(ptr) do { if (ptr != NULL) free(ptr); } while (0) + +/* + * FIXME: Not all basic memory functions are provided in architecture-specific + * files (yet). We define our own versions here for now, but this should be + * only a temporary solution. + * + * memeq and memzero are not used much and any remotely sane implementation + * is fast enough. memcpy/memmove speed matters in multi-call mode, but + * the kernel image is decompressed in single-call mode, in which only + * memcpy speed can matter and only if there is a lot of uncompressible data + * (LZMA2 stores uncompressible chunks in uncompressed form). Thus, the + * functions below should just be kept small; it's probably not worth + * optimizing for speed. + */ + +#ifndef memeq +static bool memeq(const void *a, const void *b, size_t size) +{ + const uint8_t *x = a; + const uint8_t *y = b; + size_t i; + + for (i = 0; i < size; ++i) + if (x[i] != y[i]) + return false; + + return true; +} +#endif + +#ifndef memzero +static void memzero(void *buf, size_t size) +{ + uint8_t *b = buf; + uint8_t *e = b + size; + + while (b != e) + *b++ = '\0'; +} +#endif + +#ifndef memmove +/* Not static to avoid a conflict with the prototype in the Linux headers. */ +void *memmove(void *dest, const void *src, size_t size) +{ + uint8_t *d = dest; + const uint8_t *s = src; + size_t i; + + if (d < s) { + for (i = 0; i < size; ++i) + d[i] = s[i]; + } else if (d > s) { + i = size; + while (i-- > 0) + d[i] = s[i]; + } + + return dest; +} +#endif + +/* + * Since we need memmove anyway, would use it as memcpy too. + * Commented out for now to avoid breaking things. + */ +/* +#ifndef memcpy +# define memcpy memmove +#endif +*/ + +#include "xz/xz_crc32.c" +#include "xz/xz_dec_stream.c" +#include "xz/xz_dec_lzma2.c" +#include "xz/xz_dec_bcj.c" + +#endif /* XZ_PREBOOT */ + +/* Size of the input and output buffers in multi-call mode */ +#define XZ_IOBUF_SIZE 4096 + +/* + * This function implements the API defined in . + * + * This wrapper will automatically choose single-call or multi-call mode + * of the native XZ decoder API. The single-call mode can be used only when + * both input and output buffers are available as a single chunk, i.e. when + * fill() and flush() won't be used. + */ +STATIC int INIT unxz(unsigned char *in, int in_size, + int (*fill)(void *dest, unsigned int size), + int (*flush)(void *src, unsigned int size), + unsigned char *out, int *in_used, + void (*error)(char *x)) +{ + struct xz_buf b; + struct xz_dec *s; + enum xz_ret ret; + bool must_free_in = false; + +#if XZ_INTERNAL_CRC32 + xz_crc32_init(); +#endif + + if (in_used != NULL) + *in_used = 0; + + if (fill == NULL && flush == NULL) + s = xz_dec_init(XZ_SINGLE, 0); + else + s = xz_dec_init(XZ_DYNALLOC, (uint32_t)-1); + + if (s == NULL) + goto error_alloc_state; + + if (flush == NULL) { + b.out = out; + b.out_size = (size_t)-1; + } else { + b.out_size = XZ_IOBUF_SIZE; + b.out = malloc(XZ_IOBUF_SIZE); + if (b.out == NULL) + goto error_alloc_out; + } + + if (in == NULL) { + must_free_in = true; + in = malloc(XZ_IOBUF_SIZE); + if (in == NULL) + goto error_alloc_in; + } + + b.in = in; + b.in_pos = 0; + b.in_size = in_size; + b.out_pos = 0; + + if (fill == NULL && flush == NULL) { + ret = xz_dec_run(s, &b); + } else { + do { + if (b.in_pos == b.in_size && fill != NULL) { + if (in_used != NULL) + *in_used += b.in_pos; + + b.in_pos = 0; + + in_size = fill(in, XZ_IOBUF_SIZE); + if (in_size < 0) { + /* + * This isn't an optimal error code + * but it probably isn't worth making + * a new one either. + */ + ret = XZ_BUF_ERROR; + break; + } + + b.in_size = in_size; + } + + ret = xz_dec_run(s, &b); + + if (flush != NULL && (b.out_pos == b.out_size + || (ret != XZ_OK && b.out_pos > 0))) { + /* + * Setting ret here may hide an error + * returned by xz_dec_run(), but probably + * it's not too bad. + */ + if (flush(b.out, b.out_pos) != (int)b.out_pos) + ret = XZ_BUF_ERROR; + + b.out_pos = 0; + } + } while (ret == XZ_OK); + + if (must_free_in) + free(in); + + if (flush != NULL) + free(b.out); + } + + if (in_used != NULL) + *in_used += b.in_pos; + + xz_dec_end(s); + + switch (ret) { + case XZ_STREAM_END: + return 0; + + case XZ_MEM_ERROR: + /* This can occur only in multi-call mode. */ + error("XZ decompressor ran out of memory"); + break; + + case XZ_FORMAT_ERROR: + error("Input is not in the XZ format (wrong magic bytes)"); + break; + + case XZ_OPTIONS_ERROR: + error("Input was encoded with settings that are not " + "supported by this XZ decoder"); + break; + + case XZ_DATA_ERROR: + case XZ_BUF_ERROR: + error("XZ-compressed data is corrupt"); + break; + + default: + error("Bug in the XZ decompressor"); + break; + } + + return -1; + +error_alloc_in: + if (flush != NULL) + free(b.out); + +error_alloc_out: + xz_dec_end(s); + +error_alloc_state: + error("XZ decompressor ran out of memory"); + return -1; +} + +/* + * This macro is used by architecture-specific files to decompress + * the kernel image. + */ +#define decompress unxz Added: vendor/xz-embedded/dist/linux/lib/xz/Kconfig ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/xz-embedded/dist/linux/lib/xz/Kconfig Sat Dec 31 22:35:46 2011 (r229159) @@ -0,0 +1,59 @@ +config XZ_DEC + tristate "XZ decompression support" + select CRC32 + help + LZMA2 compression algorithm and BCJ filters are supported using + the .xz file format as the container. For integrity checking, + CRC32 is supported. See Documentation/xz.txt for more information. + +config XZ_DEC_X86 + bool "x86 BCJ filter decoder" if EXPERT + default y + depends on XZ_DEC + select XZ_DEC_BCJ + +config XZ_DEC_POWERPC + bool "PowerPC BCJ filter decoder" if EXPERT + default y + depends on XZ_DEC + select XZ_DEC_BCJ + +config XZ_DEC_IA64 + bool "IA-64 BCJ filter decoder" if EXPERT + default y + depends on XZ_DEC + select XZ_DEC_BCJ + +config XZ_DEC_ARM + bool "ARM BCJ filter decoder" if EXPERT + default y + depends on XZ_DEC + select XZ_DEC_BCJ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Sat Dec 31 22:37:12 2011 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D675F106564A; Sat, 31 Dec 2011 22:37:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA8B08FC0C; Sat, 31 Dec 2011 22:37:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBVMbCb7086061; Sat, 31 Dec 2011 22:37:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBVMbC1B086060; Sat, 31 Dec 2011 22:37:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201112312237.pBVMbC1B086060@svn.freebsd.org> From: Adrian Chadd Date: Sat, 31 Dec 2011 22:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229160 - vendor/xz-embedded/48f4588342f4a4e0182a6740e25675fd8e6c6295 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2011 22:37:12 -0000 Author: adrian Date: Sat Dec 31 22:37:12 2011 New Revision: 229160 URL: http://svn.freebsd.org/changeset/base/229160 Log: Tag git revision 48f4588342f4a4e0182a6740e25675fd8e6c6295. Added: vendor/xz-embedded/48f4588342f4a4e0182a6740e25675fd8e6c6295/ - copied from r229159, vendor/xz-embedded/dist/