summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Fix partially matching relative paths in xinstall.gordon2019-05-142-2/+37
| | | | | Approved by: so Security: FreeBSD-EN-19:09.xinstall
* MFC r333007benno2018-04-251-2/+2
| | | | | | Update release version of FreeBSD. Sponsored by: iXsystems, Inc.
* MFC r332436, r332440benno2018-04-242-21/+104
| | | | | | | | | | | | | | | | | | r332436: Add the ability to specify absolute and relative offsets to size partitions. To create hybrid boot media we want to specify a partition at a known location. This extends the syntax of size partitions to include an optional offset that can be absolute or relative. It also introduces validation to make sure that this hasn't resulted in overlapping partitions. I haven't added this to the file and process partition specifications yet but the mechanics are designed such that if someone comes up with a good way of specifying the offset it will be fairly easy to add in. r332440: Fix a conditional that got mucked up. Sponsored by: iXsystems, Inc.
* Actually MFC r331949, r332437, r332438benno2018-04-246-0/+602
| | | | | | | | | | | | | | | | | | | | (Previous commit didn't have new files added.) r331949: Add the etdump utility for dumping El Torito boot catalog information. This can be used to check existing images but will be used in the future to find EFI ESP images placed in El Torito catalogs so they can be used for hybrid boot purposes. r332427: Check the return value of fseek. r332438: Remove a debugging printf that crept in. Sponsored by: iXsystems, Inc. Pointy hat to: benno
* MFC r331949, r332437, r332438benno2018-04-241-0/+1
| | | | | | | | | | | | | | | | | r331949: Add the etdump utility for dumping El Torito boot catalog information. This can be used to check existing images but will be used in the future to find EFI ESP images placed in El Torito catalogs so they can be used for hybrid boot purposes. r332427: Check the return value of fseek. r332438: Remove a debugging printf that crept in. Sponsored by: iXsystems, Inc.
* MFC r332414:dim2018-04-211-3/+258
| | | | | | | | Regenerate clang man page after upstream change to document the possible values for the -std= option. Noticed by: Steve Kargl Obtained from: https://reviews.llvm.org/rL329827
* MFC r332353:tuexen2018-04-161-51/+48
| | | | | | Don't show the number of currently established SCTP associations, since this is not monotonically increasing. It's number can be derived from the other counters shown.
* MFC r330741:trasz2018-04-161-1/+2
| | | | Make iscsictl(1) display "Disabled" status for disabled sessions.
* MFC r330024:trasz2018-04-162-3/+5
| | | | | | .Xr rctl(8) and cpuset(1). PR: 225935
* MFC r330710, r330718-r330720asomers2018-04-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r330710: tftpd: Flush files as soon as they are fully received On an RRQ, tftpd doesn't exit as soon as it's finished receiving a file. Instead, it waits five seconds just in case the client didn't receive the server's last ACK and decides to resend the final DATA packet. Unfortunately, this created a 5 second delay from when the client thinks it's done sending the file, and when the file is available for other processes. Fix this bug by closing the file as soon as receipt is finished. PR: 157700 Reported by: Barry Mishler <barry_mishler@yahoo.com> r330718: tftpd: Verify world-writability for WRQ when using relative paths tftpd(8) says that files may only be written if they already exist and are publicly writable. tftpd.c verifies that a file is publicly writable if it uses an absolute pathname. However, if the pathname is relative, that check is skipped. Fix it. Note that this is not a security vulnerability, because the transfer ultimately doesn't work unless the file already exists and is owned by user nobody. Also, this bug does not affect the default configuration, because the default uses the "-s" option which makes all pathnames absolute. PR: 226004 r330719: tftpd: Abort on an WRQ access violation On a WRQ (write request) tftpd checks whether the client has access permission for the file in question. If not, then the write is prevented. However, tftpd doesn't reply with an ERROR packet, nor does it abort. Instead, it tries to receive the packet anyway. The symptom is slightly different depending on the nature of the error. If the target file is nonexistent and tftpd lacks permission to create it, then tftpd will willingly receive the file, but not write it anywhere. If the file exists but is not writable, then tftpd will fail to ACK to WRQ. PR: 225996 r330720: tftpd: reject unknown opcodes If tftpd receives a command with an unknown opcode, it simply exits 1. It doesn't send an ERROR packet, and the client will hang waiting for one. Fix it. PR: 226005
* MFC r329606:asomers2018-04-162-2/+49
| | | | | | | | | | | | tail: fix "tail -r" for piped input that begins with '\n' A subtle logic bug, probably introduced in r311895, caused tail to print the first two lines of piped input in forward order, if the very first character was a newline. PR: 222671 Reported by: Jim Long <freebsd-bugzilla@umpquanet.com>, pprocacci@gmail.com Sponsored by: Spectra Logic Corp
* MFC r326248:trasz2018-04-161-2/+3
| | | | .Xr pmcstat(8) from kgmon(8) and gprof(1).
* MFC r324237:trasz2018-04-162-1/+8
| | | | | | | | Make procstat(1) recognize process descriptors, so that it shows "P" instead of "?" in "procstat -af" output. Note that there are still a few more DTYPE_* kinds we don't decode yet. Sponsored by: DARPA, AFRL
* MFC r332483:kevans2018-04-164-19/+107
| | | | | | | | | | | | | | | | | | | | dtc(1): Update to upstream 006664a Highlights: - Passing "-" to -o will now cause output to go to stdout - Path-based syntactic sugar for overlays is now accepted. This looks like: /dts-v1/; /plugin/; &{/soc} { sid: eeprom@1c14000 { compatible = "allwinner,sun8i-h3-sid"; reg = <0x1c14000 0x400>; status = "okay"; }; };
* MFC r332372-r332374: tail(1)/head(1) compatibility long optionskevans2018-04-134-7/+37
| | | | | | | | | | | | | | | | | | | r332372: tail(1): Add some long options Add --blocks, --bytes, and --lines long options for -b, -c, and -n respectively. This improves tail(1)'s compatibility with its GNU counterpart in a straightforward way. r332373: tail(1): Address mandoc concern (space before punctuation after macro) r332374: head(1): Provide long options Provide long options --bytes and --lines to match -c and -n respectively. This improves head(1)'s compatibility with its GNU counterpart in a sensible way.
* MFC r319897-r319898, r319904: Improve yes' throughputkevans2018-04-131-6/+29
| | | | | | | | | | | | | r319897: Improve yes' throughput On my system, this brings up the throughput from ~20 to ~600 MiB/s. Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/ r319898: Handle partial writes r319904: style(9) fixes.
* MFC r308432, r308657: Capsicumize some trivial stdio programskevans2018-04-138-5/+55
| | | | | | | | | | | | r308432: Capsicumize some trivial stdio programs Trivially capsicumize some simple programs that just interact with stdio. This list of programs uses 'pledge("stdio")' in OpenBSD. r308657: fold(1): Revert incorrect r308432 As Jean-Sébastien notes, fold(1) requires handling argv-supplied files. That will require a slightly more sophisticated approach.
* MFC r306758 (emaste): locate: ANSIfykevans2018-04-132-13/+14
|
* MFC r328037: Rename 'recv' to 'receive' to appease shadow warnings from GCC.kevans2018-04-101-8/+8
|
* MFC r331935: vtfontcvt: allow .bdf characters less than full heightemaste2018-04-081-0/+13
| | | | Sponsored by: The FreeBSD Foundation
* MFC r328081:tuexen2018-04-071-0/+1
| | | | Add missing assignment to make sure non-first cmsgs are handled as such.
* MFC r328059:tuexen2018-04-071-0/+5
| | | | Improve the printing of cmgs when the length is 0. Fix error handling.
* MFC r328058:tuexen2018-04-071-6/+6
| | | | Using %p already prints "0x", so don't do it explicitly.
* MFC r328015:tuexen2018-04-072-130/+397
| | | | Decode msghdr argument of sendmsg() and recvmsg().
* MFC r327967:tuexen2018-04-072-6/+38
| | | | | | | | Improve support for sctp_generic_recvmsg() and sctp_generic_sendmsg() and add support for sctp_generic_sendmsg_iov(). Handle the struct iovec argument and the struct sctp_sndrcvinfo arguments.
* MFC r327961:tuexen2018-04-071-2/+2
| | | | | Mark the iovec parameters of writev() and readv() as IN and OUT. This makes truss work on readv() as expected.
* MFC r327921:tuexen2018-04-071-1/+1
| | | | Fix a typo introduced in r327919.
* MFC r327919:tuexen2018-04-072-1/+67
| | | | | | Add support for readv() and writev() to truss. Sponsored by:i Netflix, Inc.
* MFC r326672:tuexen2018-04-071-2/+0
| | | | | | | | | | Retire SCTP_WITH_NO_CSUM option. This option was used in the early days to allow performance measurements extrapolating the use of SCTP checksum offloading. Since this feature is now available, get rid of this option. This also un-breaks the LINT kernel. Thanks to markj@ for making me aware of the problem.
* MFC r323352:tuexen2018-04-071-2/+2
| | | | The combination of IPv6 and SCTP is also supported.
* MFC r320160: dtc: Update to upstream 917526kevans2018-04-061-1/+1
| | | | | - Add missing "typename" in divmod's "using" of binary_operator_base::result.
* Merge clang, llvm, lld, lldb, compiler-rt and libc++ 6.0.0 release, anddim2018-03-3132-136/+1200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | several follow-up fixes. MFC r327952: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r321788). Upstream has branched for the 6.0.0 release, which should be in about 6 weeks. Please report bugs and regressions, so we can get them into the release. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. MFC r328010: Pull in r322473 from upstream llvm trunk (by Andrei Elovikov): [LV] Don't call recordVectorLoopValueForInductionCast for newly-created IV from a trunc. Summary: This method is supposed to be called for IVs that have casts in their use-def chains that are completely ignored after vectorization under PSE. However, for truncates of such IVs the same InductionDescriptor is used during creation/widening of both original IV based on PHINode and new IV based on TruncInst. This leads to unintended second call to recordVectorLoopValueForInductionCast with a VectorLoopVal set to the newly created IV for a trunc and causes an assert due to attempt to store new information for already existing entry in the map. This is wrong and should not be done. Fixes PR35773. Reviewers: dorit, Ayal, mssimpso Reviewed By: dorit Subscribers: RKSimon, dim, dcaballe, hsaito, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D41913 This should fix "Vector value already set for part" assertions when building the net/iodine and sysutils/daa2iso ports. Reported by: jbeich PR: 224867, 224868 MFC r328090: Pull in r322623 from upstream llvm trunk (by Andrew V. Tischenko): Allow usage of X86-prefixes as separate instrs. Differential Revision: https://reviews.llvm.org/D42102 This should fix parse errors when x86 prefixes (such as 'lock' and 'rep') are followed by various non-mnemonic tokens, e.g. comments, .byte directives and labels. PR: 224669, 225054 MFC r328091: Revert r327340, as the workaround for rep prefixes followed by .byte directives is no longer needed after r328090. MFC r328141 (by emaste): lld: Fix for ld.lld does not accept "AT" syntax for declaring LMA region AT> lma_region expression allows to specify the memory region for section load address. Should fix [upstream LLVM] PR35684. LLVM review: https://reviews.llvm.org/D41397 Obtained from: LLVM r322359 by George Rimar MFC r328143 (by emaste): lld: Handle parsing AT(ADDR(.foo-bar)). The problem we had with it is that anything inside an AT is an expression, so we failed to parse the section name because of the - in it. Requested by: royger Obtained from: LLVM r322801 by Rafael Espindola MFC r328144 (by emaste): lld: Fix incorrect physical address on self-referencing AT command. When a section placement (AT) command references the section itself, the physical address of the section in the ELF header was calculated incorrectly due to alignment happening right after the location pointer's value was captured. The problem was diagnosed and the first version of the patch written by Erick Reyes. Obtained from: LLVM r322421 by Rafael Espindola MFC r328145: Pull in r322016 from upstream llvm trunk (by Sanjay Patel): [ValueTracking] remove overzealous assert The test is derived from a failing fuzz test: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5008 Credit to @rksimon for pointing out the problem. This should fix "Bad flavor while matching min/max" errors when building the graphics/libsixel and science/kst2 ports. Reported by: jbeich PR: 225268, 225269 MFC r328146: Pull in r322106 from upstream llvm trunk (by Alexey Bataev): [COST]Fix PR35865: Fix cost model evaluation for shuffle on X86. Summary: If the vector type is transformed to non-vector single type, the compile may crash trying to get vector information about non-vector type. Reviewers: RKSimon, spatel, mkuper, hfinkel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41862 This should fix "Not a vector MVT!" errors when building the games/dhewm3 port. Reported by: jbeich PR: 225271 MFC r328286 (by emaste): lld: Don't mark a shared library as needed because of a lazy symbol. Obtained from: LLVM r323221 by Rafael Esp?ndola MFC r328381: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r323338). PR: 224669 MFC r328513: Pull in r322245 from upstream clang trunk (by Craig Topper): [X86] Make -mavx512f imply -mfma and -mf16c in the frontend like it does in the backend. Similarly, make -mno-fma and -mno-f16c imply -mno-avx512f. Withou this "-mno-sse -mavx512f" ends up with avx512f being enabled in the frontend but disabled in the backend. Reported by: pawel PR: 225488 MFC r328542 (by emaste): lld: Use lookup instead of find. NFC, just simpler. Obtained from: LLVM r323395 by Rafael Espindola MFC r328543 (by emaste): lld: Only lookup LMARegion once. NFC. This is similar to how we handle MemRegion. Obtained from: LLVM r323396 by Rafael Espindola MFC r328544 (by emaste): lld: Remove MemRegionOffset. NFC. We can just use a member variable in MemoryRegion. Obtained from: LLVM r323399 by Rafael Espindola MFC r328545 (by emaste): lld: Simplify. NFC. Obtained from: LLVM r323440 by Rafael Espindola MFC r328546 (by emaste): lld: Improve LMARegion handling. This fixes the crash reported at [LLVM] PR36083. The issue is that we were trying to put all the sections in the same PT_LOAD and crashing trying to write past the end of the file. This also adds accounting for used space in LMARegion, without it all 3 PT_LOADs would have the same physical address. Obtained from: LLVM r323449 by Rafael Espindola MFC r328547 (by emaste): lld: Move LMAOffset from the OutputSection to the PhdrEntry. NFC. If two sections are in the same PT_LOAD, their relatives offsets, virtual address and physical addresses are all the same. [Rafael] initially wanted to have a single global LMAOffset, on the assumption that every ELF file was in practiced loaded contiguously in both physical and virtual memory. Unfortunately that is not the case. The linux kernel has: LOAD 0x200000 0xffffffff81000000 0x0000000001000000 0xced000 0xced000 R E 0x200000 LOAD 0x1000000 0xffffffff81e00000 0x0000000001e00000 0x15f000 0x15f000 RW 0x200000 LOAD 0x1200000 0x0000000000000000 0x0000000001f5f000 0x01b198 0x01b198 RW 0x200000 LOAD 0x137b000 0xffffffff81f7b000 0x0000000001f7b000 0x116000 0x1ec000 RWE 0x200000 The delta for all but the third PT_LOAD is the same: 0xffffffff80000000. [Rafael] thinks the 3rd one is a hack for implementing per cpu data, but we can't break that. Obtained from: LLVM r323456 by Rafael Espindola MFC r328548 (by emaste): lld: Put the header in the first PT_LOAD even if that PT_LOAD has a LMAExpr The root problem is that we were creating a PT_LOAD just for the header. That was technically valid, but inconvenient: we should not be making the ELF discontinuous. The solution is to allow a section with LMAExpr to be added to a PT_LOAD if that PT_LOAD doesn't already have a LMAExpr. LLVM PR: 36017 Obtained from: LLVM r323625 by Rafael Espindola MFC r328594 (by emaste): Pull in r322108 from upstream llvm trunk (by Rafael Esp?ndola): Make one of the emitFill methods non virtual. NFC. This is just preparatory work to fix [LLVM] PR35858. MFC r328595 (by emaste): Pull in r322123 from upstream llvm trunk (by Rafael Esp?ndola): Don't create MCFillFragment directly. Instead use higher level APIs that take care of most bookkeeping. MFC r328596 (by emaste): Pull in r322131 from upstream llvm trunk (by Rafael Esp?ndola): Use a MCExpr for the size of MCFillFragment. This allows the size to be found during ralaxation. This fixes [LLVM] pr35858. Requested by: royger MFC r328753: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r323948). PR: 224669 MFC r328817: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r324090). This introduces retpoline support, with the -mretpoline flag. The upstream initial commit message (r323155 by Chandler Carruth) contains quite a bit of explanation. Quoting: Introduce the "retpoline" x86 mitigation technique for variant #2 of the speculative execution vulnerabilities disclosed today, specifically identified by CVE-2017-5715, "Branch Target Injection", and is one of the two halves to Spectre. Summary: First, we need to explain the core of the vulnerability. Note that this is a very incomplete description, please see the Project Zero blog post for details: https://googleprojectzero.blogspot.com/2018/01/reading-privileged-memory-with-side.html The basis for branch target injection is to direct speculative execution of the processor to some "gadget" of executable code by poisoning the prediction of indirect branches with the address of that gadget. The gadget in turn contains an operation that provides a side channel for reading data. Most commonly, this will look like a load of secret data followed by a branch on the loaded value and then a load of some predictable cache line. The attacker then uses timing of the processors cache to determine which direction the branch took *in the speculative execution*, and in turn what one bit of the loaded value was. Due to the nature of these timing side channels and the branch predictor on Intel processors, this allows an attacker to leak data only accessible to a privileged domain (like the kernel) back into an unprivileged domain. The goal is simple: avoid generating code which contains an indirect branch that could have its prediction poisoned by an attacker. In many cases, the compiler can simply use directed conditional branches and a small search tree. LLVM already has support for lowering switches in this way and the first step of this patch is to disable jump-table lowering of switches and introduce a pass to rewrite explicit indirectbr sequences into a switch over integers. However, there is no fully general alternative to indirect calls. We introduce a new construct we call a "retpoline" to implement indirect calls in a non-speculatable way. It can be thought of loosely as a trampoline for indirect calls which uses the RET instruction on x86. Further, we arrange for a specific call->ret sequence which ensures the processor predicts the return to go to a controlled, known location. The retpoline then "smashes" the return address pushed onto the stack by the call with the desired target of the original indirect call. The result is a predicted return to the next instruction after a call (which can be used to trap speculative execution within an infinite loop) and an actual indirect branch to an arbitrary address. On 64-bit x86 ABIs, this is especially easily done in the compiler by using a guaranteed scratch register to pass the target into this device. For 32-bit ABIs there isn't a guaranteed scratch register and so several different retpoline variants are introduced to use a scratch register if one is available in the calling convention and to otherwise use direct stack push/pop sequences to pass the target address. This "retpoline" mitigation is fully described in the following blog post: https://support.google.com/faqs/answer/7625886 We also support a target feature that disables emission of the retpoline thunk by the compiler to allow for custom thunks if users want them. These are particularly useful in environments like kernels that routinely do hot-patching on boot and want to hot-patch their thunk to different code sequences. They can write this custom thunk and use `-mretpoline-external-thunk` *in addition* to `-mretpoline`. In this case, on x86-64 thu thunk names must be: ``` __llvm_external_retpoline_r11 ``` or on 32-bit: ``` __llvm_external_retpoline_eax __llvm_external_retpoline_ecx __llvm_external_retpoline_edx __llvm_external_retpoline_push ``` And the target of the retpoline is passed in the named register, or in the case of the `push` suffix on the top of the stack via a `pushl` instruction. There is one other important source of indirect branches in x86 ELF binaries: the PLT. These patches also include support for LLD to generate PLT entries that perform a retpoline-style indirection. The only other indirect branches remaining that we are aware of are from precompiled runtimes (such as crt0.o and similar). The ones we have found are not really attackable, and so we have not focused on them here, but eventually these runtimes should also be replicated for retpoline-ed configurations for completeness. For kernels or other freestanding or fully static executables, the compiler switch `-mretpoline` is sufficient to fully mitigate this particular attack. For dynamic executables, you must compile *all* libraries with `-mretpoline` and additionally link the dynamic executable and all shared libraries with LLD and pass `-z retpolineplt` (or use similar functionality from some other linker). We strongly recommend also using `-z now` as non-lazy binding allows the retpoline-mitigated PLT to be substantially smaller. When manually apply similar transformations to `-mretpoline` to the Linux kernel we observed very small performance hits to applications running typic al workloads, and relatively minor hits (approximately 2%) even for extremely syscall-heavy applications. This is largely due to the small number of indirect branches that occur in performance sensitive paths of the kernel. When using these patches on statically linked applications, especially C++ applications, you should expect to see a much more dramatic performance hit. For microbenchmarks that are switch, indirect-, or virtual-call heavy we have seen overheads ranging from 10% to 50%. However, real-world workloads exhibit substantially lower performance impact. Notably, techniques such as PGO and ThinLTO dramatically reduce the impact of hot indirect calls (by speculatively promoting them to direct calls) and allow optimized search trees to be used to lower switches. If you need to deploy these techniques in C++ applications, we *strongly* recommend that you ensure all hot call targets are statically linked (avoiding PLT indirection) and use both PGO and ThinLTO. Well tuned servers using all of these techniques saw 5% - 10% overhead from the use of retpoline. We will add detailed documentation covering these components in subsequent patches, but wanted to make the core functionality available as soon as possible. Happy for more code review, but we'd really like to get these patches landed and backported ASAP for obvious reasons. We're planning to backport this to both 6.0 and 5.0 release streams and get a 5.0 release with just this cherry picked ASAP for distros and vendors. This patch is the work of a number of people over the past month: Eric, Reid, Rui, and myself. I'm mailing it out as a single commit due to the time sensitive nature of landing this and the need to backport it. Huge thanks to everyone who helped out here, and everyone at Intel who helped out in discussions about how to craft this. Also, credit goes to Paul Turner (at Google, but not an LLVM contributor) for much of the underlying retpoline design. Reviewers: echristo, rnk, ruiu, craig.topper, DavidKreitzer Subscribers: sanjoy, emaste, mcrosier, mgorny, mehdi_amini, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D41723 PR: 224669 MFC r329033: Pull in r324594 from upstream clang trunk (by Alexander Ivchenko): Fix for #31362 - ms_abi is implemented incorrectly for values >=16 bytes. Summary: This patch is a fix for following issue: https://bugs.llvm.org/show_bug.cgi?id=31362 The problem was caused by front end lowering C calling conventions without taking into account calling conventions enforced by attribute. In this case win64cc was no correctly lowered on targets other than Windows. Reviewed By: rnk (Reid Kleckner) Differential Revision: https://reviews.llvm.org/D43016 Author: belickim <mateusz.belicki@intel.com> This fixes clang 6.0.0 assertions when building the emulators/wine and emulators/wine-devel ports, and should also make it use the correct Windows calling conventions. Bump __FreeBSD_version to make the fix easy to detect. PR: 224863 MFC r329223: Pull in r323998 from upstream clang trunk (by Richard Smith): PR36157: When injecting an implicit function declaration in C89, find the right DeclContext rather than injecting it wherever we happen to be. This avoids creating functions whose DeclContext is a struct or similar. This fixes assertion failures when parsing certain not-completely-valid struct declarations. Reported by: ae PR: 225862 MFC r329410: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r325330). PR: 224669 MFC r329983: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r325932). This corresponds to 6.0.0 rc3. PR: 224669 MFC r330384: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 release (upstream r326565). Release notes for llvm, clang and lld will be available here soon: <http://releases.llvm.org/6.0.0/docs/ReleaseNotes.html> <http://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html> <http://releases.llvm.org/6.0.0/tools/lld/docs/ReleaseNotes.html> Relnotes: yes PR: 224669 MFC r330686: Pull in r326882 from upstream llvm trunk (by Sjoerd Meijer): [ARM] Fix for PR36577 Don't PerformSHLSimplify if the given node is used by a node that also uses a constant because we may get stuck in an infinite combine loop. bugzilla: https://bugs.llvm.org/show_bug.cgi?id=36577 Patch by Sam Parker. Differential Revision: https://reviews.llvm.org/D44097 This fixes a hang when compiling one particular file in java/openjdk8 for armv6 and armv7. Reported by: swills PR: 226388 MFC r331065: Pull in r327638 from upstream llvm trunk (by Matthew Simpson): [ConstantFolding, InstSimplify] Handle more vector GEPs This patch addresses some additional cases where the compiler crashes upon encountering vector GEPs. This should fix PR36116. Differential Revision: https://reviews.llvm.org/D44219 Reference: https://bugs.llvm.org/show_bug.cgi?id=36116 This fixes an assertion when building the emulators/snes9x port. Reported by: jbeich PR: 225471 MFC r331066: Pull in r321999 from upstream clang trunk (by Ivan A. Kosarev): [CodeGen] Fix TBAA info for accesses to members of base classes Resolves: Bug 35724 - regression (r315984): fatal error: error in backend: Broken function found (Did not see access type in access path!) https://bugs.llvm.org/show_bug.cgi?id=35724 Differential Revision: https://reviews.llvm.org/D41547 This fixes "Did not see access type in access path" fatal errors when building the devel/gdb port (version 8.1). Reported by: jbeich PR: 226658 MFC r331366: Pull in r327101 from upstream llvm trunk (by Rafael Espindola): Don't treat .symver as a regular alias definition. This patch starts simplifying the handling of .symver. For now it just moves the responsibility for creating an alias down to the streamer. With that the asm streamer can pass a .symver unchanged, which is nice since gas cannot parse "foo@bar = zed". In a followup I hope to move the handling down to the writer so that we don't need special hacks for avoiding breaking names with @@@ on windows. Pull in r327160 from upstream llvm trunk (by Rafael Espindola): Delay creating an alias for @@@. With this we only create an alias for @@@ once we know if it should use @ or @@. This avoids last minutes renames and hacks to handle MS names. This only handles the ELF writer. LTO still has issues with @@@ aliases. Pull in r327928 from upstream llvm trunk (by Vitaly Buka): Object: Move attribute calculation into RecordStreamer. NFC Summary: Preparation for D44274 Reviewers: pcc, espindola Subscribers: hiraditya Differential Revision: https://reviews.llvm.org/D44276 Pull in r327930 from upstream llvm trunk (by Vitaly Buka): Object: Fix handling of @@@ in .symver directive Summary: name@@@nodename is going to be replaced with name@@nodename if symbols is defined in the assembled file, or name@nodename if undefined. https://sourceware.org/binutils/docs/as/Symver.html Fixes PR36623 Reviewers: pcc, espindola Subscribers: mehdi_amini, hiraditya Differential Revision: https://reviews.llvm.org/D44274 Together, these changes fix handling of @@@ in .symver directives when doing Link Time Optimization. Reported by: Shawn Webb <shawn.webb@hardenedbsd.org> MFC r331731: Pull in r328738 from upstream lld trunk (by Rafael Espindola): Strip @VER suffices from the LTO output. This fixes pr36623. The problem is that we have to parse versions out of names before LTO so that LTO can use that information. When we get the LTO produced .o files, we replace the previous symbols with the LTO produced ones, but they still have @ in their names. We could just trim the name directly, but calling parseSymbolVersion to do it is simpler. This is a follow-up to r331366, since we discovered that lld could append version strings to symbols twice, when using Link Time Optimization.
* Revert r330897:eadler2018-03-29351-867/+166
| | | | | | | | | | | | | | | | | This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code. Revert with prejudice. This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes. Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes. Requested by: gjb (re)
* MFC r315051, r315101, r315103, r315107, r315180, r315197, r315293, r315319,ian2018-03-2331-0/+3637
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r315590, r315649, r315726, r315743, r315746-r315747, r315779, r315985, r316002, r316639, r316959, r317187, r317194, r317205-r317207, r317381, r319489, r319847, r321076-r321079, r321227, r326822 Add the BSD-licensed diff from OpenBSD, which is optionally built and installed when WITHOUT_GNU_DIFF is set. r315051: Import diff from OpenBSD Some of the modifications from the previous summer of code has been integrated Modification for compatibility with GNU diff output has been added Main difference with OpenBSD: Implement multiple GNU diff options: * --ignore-file-name-case * --no-ignore-file-name-case * --normal * --tabsize * --strip-trailing-cr Make diff -p compatible with GNU diff Implement diff -l Make diff -r compatible with GNU diff Capsicumize diffing 2 regular files Add a simple test suite Approved by: AsiaBSDcon devsummit Obtained from: OpenBSD, GSoC Relnotes: yes r315101: Fix wrong date in diff(1) Reported by: rgrimes r315103: Implement a stub --horizon-lines=NUM for compatibility with GNU diff3 some options of GNU diff3 would call diff with --horizon-lines, rcs is depending on that. Reported by: antoine r315107: Fix building with recent gcc Reported by: lwhsu, ngie r315180: Readd codes that creates a tmp file for diffing stdout or devices r315197: Do not die if cap_rights_limit reports ENOSYS Reported by: mmel r315293: Integrate contrib/netbsd-tests/usr.bin/diff/t_diff.sh in as .../usr.bin/diff/diff_test Some minor adjustment needed to be done for :same as it currently has the test script hardcoded into the test, instead of using an idiom like $(dirname $0) Sponsored by: Dell EMC Isilon r315319: diff(1): sort long options under -D example in SYNOPSYS Sponsored by: Dell EMC Isilon r315590: diff(1): add --strip-trailing-cr to last example in the SYNOPSIS This syncs the last example in the SYNOPSIS with the other examples. Reviewed by: bapt Sponsored by: Dell EMC Isilon Differential Revision: D10017 r315649: Cache tzdata when running under capsicum PR: 217957 Reported by: tobik@ r315726: diff(1): fix SYNOPSIS section noting non-existent option, --no-ignore-case `--no-ignore-case` should be `--no-ignore-file-name-case` per code for compatibility with [g]diff(1). Sponsored by: Dell EMC Isilon r315743: Use MAX and MIN macros from sys/param.h r315746: Use strndup(3) instead of malloc + memcpy r315747: Use MIN macros from sys/param.h r315779: diff(1): document remaining long options While here, try and tie together some of the short options with their long option equivalents, where possible. Sponsored by: Dell EMC Isilon r315985: diff: Fix mtime of file1 in -u/-c header line. PR: 218018 Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10140 r316002: diff: Show nanoseconds in -u/-c header line. Show nanoseconds in the -u/-c header line. The present portability conditionals cannot handle the POSIX standard st_mtim, so remove them and unconditionally use st_mtim. PR: 218018 Reported by: jbeich Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10145 r316639: add a stub --speed-large-files for compatibility with GNU diff There is no intention to implement it, but lots of scripts/tools using diff(1) passes GNU diff option r316959: Clean up headers declaration r317187: Add a regression test for diff -D r317194: Implement a basic --changed-group-format etcupdate(8) requires that option, while GNU diff supports many more variation of that options, their behaviour beside the simple verion implemented here are quite inconsistent as such I do not plan to implement those. The only special keyword supported by this implementation are: %< and %> %= is not implemented as the documentation of GNU diff says: common lines, but it actually when tested print the changes from the first file r317205: Document all long options r317206: Update the TODO list to reflect what has been changed r317207: Cross reference pr(1) which diff might call with -l option r317381: Fix the following warning from gcc 4.2 in usr.bin/diff: usr.bin/diff/diffreg.c: In function 'change': usr.bin/diff/diffreg.c:1085: warning: 'i' may be used uninitialized in this function This version of gcc is not smart enough to see that 'i' cannot actually be used unitialized. However, the variable is confusingly re-used, so it is better to give it another name, and clearly initialize it before attempting to use it. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10484 r319489: Add -H as an alias for --speed-large-file to match GNU diff. This is undocumented to match GNU diff where -H is also undocumented. Some existing software (such as kompare) uses this option by default. Reviewed by: emaste, rpokala Differential Revision: https://reviews.freebsd.org/D11022 r319847: Add some testcases for `diff --side-by-side` support These are were created proactively, in anticipation of the support being fully implemented sometime in the future. The tests currently fail on ^/head@r319845, however. Expect them to fail. PR: 219933 Tested with: gdiff r321076: Don't emit "diff: diff <options> arguments" when diffing files if -q is specified. This improves compatibility with GNU diff. Found by accident with `diff -Nrq /usr/tests /usr/tests.new | grep Kyuafile`. Relnotes: yes r321077: Add some tests for brief (--brief/-q) format MFC with: r321076 r321078: Fix exit status with -rq when there is a file in one directory but not another, i.e., when print_only is called. Prior to this change, -rq was always returning 0. After this change it will return 1 if there is a difference between two directories. This fixes compatibility with GNU diff and unbreaks backwards compatibility expectations. Found when trying to extend diff_test:brief_format_test. MFC with: r321076, r321077 r321079: Add tests that exercise -q, like -rq and add tests that test -q like -Nrq MFC with: r321076, r321077, r321078 r321227: Use more flexible expression for replacing t_diff in contrib/netbsd-tests/usr.bin/diff/t_diff.sh with the name of the script via `basename $0`. This was a change I forgot to port over from ^/head/gnu/usr.bin/diff/tests/Makefile@r272787. r326822: Replace homemade equivalent of tolower(3) by towlower(3) This will help in the futur making diff -i works with multibyte Relnotes: Yes
* MFC bmake-20180222sjg2018-03-204-15/+15
| | | | | PR: 226678 Submitted by: sjg
* MFC r322013:eadler2018-03-191-1/+5
| | | | | | Document -w flag is an extension to POSIX. PR: 201937
* MFC r326356:eadler2018-03-191-5/+35
| | | | | | | Replace a reference to a license in another file with the license text. The relevant file was recently renamed, so the reference was stale. In addition, explicit licenses are more typical in our sources.
* MFC r320210:eadler2018-03-191-2/+8
| | | | | | | | | | | | | | | | | | | | | join(1): Fix field ordering for -v output Per POSIX, join(1) (in modes other than -o) is a concatenation of selected character fields. The joined field is first, followed by fields in the order they occurred in the input files. Our join(1) utility previously handled this correctly for lines with a match in the other file. But it failed to order output fields correctly for unmatched lines, printed in -a and -v modes. A simple test case is: $ touch a $ echo "2 1" > b $ join -v2 -2 2 a b 1 2 PR: 217711
* MFC r325091:eadler2018-03-191-3/+3
| | | | Prefer using https over http
* MFC r323135:eadler2018-03-191-1/+1
| | | | Spelling.
* MFC r319274:eadler2018-03-181-1/+24
| | | | | | | | - Add a simple example to uname(1) manual page to show how the hardware platform (returned by -m) can be different from the machine's processor architecture (-p) - Document that make(1) sets universal MACHINE and MACHINE_ARCH variables based on these values
* MFC ↵eadler2018-03-1825-395/+571
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r303452,r303482,r303483,r303484,r303485,r303487,r303489,r303498,r303499,r303502,r303523,r303525,r303570,r303571,r303588,r303596,r303597,r303598,r303599,r303600,r303601,r303625,r303629,r303718,r304651,r304684,r304686,r305983,r309217,r309219,r309341,r309342,r309343,r309382,r309415,r309417,r309418,r309419,r310863,r311141,r314613,r318471,r321382,r321383,r321396: indent(1): avoid calling write(2) with a negative second parameter. indent(1): Avoid out of bound access of array codebuf. indent(1): Avoid potential use-after-free. indent(1): Fix breakage caused by single comment following "else". indent(1) simply wasn't taught that "else" may be followed by a comment without any opening brace anywhere on the line, so it was very confused in such cases. indent(1): fix struct termination detection. indent(1): fix struct termination detection. indent(1): Removed whitespace shouldn't be considered in column calculations. indent(1): Support "f" and "F" floating constant suffixes. indent(1): Use NULL instead of zero for pointers. indent(1): Attempt to preserve some consistent style. indent(1): Yet more style issues. indent(1): Consistently indent declarations. indent(1): Bail out if there's no more space on the parser stack. indent(1): Remove dead code relating to unix-style comments. indent(1): Simplify pr_comment(). indent(1): Fix wrapping of some lines in comments. indent(1): Untangle the connection between pr_comment.c and io.c. indent(1): Don't newline on cpp lines like #endif unless -bacc is on. indent(1): replace function call to bzero with memset. indent(1): Rearrange option parsing code to squelch clang's static analyzer. indent(1): Use a dash in the license headers. indent(1): accept offsetof(3) as a keyword. indent(1): add some comments to quiet down Coverity. indent(1): remove dead assignments. indent(1): have the memset invocation somewhat more canonical. indent(1): Capsicumify indent(1): minor off-by-one error. indent(1): fix regression introduced in r303596. indent(1): Avoid out of bound access of array in_buffer indent(1): Don't ignore newlines after comments that follow braces. indent(1): Don't unnecessarily add a blank before a comment ends. indent(1): Do not define opchar unless it will be used. indent(1): Optimize parser stack usage. indent(1): Remove an extra newline added in a previous commit. indent(1): Avoid out-of-bound accesses of arrays. indent(1): Avoid out-of-bound accesses of array ps.p_stack. indent(1): Avoid out of bounds access of array ps.paren_indents indent(1): add a piece missed in r311138. indent(1): Support binary integer literals. indent(1): don't produce unnecessary blank lines. indent(1): rename the profile file. indent(1): better alignment of comments on code.
* MFC r311106,r311109,r311110,r320579,r327063,r327064,:eadler2018-03-162-8/+20
| | | | | | | patch(1): replace strnlen() with a simpler strlen(). patch(1): add support for git generated diffs. patch: rejname[] is also -r option buffer, and should be PATH_MAX. patch: further cleanup to git-style diffs.
* MFC ↵eadler2018-03-151-1/+56
| | | | | | r306135,r311859,r321763,r321764,r321766,r321767,r321768,r321769,r321771,r321774,r321776,r321783,r321784,r321785,r321786,r321787,r321788,r321789,r321793,r321796,r321797,r321801,r321802,r321804,r321814,r321817,r321818,r321834,r321835,r321853,r321857,r321860,r321866,r321885,r321886,r321889,r321890,r321892,r321893,r321897,r321939,r321966,r321974,r321982,r321989,r322035,r322093,r322108,r322314,r322330,r322335,r322350,r322353,r322365,r322416,r322471,r322484,r322638,r322649,r322881,r322886,r323972,r330768,: Misc calendar changes
* MFC r327514,r327521,r327614,r327615,r327616,r327623:eadler2018-03-152-42/+130
| | | | | | | | | | | | | | | | | | | morse(6): several improvements - add ñ, ', and _ - remove lint support - add missing header for ioctl - fix two typod - Use `-r` for "reverse" mode and to match DragonFlyBSD. - Move defines around to clear up logic - use `errx` instead of `fprintf` and `exit` - Use copyright comment header - Make it easier to compile on !FreeBSD - Diff reduction against DragonFlyBSD - bump Dd - use 'r' instead of 'D' from the original submission PR: 35109
* MFC ↵eadler2018-03-151-0/+6
| | | | | | r302485,r303203,r303341,r304025,r306133,r306518,r308576,r308686,r309019,r309059,r310024,r311853,r312793,r313033,r313577,r313741,r314692,r317772,r317939,r319674,r319923,r321392,r322979,r323222,r323222,r323398,r323502,r323602,r323767,r323767,r323958,r325220,r326172,r326253,r330652,r330761,r330762,r330763,r330765,: Misc. *.dot additions
* MFC r302533:eadler2018-03-151-1/+1
| | | | mail(1): Fix a comment.
* Partial merge of the SPDX changeseadler2018-03-14351-166/+867
| | | | | | | These changes are incomplete but are making it difficult to determine what other changes can/should be merged. No objections from: pfg
* MFC r322277 by jlh:emaste2018-03-113-20/+2
| | | | | | | | | | | | | | | | | | | rwho/ruptime/rwhod shouldn't be gated by RCMDS. As peter@ points out in pr/220953: "rwho, rwhod and ruptime are not part of the remote login suite (rsh, rlogin etc). They should *not* be in the rcmds package which is disabled by default. We rely on rwho/rwhod/ruptime in the freebsd.org cluster." This commit is a re-commit of r322029 and r322031 with a better commit log, as pointed out by ngie@. This also includes the necesary changes to OptionalObsoleteFiles.inc, as requested by jhb@. PR: 220953
* MFC r316797:eadler2018-03-081-1/+1
| | | | | | | | | | banner(6): Squash a harmless coverity warning The destination buffer is sized as the sum of program argument lengths, so it has plenty of room for *argv. Appease Coverity by using strlcpy instead of strcpy. Similar to a nearby cleanup performed in r316500. No functional change.
OpenPOWER on IntegriCloud