--- libatomic-ops-7.4.2.orig/debian/README.Debian +++ libatomic-ops-7.4.2/debian/README.Debian @@ -0,0 +1,35 @@ +libatomic-ops for Debian +------------------------ + +Libatomic-ops implements a large collection of operations, each one +of which is a combination of an (optional) atomic memory operation, +and a memory barrier. It also implements associated feature-test +macros that determine whether a particular operation is available +on the current target hardware (either directly or by synthesis). +Libatomic-ops attempts to replace various existing files with similar +goals, since they usually do not handle differences in memory barrier +styles with sufficient generality. + +This package is only available as a static library; much of the magic +is in the header files anyway. + +Please be aware of the dual nature of the license, from LICENSING.txt + +Two small libraries are built and installed: + +- libatomic_ops.a is a support library, which is not needed on some platforms. + This is intended to be usable, under some mild restrictions, in free or + proprietary code, as are all the header files. See doc/LICENSING.txt. +- libatomic_ops_gpl.a contains some higher level facilities. This code is + currently covered by the GPL. The contents currently correspond to + the headers atomic_ops_stack.h and atomic_ops_malloc.h. + +NB: the Debian package has been enabled to build on any architecture. +However, only i386, ia64 and amd64 have been fully tested due to +limited access to some of the other architectures. Corrections are +welcome. + +The M68K port was contributed by Roman Zippel , +and is not currently part of the upstream source. + + -- Ian Wienand , Mon, 16 Oct 2006 09:47:19 +1000 --- libatomic-ops-7.4.2.orig/debian/README.source +++ libatomic-ops-7.4.2/debian/README.source @@ -0,0 +1,7 @@ +Patches applied are cherry-picked from upstream. + +For patching details see + +/usr/share/doc/quilt/README.source + + -- Ian Wienand , Mon, 25 Jan 2016 21:37:35 +1100 --- libatomic-ops-7.4.2.orig/debian/changelog +++ libatomic-ops-7.4.2/debian/changelog @@ -0,0 +1,334 @@ +libatomic-ops (7.4.2-3ubuntu1) xenial; urgency=medium + + * Merge with Debian; remaining changes: + + -- Matthias Klose Wed, 17 Feb 2016 15:56:46 +0100 + +libatomic-ops (7.4.2-3) unstable; urgency=medium + + * Restore backported patches from 7.4.2-1.1 for mips64/arm64 + + -- Ian Wienand Mon, 25 Jan 2016 21:22:14 +1100 + +libatomic-ops (7.4.2-2) unstable; urgency=medium + + * Closes: 811550 -- implement multi-arch + * Update standards version 3.9.6 (no change) + + -- Ian Wienand Wed, 20 Jan 2016 11:14:12 +1100 + +libatomic-ops (7.4.2-1.1ubuntu1) xenial; urgency=medium + + * Merge with Debian; remaining changes: + - Build using dh-autoreconf. + - Show test results for failing tests. + - Force AO_load() to map to AO_load_acquire() for powerpc. + + -- Matthias Klose Thu, 07 Jan 2016 14:18:47 +0100 + +libatomic-ops (7.4.2-1) unstable; urgency=medium + + * New upstream release + * Update standards version 3.9.5 (no change) + + -- Ian Wienand Sat, 21 Jun 2014 11:21:55 +1000 + +libatomic-ops (7.4-0ubuntu3) trusty; urgency=medium + + * Force AO_load() to map to AO_load_acquire() for powerpc. + + -- Matthias Klose Mon, 24 Feb 2014 20:27:17 +0100 + +libatomic-ops (7.4-0ubuntu1) trusty; urgency=medium + + * New upstream version. + * Build using dh-autoreconf. + * Show test results for failing tests. + + -- Matthias Klose Wed, 15 Jan 2014 18:20:40 +0100 + +libatomic-ops (7.3~alpha3+git20130717-1) unstable; urgency=low + + * Closes: 717095 -- update to current upstream for arm64 + * Update standards version (no change) + + -- Ian Wienand Wed, 17 Jul 2013 09:06:32 +1000 + +libatomic-ops (7.3~alpha3+git20121114-1) unstable; urgency=low + + * Closes: 680100 -- include workaround for alpha spin-outs; thanks to + Ivan Maidanski for diagnosing. + + -- Ian Wienand Wed, 14 Nov 2012 15:27:35 -0800 + +libatomic-ops (7.3~alpha1+git20120718-1) unstable; urgency=low + + * Closes: 655872 -- Update from upstream git which fixes issues with + older compilers as used on kfreebsd + (613f39d369045e8fc385a439f67a575cddcc6fa1). Thanks Ivan! + + -- Ian Wienand Wed, 18 Jul 2012 07:08:36 -0700 + +libatomic-ops (7.3~alpha1+git20120701-1) unstable; urgency=low + + * Closes: 679680 -- Update from upstream git which contains fix for type + issue on ia64 (3e7162d789df366a57d3e4a59dde4046f91ed135) + + -- Ian Wienand Sun, 01 Jul 2012 22:20:34 -0700 + +libatomic-ops (7.3~alpha1+git20120621-1) unstable; urgency=low + + * Update from upstream git + * Closes: 632604 -- Fixed by upstream 30cea1b as identified by Emanuele + Aina and Gregor Herrmann . Thanks! + + -- Ian Wienand Thu, 21 Jun 2012 09:55:15 -0700 + +libatomic-ops (7.3~alpha1+git20111031-1) unstable; urgency=low + + * Update from upstream git + * Closes: 645302 -- Integrates patch from Thorsten Glaser + + -- Ian Wienand Mon, 31 Oct 2011 23:01:03 -0700 + +libatomic-ops (7.3~alpha1+git20110913-1) unstable; urgency=low + + * New upstream release + + -- Ian Wienand Tue, 13 Sep 2011 21:19:00 -0700 + +libatomic-ops (7.2~alpha5+cvs20101124-1) unstable; urgency=low + + * Closes: 604753 -- Update from upstream CVS, fixes ARM Thumb-2 mode + FTBFS + + -- Ian Wienand Wed, 24 Nov 2010 21:20:40 -0800 + +libatomic-ops (7.2~alpha5+cvs20100919-1) unstable; urgency=low + + * Closes: 597193 -- Update from upstream CVS to fix armel issues + * Update to standards 3.9.1 + + -- Ian Wienand Sun, 19 Sep 2010 21:55:41 -0700 + +libatomic-ops (7.2~alpha5+cvs20100601-1) unstable; urgency=low + + * Update from upstream CVS, to fix AVR build issues with change from + Brad Smith + + -- Ian Wienand Tue, 01 Jun 2010 15:37:41 -0700 + +libatomic-ops (7.2~alpha5+cvs20100523-1) unstable; urgency=low + + * Update from upstream CVS + * Closes: 580211 -- avr support integrated upstream (Thanks Stefano!) + + -- Ian Wienand Fri, 21 May 2010 15:47:12 -0700 + +libatomic-ops (7.2~alpha5+cvs20100204-1) unstable; urgency=low + + * New upstream (with new version scheme based on the GC library) + * Packagaing overhaul - remove unneeded debian/libatomic-ops-dev.files, + debian/libatomic-ops-dev.install, debian/docs, debian/dirs + * Update rules to use DEB_DESTDIR to install into /tmp + * Pick only relevant files with debian/libatomic-ops-dev.install + * Remove patch to ignore upstream doc generation, not needed with above + changes + + -- Ian Wienand Thu, 04 Feb 2010 14:57:58 -0800 + +libatomic-ops (1.2+cvs20091005-1) unstable; urgency=low + + * Update from upstream CVS + * Closes: #547136 -- patch accepted upstream + * Lintian updates : Update standards version, debhelper compat version, + add Section tag for source, misc depends for debhelper + + -- Ian Wienand Mon, 5 Oct 2009 11:08:00 -0700 + +libatomic-ops (1.2+cvs20080819-1) unstable; urgency=low + + * Update from upstream CVS + * Closes: #495211 -- patch taken upstream, thanks Thiemo! + + -- Ian Wienand Tue, 19 Aug 2008 14:25:24 -0700 + +libatomic-ops (1.2+cvs20080815-1) unstable; urgency=low + + * New upstream, taken from CVS repository at + bdwgc.cvs.sourceforge.net:/cvsroot/bdwgc + which upstream has told me is official home of the package. + * Patches now included upstream: 01_s390_include.patch, 02_mips.patch, + 04_m68k.patch, 05_powerpc_asm.patch, 07_pic_cmpxchng.patch, + + -- Ian Wienand Fri, 15 Aug 2008 21:26:06 -0700 + +libatomic-ops (1.2-4) unstable; urgency=low + + * Closes: #463390 -- Add 06_double.patch to fix some issues with double + CAS defs. Patch by Jamey Sharp, thanks Jamey! + * This fixed up AO_compare_double_and_swap_double_full which then + revealed a PIC problem, which then revealed the arguments to cmpxchg8b + were around the wrong way, fixed in 07_pic_cmpxchng.patch + + -- Ian Wienand Fri, 01 Feb 2008 11:09:33 +1100 + +libatomic-ops (1.2-3) unstable; urgency=low + + * Closes: #449152 -- updated MIPS patch from Thiemo Seufer + + -- Ian Wienand Sun, 04 Nov 2007 19:01:31 +1100 + +libatomic-ops (1.2-2) unstable; urgency=low + + * Add patches/05_powerpc_asm.patch to fix invalid ASM in PowerPC, as per + http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33171 (Closes: #432654). + Thanks to Sjoerd Simons for isolating the bug, and + Andrew Pinkski for solution. + + -- Ian Wienand Mon, 27 Aug 2007 11:13:13 +1000 + +libatomic-ops (1.2-1) unstable; urgency=low + + * New upstream + * Remove 00_x86_intrin.patch, fixed upstream (with "=q")x + + -- Ian Wienand Fri, 25 May 2007 11:29:30 +1000 + +libatomic-ops (1.1-4) unstable; urgency=low + + * Closes: #322027, #338469 -- add 04_m68k.patch for M68K support, from + Roman Zippel . Add note in README.Debian about + port. + * Change mainatiner address to my @debian.org + + -- Ian Wienand Mon, 16 Oct 2006 09:45:29 +1000 + +libatomic-ops (1.1-3) unstable; urgency=low + + * move the check target under the rules to make cdbs run inbuilt tests + * Closes: #307448 -- assuming the (newly re-enabled) test runs OK we + seem to be building on ARM + + -- Ian Wienand Thu, 8 Dec 2005 13:39:22 +1100 + +libatomic-ops (1.1-2) unstable; urgency=low + + * spell my name right in README.Debian + * patches/03_nodoc.patch : don't install documentation, the packaging + does this directly + * really install manpages + * clean up what docs get installed + * don't auto generate control file, do it in external scripts + + -- Ian Wienand Fri, 25 Nov 2005 16:28:16 +1100 + +libatomic-ops (1.1-1) unstable; urgency=low + + * New upstream release + * Convert to use CDBS with patch system; move extra stuff over upstream + into ./debian/patches + * Closes: #336112, #338442 -- MIPS support debian/patches/02_mips.patch + Thanks Thiemo! + + -- Ian Wienand Mon, 31 Oct 2005 13:40:53 +1100 + +libatomic-ops (1.0-3) unstable; urgency=low + + * Closes: bug#332378 -- fix include headers in + src/atomic_ops/sysdeps/gcc/s390.h + + -- Ian Wienand Thu, 6 Oct 2005 16:14:49 +1000 + +libatomic-ops (1.0-2) unstable; urgency=low + + * Closes: bug#321284 -- we now only have the -dev package with the + static libraries in it, and it replaces the normal version (this + corrects an ahs3 thinko from 1.0-1). + * Add a note to README.Debian about staticness and license + * Add /doc subdir into package documents + * Closes: bug#321291 -- use "Q" constraint in + src/atomic_ops/sysdeps/gcc/x86.h for AO_test_and_set_full, see + http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23242 + * Reopening #307448 -- the asm needs to be reconsidered and possibly + rewritten for ARM. + + -- Ian Wienand Fri, 5 Aug 2005 11:13:26 +1000 + +libatomic-ops (1.0-1) unstable; urgency=low + + * Closes: bug#307503 -- FTBS. Update to upstream 1.0 (ianw) + * The 'libatomic-ops' package now contains only a statically linked + library, as upstream wishes (which makes sense, in this case, and + still fits within policy). The 'libatomic-ops-dev' package now + depends on the 'libatomic-ops' as a result to ensure a developer + can still properly link against the package (ahs3). + * Update standards version to 3.6.2 (ahs3) + * Closes: bug#307448 -- variable 'ret' undefined on ARM. I think + this has been solved but I could be wrong and may have to reopen + this bug (ahs3). + + -- Al Stone Mon, 1 Aug 2005 22:25:38 -0600 + +libatomic-ops (0.5.1-4) unstable; urgency=low + + * Add man page + + -- Ian Wienand Fri, 20 May 2005 08:28:14 +1000 + +libatomic-ops (0.5.1-3) unstable; urgency=low + + * Closes: bug#287276: support for amd64 -- thinko, skipped part + of Kurt's patch inadvertently. + + -- Al Stone Mon, 21 Feb 2005 17:15:35 -0700 + +libatomic-ops (0.5.1-2) unstable; urgency=low + + * Closes: bug#287276: support for amd64 added (thanks to Kurt + Roeckx for the patch). + * Closes: bug#244910: all architectures have now been enabled (only + i386, ia64, amd64 are absolutely known to work, however) + + -- Al Stone Sat, 19 Feb 2005 15:47:31 -0700 + +libatomic-ops (0.5.1-1) unstable; urgency=low + + * Merge in Ian's changes for a non-native Debian package -- properly, + this time. + * Remove the auto* build-deps (the point of Ian's changes) + * Closes: bug#270013 -- FTBFS: Permission problem on autogen.sh + * Since we've started branching from upstream a little, change + the versioning to reflect that -- hence, 0.5.1 to start with. + + -- Al Stone Tue, 7 Sep 2004 16:01:18 -0600 + +libatomic-ops (0.5-3) unstable; urgency=low + + * Update to cleanup and not be a debian native package + * Closes: bug#266131: FTBFS: aclocal-1.7: command not found + * Minor changes to debian/rules file (ahs3) + * Cleanup minor typos before upload (ahs3) + * Added 'libtool' to Build-Depends (ahs3) + + -- Ian Wienand Fri, 27 Aug 2004 10:48:39 +1000 + +libatomic-ops (0.5-2) unstable; urgency=low + + * Cleanup of the source tree from Ian Wienand ; + got rid of all the generated files to simplify things. + * Did cleanup of lintian-reported items + + -- Al Stone Tue, 24 Aug 2004 22:50:25 -0600 + +libatomic-ops (0.5-1) unstable; urgency=low + + * Initial Release based on Ian Wienand's work (). + * Inserted myself (Al Stone as maintainer. + * Cleaned up the various files needed in the debian directory. + * Package now creates 'libatomic-ops' and 'libatomic-ops-dev' + * Package now uses libtool + * Closes: bug#231793 -- ITP for libatomic_ops + + -- Al Stone Sat, 13 Mar 2004 14:38:53 -0700 + --- libatomic-ops-7.4.2.orig/debian/compat +++ libatomic-ops-7.4.2/debian/compat @@ -0,0 +1 @@ +7 --- libatomic-ops-7.4.2.orig/debian/control +++ libatomic-ops-7.4.2/debian/control @@ -0,0 +1,32 @@ +Source: libatomic-ops +Priority: optional +Section: libdevel +Maintainer: Ian Wienand +Uploaders: Al Stone +Build-Depends: dh-autoreconf, debhelper (>= 8), + autotools-dev, + debhelper, + dh-buildinfo, + quilt, + patchutils (>= 0.2.25), quilt +Standards-Version: 3.9.6 + +Package: libatomic-ops-dev +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends} +Architecture: any +Multi-Arch: same +Replaces: libatomic-ops +Description: A library for atomic operations (development files) + Libatomic-ops implements a large collection of operations, each one + of which is a combination of an (optional) atomic memory operation, + and a memory barrier. It also implements associated feature-test + macros that determine whether a particular operation is available + on the current target hardware (either directly or by synthesis). + Libatomic-ops attempts to replace various existing files with similar + goals, since they usually do not handle differences in memory barrier + styles with sufficient generality. + . + This package provides the header files and documentation needed by + developers. + --- libatomic-ops-7.4.2.orig/debian/control.in +++ libatomic-ops-7.4.2/debian/control.in @@ -0,0 +1,27 @@ +Source: libatomic-ops +Priority: optional +Section: libdevel +Maintainer: Ian Wienand +Uploaders: Al Stone +Build-Depends: @cdbs@, quilt +Standards-Version: 3.9.6 + +Package: libatomic-ops-dev +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends} +Architecture: any +Multi-Arch: same +Replaces: libatomic-ops +Description: A library for atomic operations (development files) + Libatomic-ops implements a large collection of operations, each one + of which is a combination of an (optional) atomic memory operation, + and a memory barrier. It also implements associated feature-test + macros that determine whether a particular operation is available + on the current target hardware (either directly or by synthesis). + Libatomic-ops attempts to replace various existing files with similar + goals, since they usually do not handle differences in memory barrier + styles with sufficient generality. + . + This package provides the header files and documentation needed by + developers. + --- libatomic-ops-7.4.2.orig/debian/copyright +++ libatomic-ops-7.4.2/debian/copyright @@ -0,0 +1,71 @@ +This package was debianized by Ian Wienand +on Mon, 9 Feb 2004 10:26:54 +1100. + +It was downloaded from: + https://github.com/ivmai/libatomic_ops + (previously + http://www.hpl.hp.com/research/linux/atomic_ops/download.php4) + +Upstream Authors: + Hans Boehm + David Mosberger + +Our intent is to make it easy to use all "library" pieces of the code, in +both free and proprietary software. Hence most code that we expect to be +linked into a client application is covered by an MIT-style license: + +---------------------------------------- + +Copyright (c) 2004, Hewlett-Packard Company + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +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. + +-------------------------------- + +A few files in the ao_sysdeps directory were inherited in part from the +Boehm-Demers-Weiser conservative garbage collector, and are covered by +its license, which is similar in spirit: + +-------------------------------- + +Copyright (c) 2004 Hewlett-Packard Company + +THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED +OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + +Permission is hereby granted to use or copy this program +for any purpose, provided the above notices are retained on all copies. +Permission to modify the code and to distribute modified code is granted, +provided the above notices are retained, and a notice that the code was +modified is included with the above copyright notice. + +---------------------------------- + +A few files are covered by the GNU General Public License. (See file +"COPYING"). Currently this applies only to test code and sample +applications. This should have no effect on linking "library" +routines into proprietary applications. + +A copy of the GNU General Public License can be found in: +/usr/share/common-licenses/GPL + +In the future, legal considerations may make it desirable to also cover +some newly added library routines under the GPL. If so, these will be +clearly separated, and not implicitly linked into existing libraries. + --- libatomic-ops-7.4.2.orig/debian/libatomic-malloc.3 +++ libatomic-ops-7.4.2/debian/libatomic-malloc.3 @@ -0,0 +1,89 @@ +.\" Copyright 2005 Ian Wienand, Gelato@UNSW +.\" +.TH "LIBATOMIC-MALLOC" "3" "2 June, 2005" "Ian Wienand" "" +.SH "NAME" +libatomic\-malloc \- Library providing simple almost\-lock\-free malloc implementation +.SH "SYNOPSIS" +.B #include +.sp +.B cc ... \-latomic_ops_gpl +.sp +Note that the AO_malloc implementation is licensed under the GPL, unlike the lower level routines. + +.B void *AO_malloc(size_t sz); +.br +.B void AO_free(void *p); +.br +.B void AO_malloc_enable_mmap(void); +.SH "DESCRIPTION" +A simple almost\-lock\-free malloc implementation. + +This is intended as a safe way to allocate memory from a signal handler, +or to allocate memory in the context of a library that does not know what +thread library it will be used with. In either case locking is impossible. + +Note that the operations are only guaranteed to be 1\-lock\-free, i.e. a +single blocked thread will not prevent progress, but multiple blocked +threads may. To safely use these operations in a signal handler, +the handler should be non\-reentrant, i.e. it should not be interruptable +by another handler using these operations. Furthermore use outside +of signal handlers in a multithreaded application should be protected +by a lock, so that at most one invocation may be interrupted by a signal. +The header will define the macro +.I AO_MALLOC_IS_LOCK_FREE +on platforms +on which malloc is completely lock\-free, and hence these restrictions +do not apply. + +In the presence of threads, but absence of contention, the time performance +of this package should be as good, or slightly better than, most system +malloc implementations. Its space performance +is theoretically optimal (to within a constant factor), but probably +quite poor in practice. In particular, no attempt is made to +coalesce free small memory blocks. Something like Doug Lea's malloc is +likely to use significantly less memory for complex applications. + +Perfomance on platforms without an efficient compare\-and\-swap implementation +will be poor. + +This package was not designed for processor\-scalability in the face of +high allocation rates. If all threads happen to allocate different\-sized +objects, you might get lucky. Otherwise expect contention and false\-sharing +problems. If this is an issue, something like Maged Michael's algorithm +(PLDI 2004) would be technically a far better choice. If you are concerned +only with scalablity, and not signal\-safety, you might also consider +using Hoard instead. We have seen a factor of 3 to 4 slowdown from the +standard glibc malloc implementation with contention, even when the +performance without contention was faster. (To make the implementation +more scalable, one would need to replicate at least the free list headers, +so that concurrent access is possible without cache conflicts.) + +Unfortunately there is no portable async\-signal\-safe way to obtain large +chunks of memory from the OS. Based on reading of the source code, +mmap\-based allocation appears safe under Linux, and probably BSD variants. +It is probably unsafe for operating systems built on Mach, such as +Apple's Darwin. Without use of mmap, the allocator is +limited to a fixed size, statically preallocated heap (2MB by default), +and will fail to allocate objects above a certain size (just under 64K +by default). Use of mmap to circumvent these limitations requires an +explicit call. + +The entire interface to the AO_malloc package currently consists of: + +.TP +.B AO_malloc +Allocate an area of memory + +.TP +.B AO_free +Free a previously malloced memory area + +.TP +AO_malloc_enable_mmap +Enable mmap for large malloc chunks + + +.SH "SEE ALSO" +libatomic\-ops(3), libatomic\-stack(3) +.SH "AUTHOR" +This manual page was written by Ian Wienand , based on comments in the source code. It was written for the Debian project (but may be used by others). --- libatomic-ops-7.4.2.orig/debian/libatomic-ops-dev.docs +++ libatomic-ops-7.4.2/debian/libatomic-ops-dev.docs @@ -0,0 +1,3 @@ +doc/README.txt +doc/README_malloc.txt +doc/README_stack.txt --- libatomic-ops-7.4.2.orig/debian/libatomic-ops-dev.install +++ libatomic-ops-7.4.2/debian/libatomic-ops-dev.install @@ -0,0 +1,2 @@ +usr/include +usr/lib/*/ --- libatomic-ops-7.4.2.orig/debian/libatomic-ops-dev.manpages +++ libatomic-ops-7.4.2/debian/libatomic-ops-dev.manpages @@ -0,0 +1,3 @@ +debian/libatomic-malloc.3 +debian/libatomic-ops.3 +debian/libatomic-stack.3 --- libatomic-ops-7.4.2.orig/debian/libatomic-ops.3 +++ libatomic-ops-7.4.2/debian/libatomic-ops.3 @@ -0,0 +1,115 @@ +.\" Copyright 2005 Ian Wienand, Gelato@UNSW +.\" +.TH "LIBATOMIC-OPS" "3" "May 17, 2005" "Ian Wienand" "" +.SH "NAME" +libatomic\-ops \- Library providing user level atomic operations +.SH "SYNOPSIS" +.B #include +.sp +.B cc ... \-latomic_ops +.sp +Note that all operations have an additional barrier option that can be set explicitly. +.sp +.B void AO_load(AO_t *addr) +.br +.B void AO_store(AO_t *addr, AO_t val) +.sp +.B int AO_test_and_set (AO_t *addr) +.sp +.B AO_t AO_fetch_and_add(AO_t *addr, AO_t incr) +.br +.B AO_t AO_fetch_and_add1(AO_t *addr) +.br +.B AO_t AO_fetch_and_sub1(AO_t *addr) +.sp +.B void AO_or(AO_t *p, AO_t incr) +.br +.B int AO_compare_and_swap(AO_t *addr, AO_t old, AO_t new_val) +.SH "DESCRIPTION" +.B libatomic\-ops +offers a programming interface to a comprehensive range of atomic operations at user level. + +We define various atomic operations on memory in a machine\-specific way. Unfortunately, this is complicated by the fact that these may or may not be combined with various memory barriers. Thus the actual operations we define have the form +.B AO__ +for all plausible combinations of and . + +The valid barrier suffixes are +.TP +.B _release +Earlier operations may not be delayed past it. +.TP +.B _acquire +Later operations may not move ahead of it. +.TP +.B _read +Subsequent reads must follow this operation and preceding reads. +.TP +.B _write +Earlier writes precede both this operation and later writes. +.TP +.B _full +Ordered with respect to both earlier and later memops. +.TP +.B _release_write +Ordered with respect to earlier writes. +.TP +.B _acquire_read +Ordered with repsect to later reads. + +.LP +This of course results in a mild combinatorial explosion. + +The library will find the least expensive way to implement your operations on the +applicable hardware. In many cases that will involve, for example, +a stronger memory barrier, or a combination of hardware primitives. + +Note that atomicity guarantees are valid only if both readers and +writers use AO_ operations to access the shared value, while ordering +constraints are intended to apply all memory operations. +If a location can potentially be accessed simultaneously from +multiple threads, and one of those accesses may be a write access, +then all such accesses to that location should be +through AO_ primitives. However if AO_ operations enforce sufficient +ordering to ensure that a location x cannot be accessed concurrently, or can only +be read concurrently, then x can be accessed via ordinary references and assignments. + +All operations operate on an +.B AO_t +value, which is the natural word size for the architecture. + +.B AO_load +and +.B AO_store +load and store the specified pointer address. + +.B AO_test_and_set +atomically replaces an address with +.B AO_TS_SET +and returns the prior value. An +.B AO_TS_t location can be reset with the +.B AO_CLEAR +macro, which usually uses +.B AO_store_release + +.B AO_fetch_and_add +takes an address and a value to add. + +.B AO_fetch_and_add1 +and +.B AO_fetch_and_sub1 +are provided since they may have faster implemenations on some hardware + +.B AO_or +atomically ors an +.I AO_t +value into a memory location, but does not provide +access to the original + +.B AO_compare_and_swap +takes an address, an old value and a new value and returns an int. +.I non\-zero +indicates the compare and swap succeeded. +.SH "SEE ALSO" +libatomic\-stack(3), libatomic\-malloc(3) +.SH "AUTHOR" +This manual page was written by Ian Wienand , based on comments in the source code. It was written for the Debian project (but may be used by others). --- libatomic-ops-7.4.2.orig/debian/libatomic-stack.3 +++ libatomic-ops-7.4.2/debian/libatomic-stack.3 @@ -0,0 +1,95 @@ +.\" Copyright 2005 Ian Wienand, Gelato@UNSW +.\" +.TH "LIBATOMIC-STACK" "3" "June 2, 2005" "Ian Wienand" "" +.SH "NAME" +libatomic\-stack \- Library providing linked stack abstraction +.SH "SYNOPSIS" +.B #include +.sp +.B cc ... \-latomic_ops_gpl +.sp +Note that the AO_stack implementation is licensed under the GPL, unlike the lower level routines. + +.B void AO_stack_init(AO_stack_t *list); +.br +.B void AO_stack_push_release(AO_stack_t *list, AO_t *new_element); +.br +.B AO_t * AO_stack_pop_acquire(volatile AO_stack_t *list); +.SH "DESCRIPTION" +.B libatomic\-stack +defines a linked stack abstraction. Stacks may be accessed by multiple concurrent threads. +The implementation is 1\-lock\-free, i.e. it will continue to make progress if at most one thread +becomes inactive while operating on the data structure. + +This makes it safe to access these data structures from non\-reentrant +signal handlers, provided at most one non\-signal\-handler thread is +accessing the data structure at once. This latter condition can be +ensured by acquiring an ordinary lock around the non\-hndler accesses +to the data structure. + +We use a fully lock\-free implementation when the underlying hardware +makes that less expensive, i.e. when we have a double\-wide compare\-and\-swap +operation available. (The fully lock\-free implementation uses an AO_t\- +sized version count, and assumes it does not wrap during the time any +given operation is active. This seems reasonably safe on 32\-bit hardware, +and very safe on 64\-bit hardware.) If a fully lock\-free implementation +is used, the macro +.I AO_STACK_IS_LOCK_FREE +will be defined. + +The cleanest way to use these routines is probably to define the stack node +type with an initial +.I AO_t +link field, so that the conversion between the +link\-field pointer and the stack element pointer is just a compile\-time +cast. But other possibilities exist. (This would be cleaner in C++ with +templates.) + +A stack is represented by an AO_stack_t structure. (This is normally +2 or 3 times the size of a pointer.) It may be statically initialized +by setting it to +.I AO_STACK_INITIALIZER +, or dynamically initialized to +an empty stack with +.I AO_stack_init +. There are only three operations for +accessing stacks: + +.TP +.B AO_stack_init +Initalise a stack +.TP +.B AO_stack_push_release +Push new element onto the stack. +.TP +.B AO_stack_pop_acquire +Pop element off the stack. + +.LP +We require that the objects pushed as list elements remain addressable +as long as any push or pop operation are in progress. (It is OK for an object +to be "pop"ped off a stack and "deallocated" with a concurrent "pop" on +the same stack still in progress, but only if "deallocation" leaves the +object addressable. The second "pop" may still read the object, but +the value it reads will not matter.) + +We require that the headers ( +.I AO_stack +objects) remain allocated and +valid as long as any operations on them are still in\-flight. + +We also provide macros +.I AO_REAL_HEAD_PTR +that converts an +.I AO_stack_t +to a pointer to the link field in the next element, and +.I AO_REAL_NEXT_PTR +that converts a link field to a real, dereferencable, pointer to the link field +in the next element. This is intended only for debugging, or to traverse +the list after modification has ceased. There is otherwise no guarantee that +walking a stack using this macro will produce any kind of consistent +picture of the data structure. +.SH "SEE ALSO" +libatomic\-ops(3), libatomic\-malloc(3) +.SH "AUTHOR" +This manual page was written by Ian Wienand , based on comments in the source code. It was written for the Debian project (but may be used by others). --- libatomic-ops-7.4.2.orig/debian/patches/0001-Use-LLD-and-SCD-instructions-on-mips64.patch +++ libatomic-ops-7.4.2/debian/patches/0001-Use-LLD-and-SCD-instructions-on-mips64.patch @@ -0,0 +1,142 @@ +From 54d1da56809b892d2fc521fea0fd41ea8c23e4f2 Mon Sep 17 00:00:00 2001 +From: James Cowgill +Date: Thu, 8 Jan 2015 16:00:38 +0000 +Subject: [PATCH 1/5] Use LLD and SCD instructions on mips64 + +--- + src/atomic_ops/sysdeps/gcc/mips.h | 54 ++++++++++++++++++++++----------------- + 1 file changed, 30 insertions(+), 24 deletions(-) + +diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h +index a891de6..83a6bd3 100644 +--- a/src/atomic_ops/sysdeps/gcc/mips.h ++++ b/src/atomic_ops/sysdeps/gcc/mips.h +@@ -15,7 +15,6 @@ + * FIXME: This should probably make finer distinctions. SGI MIPS is + * much more strongly ordered, and in fact closer to sequentially + * consistent. This is really aimed at modern embedded implementations. +- * It looks to me like this assumes a 32-bit ABI. -HB + */ + + #include "../all_aligned_atomic_load_store.h" +@@ -27,14 +26,24 @@ + /* Data dependence does not imply read ordering. */ + #define AO_NO_DD_ORDERING + ++#ifdef __mips64 ++# define AO_MIPS_SET_ISA " .set mips3\n" ++# define AO_MIPS_LL_1(args) " lld " args "\n" ++# define AO_MIPS_SC(args) " scd " args "\n" ++#else ++# define AO_MIPS_SET_ISA " .set mips2\n" ++# define AO_MIPS_LL_1(args) " ll " args "\n" ++# define AO_MIPS_SC(args) " sc " args "\n" ++# define AO_T_IS_INT ++#endif ++ + #ifdef AO_ICE9A1_LLSC_WAR + /* ICE9 rev A1 chip (used in very few systems) is reported to */ + /* have a low-frequency bug that causes LL to fail. */ + /* To workaround, just issue the second 'LL'. */ +-# define AO_MIPS_LL_FIX(args_str) \ +- " ll " args_str "\n" ++# define AO_MIPS_LL(args) AO_MIPS_LL_1(args) AO_MIPS_LL_1(args) + #else +-# define AO_MIPS_LL_FIX(args_str) "" ++# define AO_MIPS_LL(args) AO_MIPS_LL_1(args) + #endif + + AO_INLINE void +@@ -42,7 +51,7 @@ AO_nop_full(void) + { + __asm__ __volatile__( + " .set push \n" +- " .set mips2 \n" ++ AO_MIPS_SET_ISA + " .set noreorder \n" + " .set nomacro \n" + " sync \n" +@@ -60,13 +69,13 @@ AO_fetch_and_add(volatile AO_t *addr, AO_t incr) + + __asm__ __volatile__( + " .set push\n" +- " .set mips2\n" ++ AO_MIPS_SET_ISA + " .set noreorder\n" + " .set nomacro\n" +- "1: ll %0, %2\n" +- AO_MIPS_LL_FIX("%0, %2") ++ "1: " ++ AO_MIPS_LL("%0, %2") + " addu %1, %0, %3\n" +- " sc %1, %2\n" ++ AO_MIPS_SC("%1, %2") + " beqz %1, 1b\n" + " nop\n" + " .set pop " +@@ -85,13 +94,13 @@ AO_test_and_set(volatile AO_TS_t *addr) + + __asm__ __volatile__( + " .set push\n" +- " .set mips2\n" ++ AO_MIPS_SET_ISA + " .set noreorder\n" + " .set nomacro\n" +- "1: ll %0, %2\n" +- AO_MIPS_LL_FIX("%0, %2") ++ "1: " ++ AO_MIPS_LL("%0, %2") + " move %1, %3\n" +- " sc %1, %2\n" ++ AO_MIPS_SC("%1, %2") + " beqz %1, 1b\n" + " nop\n" + " .set pop " +@@ -114,14 +123,14 @@ AO_test_and_set(volatile AO_TS_t *addr) + + __asm__ __volatile__( + " .set push \n" +- " .set mips2 \n" ++ AO_MIPS_SET_ISA + " .set noreorder \n" + " .set nomacro \n" +- "1: ll %0, %1 \n" +- AO_MIPS_LL_FIX("%0, %1") ++ "1: " ++ AO_MIPS_LL("%0, %1") + " bne %0, %4, 2f \n" + " move %0, %3 \n" +- " sc %0, %1 \n" ++ AO_MIPS_SC("%0, %1") + " .set pop \n" + " beqz %0, 1b \n" + " li %2, 1 \n" +@@ -142,14 +151,14 @@ AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) + + __asm__ __volatile__( + " .set push\n" +- " .set mips2\n" ++ AO_MIPS_SET_ISA + " .set noreorder\n" + " .set nomacro\n" +- "1: ll %0, %2\n" +- AO_MIPS_LL_FIX("%0, %2") ++ "1: " ++ AO_MIPS_LL("%0, %2") + " bne %0, %4, 2f\n" + " move %1, %3\n" +- " sc %1, %2\n" ++ AO_MIPS_SC("%1, %2") + " beqz %1, 1b\n" + " nop\n" + " .set pop\n" +@@ -167,6 +176,3 @@ AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) + /* CAS primitives with acquire, release and full semantics are */ + /* generated automatically (and AO_int_... primitives are */ + /* defined properly after the first generalization pass). */ +- +-/* FIXME: 32-bit ABI is assumed. */ +-#define AO_T_IS_INT +-- +2.5.0 + --- libatomic-ops-7.4.2.orig/debian/patches/0002-Remove-inclusion-of-acquire_release_volatile.h-on-mi.patch +++ libatomic-ops-7.4.2/debian/patches/0002-Remove-inclusion-of-acquire_release_volatile.h-on-mi.patch @@ -0,0 +1,29 @@ +From 63584ff032f8f149c33a776015632e2b73598baa Mon Sep 17 00:00:00 2001 +From: James Cowgill +Date: Thu, 8 Jan 2015 16:05:57 +0000 +Subject: [PATCH 2/5] Remove inclusion of acquire_release_volatile.h on mips + +I'm not entirely sure how this ended up here. It might have been the case +that MIPS processors used to do this, but the ISA manuals don't say anything +about volatile loads / stores having aquire / release semnatics, so just +remove it to be safe. +--- + src/atomic_ops/sysdeps/gcc/mips.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h +index 83a6bd3..f3796ea 100644 +--- a/src/atomic_ops/sysdeps/gcc/mips.h ++++ b/src/atomic_ops/sysdeps/gcc/mips.h +@@ -19,8 +19,6 @@ + + #include "../all_aligned_atomic_load_store.h" + +-#include "../loadstore/acquire_release_volatile.h" +- + #include "../test_and_set_t_is_ao_t.h" + + /* Data dependence does not imply read ordering. */ +-- +2.5.0 + --- libatomic-ops-7.4.2.orig/debian/patches/0003-Minor-fix-of-code-alignment-in-mips-AO_compare_and_s.patch +++ libatomic-ops-7.4.2/debian/patches/0003-Minor-fix-of-code-alignment-in-mips-AO_compare_and_s.patch @@ -0,0 +1,25 @@ +From e04c234e8608c30b944a4a586035498dd3ae2dc0 Mon Sep 17 00:00:00 2001 +From: James Cowgill +Date: Thu, 8 Jan 2015 16:14:22 +0000 +Subject: [PATCH 3/5] Minor fix of code alignment in mips AO_compare_and_swap + +--- + src/atomic_ops/sysdeps/gcc/mips.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h +index f3796ea..1ad47f2 100644 +--- a/src/atomic_ops/sysdeps/gcc/mips.h ++++ b/src/atomic_ops/sysdeps/gcc/mips.h +@@ -127,7 +127,7 @@ AO_test_and_set(volatile AO_TS_t *addr) + "1: " + AO_MIPS_LL("%0, %1") + " bne %0, %4, 2f \n" +- " move %0, %3 \n" ++ " move %0, %3 \n" + AO_MIPS_SC("%0, %1") + " .set pop \n" + " beqz %0, 1b \n" +-- +2.5.0 + --- libatomic-ops-7.4.2.orig/debian/patches/0004-Support-n32-ABI-for-mips64.patch +++ libatomic-ops-7.4.2/debian/patches/0004-Support-n32-ABI-for-mips64.patch @@ -0,0 +1,32 @@ +From 2c5f848c87f06fb645c427cd00090b3a383ee38a Mon Sep 17 00:00:00 2001 +From: Frank Schaefer +Date: Sat, 9 May 2015 05:26:43 +0000 +Subject: [PATCH 4/5] Support n32 ABI for mips64 + +Without the proposed change, the existing preprocessor checks for +mips64 support do not account for the n32 ABI (when building with +"gcc -mabi=n32", test_atomic and test_stack both fail, and +test_malloc appears to hang indefinitely while spinning at 100%). + +* src/atomic_ops/sysdeps/gcc/mips.h (AO_MIPS_SET_ISA, AO_MIPS_LL_1, +AO_MIPS_SC): Define depending on _MIPS_SIM value. +--- + src/atomic_ops/sysdeps/gcc/mips.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h +index 1ad47f2..73ca551 100644 +--- a/src/atomic_ops/sysdeps/gcc/mips.h ++++ b/src/atomic_ops/sysdeps/gcc/mips.h +@@ -24,7 +24,7 @@ + /* Data dependence does not imply read ordering. */ + #define AO_NO_DD_ORDERING + +-#ifdef __mips64 ++#if defined(_ABI64) && (_MIPS_SIM == _ABI64) + # define AO_MIPS_SET_ISA " .set mips3\n" + # define AO_MIPS_LL_1(args) " lld " args "\n" + # define AO_MIPS_SC(args) " scd " args "\n" +-- +2.5.0 + --- libatomic-ops-7.4.2.orig/debian/patches/0005-Fix-GCC-5.x-compatibility-for-AArch64-double-wide-pr.patch +++ libatomic-ops-7.4.2/debian/patches/0005-Fix-GCC-5.x-compatibility-for-AArch64-double-wide-pr.patch @@ -0,0 +1,42 @@ +From a7ddab076bfc4b967693f15c3367f53d62aace9e Mon Sep 17 00:00:00 2001 +From: Frank Schaefer +Date: Tue, 9 Jun 2015 17:10:00 -0500 +Subject: [PATCH 5/5] Fix GCC 5.x compatibility for AArch64 double-wide + primitives + +Small change to make aarch64 support work with gcc 5.x. Otherwise it +demands gcc -latomic and still fails test_stack. + +* src/atomic_ops/sysdeps/gcc/aarch64.h (AO_double_load, +AO_double_load_acquire, AO_double_store, AO_double_store_release, +AO_double_compare_and_swap, AO_double_compare_and_swap_acquire, +AO_double_compare_and_swap_release, AO_double_compare_and_swap_full): +Use assembly implementation even for GCC v5+ (not just GCC 4.x). +--- + src/atomic_ops/sysdeps/gcc/aarch64.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/atomic_ops/sysdeps/gcc/aarch64.h b/src/atomic_ops/sysdeps/gcc/aarch64.h +index f969f13..b7f2ef0 100644 +--- a/src/atomic_ops/sysdeps/gcc/aarch64.h ++++ b/src/atomic_ops/sysdeps/gcc/aarch64.h +@@ -30,7 +30,7 @@ + #endif + + /* TODO: Adjust version check on fixing double-wide AO support in GCC. */ +-#if __GNUC__ == 4 ++#if __GNUC__ >= 4 + + AO_INLINE AO_double_t + AO_double_load(const volatile AO_double_t *addr) +@@ -195,6 +195,6 @@ + return !result; + } + # define AO_HAVE_double_compare_and_swap_full +-#endif /* __GNUC__ == 4 */ ++#endif /* __GNUC__ >= 4 */ + + #include "generic.h" +-- +2.5.0 + --- libatomic-ops-7.4.2.orig/debian/patches/powerpc-fix.diff +++ libatomic-ops-7.4.2/debian/patches/powerpc-fix.diff @@ -0,0 +1,12 @@ +diff -pruN 7.3~alpha3+git20130717-1/src/atomic_ops/sysdeps/gcc/powerpc.h 7.4-0ubuntu3/src/atomic_ops/sysdeps/gcc/powerpc.h +--- 7.3~alpha3+git20130717-1/src/atomic_ops/sysdeps/gcc/powerpc.h 2013-07-16 22:58:48.000000000 +0000 ++++ 7.4-0ubuntu3/src/atomic_ops/sysdeps/gcc/powerpc.h 2014-02-24 20:36:31.000000000 +0000 +@@ -29,6 +29,8 @@ + + #include "../all_aligned_atomic_load_store.h" + ++#define AO_load(addr) AO_load_acquire(addr) ++ + #include "../test_and_set_t_is_ao_t.h" + /* There seems to be no byte equivalent of lwarx, so this */ + /* may really be what we want, at least in the 32-bit case. */ --- libatomic-ops-7.4.2.orig/debian/patches/series +++ libatomic-ops-7.4.2/debian/patches/series @@ -0,0 +1,6 @@ +0001-Use-LLD-and-SCD-instructions-on-mips64.patch +0002-Remove-inclusion-of-acquire_release_volatile.h-on-mi.patch +0003-Minor-fix-of-code-alignment-in-mips-AO_compare_and_s.patch +0004-Support-n32-ABI-for-mips64.patch +0005-Fix-GCC-5.x-compatibility-for-AArch64-double-wide-pr.patch +powerpc-fix.diff --- libatomic-ops-7.4.2.orig/debian/rules +++ libatomic-ops-7.4.2/debian/rules @@ -0,0 +1,56 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) + +%: + dh $@ --parallel --with autoreconf + +override_dh_auto_configure: + dh_auto_configure -- --libdir="\$${prefix}/lib/$(DEB_HOST_MULTIARCH)" + +override_dh_auto_test: +ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + -dh_auto_test 2>&1 | tee test.log + rv=0; \ + fails=$$(awk '/^# FAIL:/ { print $$3 }' test.log); \ + if [ "$$fails" -eq 0 ]; then \ + echo "all tests did pass on $(DEB_HOST_ARCH)"; \ + else \ + if [ -f debian/test-expected.$(DEB_HOST_ARCH) ]; then \ + cp debian/test-expected.$(DEB_HOST_ARCH) test-expected.log; \ + else \ + rm -f test-expected.log; touch test-expected.log; \ + fi; \ + grep '^FAIL: ' test.log | sort > test-fail.log; \ + comm -13 test-expected.log test-fail.log > test-regress.log; \ + comm -23 test-expected.log test-fail.log > test-progress.log; \ + if [ -z "$$(cat test-regress.log)" ]; then \ + echo "expected test failures on $(DEB_HOST_ARCH)"; \ + if [ -n "$$(cat test-progress.log)" ]; then \ + echo "unexpected test progressions on $(DEB_HOST_ARCH)"; \ + cat test-progress.log; \ + fi; \ + else \ + echo "unexpected test failures on $(DEB_HOST_ARCH)"; \ + cat test-regress.log; \ + rv=1; \ + fi; \ + if [ -n "$$(cat test-fail.log)" ]; then \ + for t in $$(awk '{print $$2}' test-fail.log); do \ + echo "=============== $$t ==============="; \ + cat tests/$$t.log; \ + done; \ + echo "=============== tests/test-suite.log ==============="; \ + cat tests/test-suite.log; \ + fi; \ + fi; \ + exit $$rv +endif + +override_dh_auto_install: + dh_auto_install --destdir=$(CURDIR)/debian/tmp + +override_dh_auto_clean: + rm -f test*.log + dh_auto_clean