summaryrefslogtreecommitdiffstats
path: root/usr.bin/ar
Commit message (Collapse)AuthorAgeFilesLines
* MFC r286010: ar: enable deterministic mode by defaultemaste2015-09-252-7/+23
| | | | | | | | | | | | | Ar cannot handle UIDs with more than 6 digits, and storing the mtime, uid, gid and mode provides little to negative value anyhow for ar's uses. Turn on deterministic (-D) mode by default; it can be disabled by the user with -U. Also MFC follow-on fixes in r286024 and r287324. PR: 196929 Relnotes: Yes Sponsored by: The FreeBSD Foundation
* MFC r287327: ar: Deobfuscate a while loopemaste2015-09-241-1/+1
|
* MFC r285844: ar: add -U (unique) option to disable -D (deterministic) modeemaste2015-08-312-7/+34
| | | | | | | | | This is required in order for us to support deterministic mode by default. If multiple -D or -U options are specified on the command line, the final one takes precedence. GNU ar also uses -U for this. PR: 196929 Sponsored by: The FreeBSD Foundation
* MFC r284928: speed up ar(1) on UFS file systemsemaste2015-07-071-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fault in the buffer prior to writing to workaround poor performance due to interaction with kernel fs deadlock avoidance code. See the comment prior to vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the issue. On my stable/10 desktop with a 16MB obj.o and "ar r out.a obj.o" I see the following run times (seconds): x ar.r284891 + ar.patched +----------------------------------------------------------------------+ |+ | |+ x| |+ xx| |A |A| +----------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 1.307 1.321 1.315 1.3143333 0.0070237692 + 3 0.020 0.023 0.022 0.021666667 0.0015275252 Difference at 95.0% confidence -1.29267 +/- 0.0115203 -98.3515% +/- 0.876513% (Student's t, pooled s = 0.00508265) Thanks to kib for diagnosing and explaining the issue and suggesting the workaround. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation
* MFC r276774: ar: Avoid null pointer deref while reading corrupt archivesemaste2015-05-211-1/+2
| | | | | | | ELF Tool Chain ticket #467 Reported by: Alexander Cherepanov <cherepan@mccme.ru> Sponsored by: The FreeBSD Foundation
* MFC r281311: ar: Disallow directory traversalemaste2015-04-241-1/+9
| | | | | | | | | | | | | | | | Set ARCHIVE_EXTRACT_SECURE_SYMLINKS and ARCHIVE_EXTRACT_SECURE_NODOTDOT as in bsdtar to prevent extraction of archive entries whose pathnames contain .. or whose target directory would be altered by a symlink. Also disallow absolute pathnames. We don't currently provide an option to disable this behaviour (as bsdtar's -P does). It is unlikely to be a problem in practice for ar(1), but the -P option is not currently used and available if we want to consider it for this purpose. Obtained from: ELF tool chain ar, Ticket #474 Relnotes: Yes Sponsored by: The FreeBSD Foundation
* Work around build breakages with GCC 4.2.jkim2013-05-231-0/+2
| | | | Reported by: tinderbox
* Improve compatibility with recent flex from flex.sourceforge.net.jkim2013-05-031-2/+2
|
* Add the Clang specific -Wmissing-variable-declarations to WARNS=6.ed2013-04-191-0/+2
| | | | | | | | | | | | | This compiler flag enforces that that people either mark variables static or use an external declarations for the variable, similar to how -Wmissing-prototypes works for functions. Due to the fact that Yacc/Lex generate code that cannot trivially be changed to not warn because of this (lots of yy* variables), add a NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this specific compiler warning. Announced on: toolchain@
* MFV r248590,248594:mm2013-03-221-2/+2
| | | | | | | | | | | Update libarchive to 3.1.2 Some of new features: - support for lrzip and grzip compression - support for writing tar v7 format - b64encode and uuencode filters - support for __MACOSX directory in Zip archives - support for lzop compresion (external utility)
* Replace deprecated (or remove obsolete) libarchive 2.8 functionsmm2013-03-223-11/+7
| | | | with libarchive 3.0 counterparts
* Mark bsdar_errc as __dead2 to help code analysis tools.eadler2012-10-221-1/+1
| | | | | | | PR: bin/172636 Submitted by: Erik Cederstrand <erik@cederstrand.dk> Approved by: cperciva MFC after: 3 days
* Fix world after byacc import:bapt2012-05-221-1/+0
| | | | | | | | - old yacc(1) use to magicially append stdlib.h, while new one don't - new yacc(1) do declare yyparse by itself, fix redundant declaration of 'yyparse' Approved by: des (mentor)
* Add src.conf option WITH_SHARED_TOOLCHAIN to enable building thekib2012-04-291-0/+4
| | | | | | | | toolchain binaries as dynamically linked. Option is disabled by default. Reviewed by: ru (previous version) MFC after: 2 weeks
* Update libarchive to 3.0.3mm2012-02-251-2/+2
| | | | | | | | | | | | | | Some of new features: - New readers: RAR, LHA/LZH, CAB reader, 7-Zip - New writers: ISO9660, XAR - Improvements to many formats, especially including ISO9660 and Zip - Stackable write filters to write, e.g., tar.gz.uu in a single pass - Exploit seekable input; new "seekable" Zip reader can exploit the Zip Central Directory when it's available; the old "streamable" Zip reader is still fully supported for cases where seeking is not possible. Full release notes available at: https://github.com/libarchive/libarchive/wiki/ReleaseNotes
* Whitespace cleanup:gjb2011-12-231-3/+3
| | | | | | | | | ar/ar.1: - Remove trailing whitespace Reported by: igor MFC after: 1 week X-MFC-With: r228823
* Formatting fixes:gjb2011-12-231-2/+2
| | | | | | | | | | | | | | | | hexdump/od.1: - Enclose tabbed content in quotes [1] ar/ar.1: - Enclose tabbed content in quotes [1] rctl/rctl.8: - Enclose tabbed content in quotes [1] - Start a sentence on a newline [2] Reported by: manlint [1], igor [2] MFC after: 1 week X-MFC-after: 9.0-RELEASE
* Don't try to free() an address returned by mmap(). This appears to beemaste2011-08-041-13/+20
| | | | | | | | | triggered by the same .o being included twice on the command line. Found by: Nima Misaghian at Sandvine Reviewed by: kientzle, kaiw Approved by: re MFC after: 1 week
* Correct typos in comments, no functional changes.bcr2011-05-203-8/+8
| | | | | | Found by: codespell Reviewed by: kaiw MFC after: 1 week
* Document the syntax accepted by the `-M` option.kaiw2010-12-261-0/+129
| | | | Obtained from: elftoolchain
* Improve the description of the `-q` option.kaiw2010-12-261-13/+5
| | | | Obtained from: elftoolchain
* * Add mention of the `-f`, `-q`, `-S`, and `-V` options in the synopsiskaiw2010-12-261-31/+75
| | | | | | | | | | | section. * Document the `-l`, `-M` and `-S` options. * Improve the text describing the behavior of the `-r` option. * Start a section on standard compliance. * Indicate in the synopsis that the `-S` and `-s` options are mutually exclusive. Obtained from: elftoolchain
* Add option -D for ranlib(1). When -D is speicified, ranlib(1) will generatekaiw2010-11-282-1/+5
| | | | | | | a deterministic archive symbol table (i.e. timestamp for the symbol table member header is set to 0). Submitted by: Erik Cederstrand
* Fix some more warnings found by clang.brucec2010-11-221-0/+1
|
* Add -D (deterministic) option to ar.kientzle2010-10-094-9/+40
| | | | | | | | | When set, it forces all timestamps and owners to zero and modes to 0644. Useful for producing libraries that are bitwise identical across multiple build runs. Submitted by: Erik Cederstrand Reviewed by: Kai Wang
* Fix a couple of typos.uqs2010-07-301-1/+1
| | | | | | PR: docs/148891 Submitted by: olgeni MFC after: 1 week
* Removed ar(1)'s support for compressed archives. This change removeskaiw2010-05-177-40/+11
| | | | | | | | | | | | | | ar(1)'s dependencies on compressor libraries -lz, -lbz2 and -llzma and fixes building HEAD on some versions of FreeBSD[78]. Option -j and -z is now accepted but ignored. Compressed ar(1) archives are not useful without a ld(1) that can read them. Also, the current ar(1) compression scheme prevents random access of archive members and needs to be redesigned anyway. Submitted by: kientzle (original patch) Reviewed by: delphij Discussed on: -current mailing list
* Enable liblzma support in libarchivemm2010-05-101-2/+2
| | | | | | | | Adjust dependencies for programs using libarchive Add xz and linkage against liblzma to rescue system Approved by: kientzle, delphij (mentor) MFC after: 2 weeks
* mdoc: order prologue macros consistently by Dd/Dt/Osuqs2010-04-141-1/+1
| | | | | | | | Although groff_mdoc(7) gives another impression, this is the ordering most widely used and also required by mdocml/mandoc. Reviewed by: ru Approved by: philip, ed (mentors)
* Build usr.bin/ with WARNS=6 by default.ed2010-01-021-2/+0
| | | | Also add some missing $FreeBSD$ to keep svn happy.
* ANSIfy various tools in usr.bin/.ed2010-01-022-10/+10
| | | | | Most of these tools properly build at WARNS=6, except for their K&R function declarations. Fix this, so we can bump WARNS as well.
* ar only needs to support ar format.kientzle2009-12-292-2/+2
|
* Revert most part of 200420 as requested, as more review and polish isdelphij2009-12-131-0/+1
| | | | needed.
* Remove unneeded header includes from usr.bin/ except contributed code.delphij2009-12-111-1/+0
| | | | Tested with: make universe
* Act like ranlib if our name ends in ranlib. In particular,kientzle2009-03-201-2/+5
| | | | | | | this works with some recent cross-building changes by Warner that install ranlib as, e.g., "arm-freebsd7.1-ranlib". Submitted by: John Hein
* Fix build.kaiw2008-09-211-0/+2
|
* Add support for option "-M", which is used to operate ar(1) in akaiw2008-09-206-47/+864
| | | | | | | | | | | | | | | script mode like the MRI(Microtec Research Inc.) "librarian" program. Originally this option is provided by Binutils ar(1) to ease the transition for developers who are used to writing "librarian" scripts. We added this option to BSD ar(1) because: 1. Further improve the compatibility with Binutils ar(1). 2. There are still a few software using this -M option. (at least one in our ports collection) Suggested by: rink & erwin
* GNU ar did NOT implment option -q as a synonym of -r as the manualkaiw2008-03-114-6/+25
| | | | | | | | | | | | | | | | | page stated, thus BSD ar(1) option -q, which was implemented based on the GNU ar manual page, turns out to be incompatible with GNU ar -q. This change will make BSD ar(1) -q a *REAL* GNU ar -q: 1. It will update symbol table. (same as unfixed version) 2. It will NOT compare new members spcified in the command line args with existing members, instead, append them directly. Reported by: Johannes 5 Joemann <joemann@beefree.free.de> Reported by: Timothy Bourke <timbob@bigpond.com> Tested by: Johannes 5 Joemann <joemann@beefree.free.de> Reviewed by: jkoshy Approved by: jkoshy (mentor)
* - Do not malloc buffer for 0-size member when reading from archive.kaiw2008-03-021-11/+17
| | | | | | | | | | | | | - Fix a malloc buffer overrun: Use a while loop to check whether the string buffer is big enough after resizing, since doubling once might not be enough when a very long member name or symbol name is provided. - Fix typo. Reported by: Michael Plass <mfp49_freebsd@plass-family.net> Tested by: Michael Plass <mfp49_freebsd@plass-family.net> Reviewed by: jkoshy Approved by: jkoshy
* Make again BSD ar(1) the default system ar(1), now properly handlingru2008-02-251-14/+1
| | | | | | | | | | | | | source upgrades by falling back to GNU ar(1) as necessary. Option WITH_BSDAR is gone. Option _WITH_GNUAR to aid in upgrades is *not* supposed to be set by the user. Stop bootstrapping BSD ar(1) on the next __FreeBSD_version bump, as there are no known bugs in it. Bump __FreeBSD_version to anticipate this and to flag the switch to BSD ar(1), should it be needed for something. Input from: obrien, des, kaiw
* style(9) whitespace fix: A space is mandated after keyword 'return'.kaiw2008-02-241-5/+5
| | | | | Submitted by: jkoshy Approved by: jkoshy (mentor)
* Since the program is installed as 'bsdranlib', we need tokaiw2008-02-241-1/+2
| | | | | | | | | check if it is invoked as 'bsdranlib'. Reported by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net> Reviewed by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net> Reviewed by: jkoshy Approved by: jkoshy (mentor)
* Handle properly when insert zero size objects into the archive:kaiw2008-02-241-3/+9
| | | | | | | | | | | | | | | | Do not mmap 0-size objects and do not try to extract symbol from 0-size objects, but do treat 0-size objects as qualified objects and accept them as an archive member. (A member with only the header part) Note that GNU binutils ar on FreeBSD ignores 0-size objects, but on Linux it accepts them. [1] But, since this is a rare usage, we can safely ignore the compatibility issue. Reported by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net> Pointed out by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net> [1] Reviewed by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net> Reviewed by: jkoshy Approved by: jkoshy (mentor)
* Fix typo.brueffer2008-02-231-1/+1
|
* Fix essential bugs and warnings.ru2008-02-221-5/+4
|
* Clean up created turds.obrien2008-02-221-0/+1
|
* We build important toolchain statically. So build BSD 'ar' staticallyobrien2008-02-221-0/+1
| | | | when its replacing GNU 'ar'.
* Re-introduce the new BSDLed 'ar' to the build.obrien2008-02-222-2/+18
| | | | | | It is installed as "bsdar" unless WANT_BSDAR is defined. Discussed with: kaiw
* Fix static linkage.ru2008-02-211-2/+2
|
* Import ar(1) front-end. (aka 'BSD' ar)kaiw2008-02-217-0/+1989
| | | | | | | | | | | | | | | | | | Reviewed by: jkoshy Approved by: jkoshy (mentor) Tested by: erwin (ports build test on pointyhat) Sponsored by: Google Summer of Code 2007 Reviewed by (earlier version): Jaakko Heinonen <jh[AT]saunalahti.fi> Tested by (earlier version): Steve Kargl <sgk[AT]troutmask.apl.washington.edu> Tested by (earlier version): Martin Voros <martin_voros[AT]yahoo.com> Tested by (earlier version): swell.k[AT]gmail.com Tested by (earlier version): joel Tested by (earlier version): Alexey Shuvaev <shuvaev[AT]physik.uni-wuerzburg.de> Tested by (earlier version): Arjan van Leeuwen <avleeuwen[AT]gmail.com> Thanks to gabor@ for building ports for it. Thanks to erwin@ and kris@ for scheduling the ports build test on pointyhat. And thanks to many others for their feedback.
OpenPOWER on IntegriCloud