summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* MFC r320801 MFS r320887:Konstantin Belousov2017-07-111-3/+5
| | | | | | | | | Simplify language. Approved by: re (delphij) Notes: svn path=/releng/11.1/; revision=320890
* MFC r320570 MFS r320822:Konstantin Belousov2017-07-091-4/+5
| | | | | | | | | Correct signatures of several pthreads stubs. Approved by: re (gjb) Notes: svn path=/releng/11.1/; revision=320825
* Add MAP_GUARD and use it for stack grow area protection.Konstantin Belousov2017-07-072-2/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump __FreeBSD_version. This is an MFS of stable/11 r320666. MFC r320317: Implement address space guards. MFC r320338: Remove stale part of the comment. MFC r320339: Correctly handle small MAP_STACK requests. MFC r320344: For now, allow mprotect(2) over the guards to succeed regardless of the requested protection. MFC r320430: Treat the addr argument for mmap(2) request without MAP_FIXED flag as a hint. MFC r320560 (by alc): Modify vm_map_growstack() to protect itself from the possibility of the gap entry in the vm map being smaller than the sysctl-derived stack guard size. Approved by: re (delphij) Notes: svn path=/releng/11.1/; revision=320763
* MFS r320581: MFC r320494: Fix double free by reverting r300385 andXin LI2017-07-031-3/+1
| | | | | | | | | r300624 which was false positive reported by cppcheck. Approved by: re (kib) Notes: svn path=/releng/11.1/; revision=320584
* MFC r320314:Konstantin Belousov2017-06-271-4/+1
| | | | | | | | | Remove the description of MAP_HASSEMAPHORE. Approved by: re (marius) Notes: svn path=/stable/11/; revision=320402
* MFC r320313:Konstantin Belousov2017-06-271-1/+1
| | | | | | | | | Fix typo. Approved by: re (marius) Notes: svn path=/stable/11/; revision=320401
* MFC r320216: Fix use-after-free introduced in r300388.Xin LI2017-06-251-1/+2
| | | | | | | | | | | | | | | In r300388, endnetconfig() was called on nc_handle which would release the associated netconfig structure, which means tmpnconf->nc_netid would be a use-after-free. Solve this by doing endnetconfig() in return paths instead. Reported by: jemalloc via kevlo Reviewed by: cem, ngie (earlier version) Approved by: re (kib) Notes: svn path=/stable/11/; revision=320330
* MFC r320052:Konstantin Belousov2017-06-241-21/+25
| | | | | | | | | Do not leak syslog_mutex on cancellation. Approved by: re (marius) Notes: svn path=/stable/11/; revision=320311
* MFC 319490: Remove stale cap_rights_get(2) manpage.John Baldwin2017-06-201-1/+0
| | | | | | | | | | | The documentation moved to section 3 several years ago, but 'man cap_rights_get' pulls up cap_rights_limit(2) (which is MLINKed to cap_rights_get.2) instead of cap_rights_get(3). Approved by: re (gjb) Notes: svn path=/stable/11/; revision=320150
* MFC r320035:Konstantin Belousov2017-06-191-4/+5
| | | | | | | | | | Move the description of kern.kq_calloutmax sysctl into a new paragraph for better presentation. Approved by: re (delphij) Notes: svn path=/stable/11/; revision=320094
* MFC r320034:Konstantin Belousov2017-06-191-1/+2
| | | | | | | | | Start a new sentence on the new line. Approved by: re (delphij) Notes: svn path=/stable/11/; revision=320092
* MFC r318765:Allan Jude2017-06-111-1/+7
| | | | | | | | | Allow cpuset_{get,set}affinity in capabilities mode Approved by: re (marius) Notes: svn path=/stable/11/; revision=319819
* MFC r318816:Edward Tomasz Napierala2017-06-063-3/+3
| | | | | | | | | Don't end up manpage titles with a full stop. Approved by: re (marius) Notes: svn path=/stable/11/; revision=319618
* MFC r319369:Xin LI2017-06-064-17/+47
| | | | | | | | | | | | | | | | | | * limit size of buffers to RPC_MAXDATASIZE * don't leak memory * be more picky about bad parameters From: https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt via NetBSD. Approved by: re (kib) Notes: svn path=/stable/11/; revision=319614
* MFC r318582Eric van Gyzen2017-06-013-12/+4
| | | | | | | | | | | | | | Remove old spinlock_debug code from libc This no longer seems useful. Remove it. This was prompted by a "cast discards volatile qualifier" warning in libthr when WARNS=6. Sponsored by: Dell EMC Notes: svn path=/stable/11/; revision=319442
* MFC r318539 r318580 r318581 r318584 r318749 r318952 r318953 r318955Eric van Gyzen2017-06-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libthr: fix warnings at WARNS=6 Fix warnings about the following when WARNS=6 (which I will commit soon): - casting away const - no previous 'extern' declaration for non-static variable - others as explained by #pragmas and comments - unused parameters libthr: disable thread-safety warnings These warnings don't make sense for code that implements the locking primitives. libthr: change CHECK_AND_INIT_RWLOCK to an inline function This was prompted by a compiler warning about 'ret' shadowing a local variable in the callers of the macro. libthr: Use CLI flags instead of pragmas to disable warnings People tweaking the build system or compilers tend to look into the Makefile and not into the source. Having some warning controls in the Makefile and some in the source code is surprising. Pragmas have the advantage that they leave the warnings enabled for more code, but that advantage isn't very relevant in these cases. libthr: fix warnings from GCC when WARNS=6 Fix warnings about: - redundant declarations - a local variable shadowing a global function (dlinfo) - an old-style function definition (with an empty parameter list) - a variable that is possibly used uninitialized libthr: prevent setcontext() from masking SIGTHR __thr_setcontext() mistakenly tested for the presence of SIGCANCEL in its local ucontext_t instead of the parameter. Therefore, if a thread calls setcontext() with a context whose signal mask contains SIGTHR (a.k.a. SIGCANCEL), that signal will be blocked, preventing the thread from being cancelled or suspended. Sponsored by: Dell EMC Notes: svn path=/stable/11/; revision=319430
* MFC r318450:Konstantin Belousov2017-06-012-0/+103
| | | | | | | | | Add tests for some cases in r318298. PR: 219154 Notes: svn path=/stable/11/; revision=319418
* MFC r319086:Konstantin Belousov2017-05-311-2/+5
| | | | | | | Mention that the basep argument to getdirentries(2) can be NULL. Notes: svn path=/stable/11/; revision=319310
* MFC ↵Enji Cooper2017-05-319-98/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r319027,r319028,r319029,r319030,r319031,r319033,r319034,r319035,r319036,r319037,r319038,r319039,r319040,r319041,r319042,r319043,r319044,r319045,r319046: r319027: lib/libc/tests/nss: use calloc appropriately The pattern used prior to this commit was `calloc(1, n * sizeof(type))`; the pattern that should be used however is `calloc(n, sizeof(type))`. r319028: Sort make variables to suit style.Makefile(5) This is being done prior to functional changes. r319029: Staticize functions and remove unused variables to aid with bumping WARNS r319030: Fix -Wsign-compare warnings r319031: getusershell_test: staticize run_tests(..) to fix warnings r319033: getserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings r319034: getaddrinfo_test: fix -Wsign-compare warnings r319035: getrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings r319036: getproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings r319037: getaddrinfo_test: mark unused function parameters __unused to fix -Wunused warnings r319038: getusershell_test: mark mdata parameter in compare_usershell __unused r319039: getserv_test: mark unused parameters __unused to fix corresponding warnings r319040: getrpc_test: fix -Wunused warnings - Mark unused function parameters unused. - Remove an unused function prototype. r319041: getproto_test: fix -Wunused warnings Mark unused parameters __unused in functions. r319042: gethostby_test: fix multiple warning types - Fix -Wmissing-declaration warning by staticizing run_tests. - Fix -Wsign-compare warnings by casting size_t types to int for comparisons. Reindent some of the code in sdump_hostent(..) to accomodate the overall changes. r319043: getpw_test: fix -Wunused warnings - Mark unused parameters __unused. - Put dump_passwd under DEBUG as it's only used in that case. r319044: getgr_test: fix -Wunused warnings r319045: Fix -Wunused and -Wshadow warnings r319046: Fix a -Wunused-but-set-variable warning reported by gcc 6.3.0 Notes: svn path=/stable/11/; revision=319299
* MFC r304106:Xin LI2017-05-317-5/+196
| | | | | | | | | | Add timingsafe_bcmp and timingsafe_memcmp. Obtained from: OpenBSD Reviewed by: trasz Notes: svn path=/stable/11/; revision=319292
* MFC r318514-r318515, r318517, r318917Xin LI2017-05-311-18/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r318514: Use size_t. Inspired by: OpenBSD src/lib/libc/stdlib/qsort.c,v 1.11 r318515: The current qsort(3) implementation ignores the sizes of partitions, and always perform recursion on the left partition, then use a tail call to handle the right partition. In the worst case this could require O(N) levels of recursions. Reduce the possible recursion level to log2(N) by always recursing on the smaller partition instead. Obtained from: PostgreSQL 9d6077abf9d6efd992a59f05ef5aba981ea32096 r318517: Sync qsort.c with userland r318515. (Note that MIN macro is removed in favor of sys/param.h's version). PR: 213922 r318917: Disconnect heimdal version of qsort.c from build because we are already using libc's version of qsort. PR: bin/213922 Notes: svn path=/stable/11/; revision=319285
* MFC r315272, r315370Xin LI2017-05-311-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | r315272: Implement INHERIT_ZERO for minherit(2). INHERIT_ZERO is an OpenBSD feature. When a page is marked as such, it would be zeroed upon fork(). This would be used in new arc4random(3) functions. PR: 182610 Reviewed by: kib (earlier version) Differential Revision: https://reviews.freebsd.org/D427 r315370: The adj_free and max_free values of new_entry will be calculated and assigned by subsequent vm_map_entry_link(), therefore, remove the pointless copying. Submitted by: alc Notes: svn path=/stable/11/; revision=319277
* MFC r315615:Xin LI2017-05-311-2/+2
| | | | | | | Make space style consistent with earlier entries. Notes: svn path=/stable/11/; revision=319276
* MFC r312703:Andrew Turner2017-05-301-1/+1
| | | | | | | | | Fix the error value we write in cerror. __error returns an int *, however we were writing a 64 bit value meaning the 32 bits after this would be trashed. Notes: svn path=/stable/11/; revision=319195
* MFC r318303:Konstantin Belousov2017-05-291-9/+7
| | | | | | | Style. Notes: svn path=/stable/11/; revision=319128
* MFC r318299:Konstantin Belousov2017-05-291-44/+31
| | | | | | | Simplify cleanup on failure in realpath(3). Notes: svn path=/stable/11/; revision=319127
* MFC r318298:Konstantin Belousov2017-05-291-19/+27
| | | | | | | | | Fix several buffer overflows in realpath(3), and other minor issues. PR: 219154 Notes: svn path=/stable/11/; revision=319126
* MFC r318794, r318795:Glen Barber2017-05-272-4/+4
| | | | | | | | | Update the "first appeared in" version in several manual pages. Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/11/; revision=318971
* MFC r318314Stephen J. Kiernan2017-05-251-0/+10
| | | | | | | | | | | | Add information to open(2) man page about the O_VERIFY flag. PR: 219262 Reviewed by: bjk wblock Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Notes: svn path=/stable/11/; revision=318893
* MFC r317660, r317710Brooks Davis2017-05-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r317660: Support clnt_raw's use of FD_SETSIZE as a fake file descriptor. Accomplish this by allocating space for it in __svc_xports and allowing it to be registered. The failure to allocate space was causing an out-of-bounds read in svc_getreq_common(). The failure to register caused PR 211804. The bug was found with CHERI bounds checking. PR: 211804 Obtained from: CheriBSD Sponsored by: DARPA, AFRL Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D10528 r317710: Remove expected failure now that it was fixed in r317660. PR: 211804 Reviewed by: ngie Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10576 Notes: svn path=/stable/11/; revision=318322
* MFC r317845-r317846Brooks Davis2017-05-121-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | r317845: Provide a freebsd32 implementation of sigqueue() The previous misuse of sys_sigqueue() was sending random register or stack garbage to 64-bit targets. The freebsd32 implementation preserves the sival_int member of value when signaling a 64-bit process. Document the mixed ABI implementation of union sigval and the incompability of sival_ptr with pointer integrity schemes. Reviewed by: kib, wblock Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10605 r317846: Regen post r317845. MFC with: r317845 Sponsored by: DARPA, AFRL Notes: svn path=/stable/11/; revision=318244
* MFC r306771:Bryan Drewery2017-05-091-1/+1
| | | | | | | Improve grammar. Notes: svn path=/stable/11/; revision=318070
* MFC r317707:Brooks Davis2017-05-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | Correct an out-of-bounds read in regcomp when the RE is bad. When passed the invalid regular expression "a**", the error is eventually detected and seterr() is called. It sets p->error appropriatly and p->next and p->end to nuls which is a never used char nuls[10] which is zeros due to .bss initialization. Unfortunatly, p_ere_exp() and p_simp_re() both have fall through cases where they set the error, decrement p->next and access it which means a read from whatever .bss variable comes before nuls. Found with regex_test:repet_multi and CHERI bounds checking. Reviewed by: ngie, pfg, emaste Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10541 Notes: svn path=/stable/11/; revision=318029
* MFC r317611:Konstantin Belousov2017-05-071-5/+1
| | | | | | | Make semaphore names list mutex non-recursive. Notes: svn path=/stable/11/; revision=317897
* MFC r317610:Konstantin Belousov2017-05-071-12/+10
| | | | | | | Restructure normal (non-error) control flow in sem_close(). Notes: svn path=/stable/11/; revision=317896
* MFC r317606:Konstantin Belousov2017-05-071-22/+25
| | | | | | | Style. Notes: svn path=/stable/11/; revision=317895
* MFC r317346:Pedro F. Giffuni2017-05-076-28/+27
| | | | | | | | | | | | regex: unsign and constify some variables. Taking some hints from the regex variant in nvi(1) and higher-level compiler warnings, update some types in our regex(3) implementation. Joint work with: Kyle Evans Notes: svn path=/stable/11/; revision=317894
* MFC r317436:Konstantin Belousov2017-05-031-1/+1
| | | | | | | getpagesize(3) cannot fail. Notes: svn path=/stable/11/; revision=317734
* MFC r317034:Baptiste Daroussin2017-05-012-58/+155
| | | | | | | | | | | | | | | | | | | | Fix strcoll_l disagreeing with strxfrm by reworking the forward order case in wcscoll_l(). Illumos fixed this while grabbing back our patches: https://www.illumos.org/rb/r/402/ This does not 100% fix what postgresql folks reported as there is still a remaining issue: https://www.illumos.org/issues/7962, it improves the situation The initial issue was reported in postgresql mailing lists: https://www.postgresql.org/message-id/flat/111D0E27-A8F3-4A84-A4E0-B0FB703863DF@s24.com#111D0E27-A8F3-4A84-A4E0-B0FB703863DF@s24.com Submitted by: Yuri Pankov <yuri.pankov@nexenta.com> Obtained from: Illumos Notes: svn path=/stable/11/; revision=317647
* MFC r302920Baptiste Daroussin2017-05-012-0/+64
| | | | | | | | | | | | | | | | | Add a regression test to make sure the Russian collation is actually working when importing collation support from Dragonfly/Illumos amdmi3@ tested the collation branch and reported an issue with Russian collation. John Marino fixed the issue in Dragonfly and I merged it back to FreeBSD. Now that Illumos is working on merging our fixes they (Lauri Tirkkonen) found issues with the commit that fixes the russian collation in UTF-8 that resulted in a crash with strxfrm(3) and the ISO-8859-5 locale (fixed in FreeBSD r302916). This small test was written to ensure we do not bring back the old issue with russian collation while fixing the other issue. Notes: svn path=/stable/11/; revision=317646
* MFC r317064: Optimize pathologic case of telldir() for Samba.Alexander Motin2017-05-011-4/+14
| | | | | | | | | | | | | When application reads large directory, calling telldir() for each entry, like Samba does, it creates exponential performance drop as number of entries reach tenths to hundreds of thousands. It is caused by full search through the internal list, that never finds matches in that scenario, but creates O(n^2) delays. This patch optimizes that search, limiting it to entries of the same buffer, turning time closer to O(n) in case of linear directory scan. Notes: svn path=/stable/11/; revision=317633
* MFC r315526Eric van Gyzen2017-05-019-40/+193
| | | | | | | | | | | | | | | | | | | | | | | | | Add clock_nanosleep() Add a clock_nanosleep() syscall, as specified by POSIX. Make nanosleep() a wrapper around it. Attach the clock_nanosleep test from NetBSD. Adjust it for the FreeBSD behavior of updating rmtp only when interrupted by a signal. I believe this to be POSIX-compliant, since POSIX mentions the rmtp parameter only in the paragraph about EINTR. This is also what Linux does. (NetBSD updates rmtp unconditionally.) Copy the whole nanosleep.2 man page from NetBSD because it is complete and closely resembles the POSIX description. Edit, polish, and reword it a bit, being sure to keep any relevant text from the FreeBSD page. Regenerate syscall files. Relnotes: yes Sponsored by: Dell EMC Notes: svn path=/stable/11/; revision=317618
* MFC r317372:Pedro F. Giffuni2017-05-011-2/+1
| | | | | | | | | | | | scandir(3): promote arraysz to size_t to match numitems. The internal array size goes through a loop and is compared with numitems which at its limits makes can be unreachably higher than arraysz. Prevent an hypothetical overflow, and signed/unsigned comparison, by matching the types. Notes: svn path=/stable/11/; revision=317613
* MFC r316768:Brooks Davis2017-04-241-0/+4
| | | | | | | | | | | | | Fix an out-of-bounds write when a zero-length buffer is passed. Found with ttyname_test and CHERI bounds checking. Reviewed by: emaste Obtained from: CheriBSD Sponsored by: DARPA, AFRL Notes: svn path=/stable/11/; revision=317391
* MFC r316213:Konstantin Belousov2017-04-2311-3/+430
| | | | | | | | | | | Implement the memset_s(3) function as specified by the C11 ISO/IEC 9899:2011 Appendix K 3.7.4.1. MFC r316258: Only activate __EXT1_VISIBLE block when using sys/errno.h in userspace. Notes: svn path=/stable/11/; revision=317342
* MFC r316739:Konstantin Belousov2017-04-191-6/+3
| | | | | | | Fix reporting of _SC_SEM_NSEMS_MAX and _SC_SEM_VALUE_MAX. Notes: svn path=/stable/11/; revision=317130
* MFC r313873:Michal Meloun2017-04-161-0/+5
| | | | | | | Publish fp[get][set]sticky() for ARMv6. Notes: svn path=/stable/11/; revision=316999
* MFC r313823,r313866:Michal Meloun2017-04-163-1/+60
| | | | | | | | | | r313823: Pull in r285478 from upstream compiler-rt trunk (by Saleem Abdulrasool): r313866: Publish __aeabi_uidiv and __aeabi_idiv as compatible symbols from libc. Notes: svn path=/stable/11/; revision=316998
* MFC r315162:Pedro F. Giffuni2017-04-0712-27/+27
| | | | | | | | | | | libc: provide some bounds-checking through reallocarray(3). reallocarray(3) is a non portable extension that originated in OpenBSD. Given that it is already in FreeBSD's libc it is useful for the cases where reallocation involves a multiplication. Notes: svn path=/stable/11/; revision=316613
* Update clang, llvm, lld, lldb, compiler-rt and libc++ to 4.0.0 release:Dimitry Andric2017-04-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC r309142 (by emaste): Add WITH_LLD_AS_LD build knob If set it installs LLD as /usr/bin/ld. LLD (as of version 3.9) is not capable of linking the world and kernel, but can self-host and link many substantial applications. GNU ld continues to be used for the world and kernel build, regardless of how this knob is set. It is on by default for arm64, and off for all other CPU architectures. Sponsored by: The FreeBSD Foundation MFC r310840: Reapply 310775, now it also builds correctly if lldb is disabled: Move llvm-objdump from CLANG_EXTRAS to installed by default We currently install three tools from binutils 2.17.50: as, ld, and objdump. Work is underway to migrate to a permissively-licensed tool-chain, with one goal being the retirement of binutils 2.17.50. LLVM's llvm-objdump is intended to be compatible with GNU objdump although it is currently missing some options and may have formatting differences. Enable it by default for testing and further investigation. It may later be changed to install as /usr/bin/objdump, it becomes a fully viable replacement. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D8879 MFC r312855 (by emaste): Rename LLD_AS_LD to LLD_IS_LD, for consistency with CLANG_IS_CC Reported by: Dan McGregor <dan.mcgregor usask.ca> MFC r313559 | glebius | 2017-02-10 18:34:48 +0100 (Fri, 10 Feb 2017) | 5 lines Don't check struct rtentry on FreeBSD, it is an internal kernel structure. On other systems it may be API structure for SIOCADDRT/SIOCDELRT. Reviewed by: emaste, dim MFC r314152 (by jkim): Remove an assembler flag, which is redundant since r309124. The upstream took care of it by introducing a macro NO_EXEC_STACK_DIRECTIVE. http://llvm.org/viewvc/llvm-project?rev=273500&view=rev Reviewed by: dim MFC r314564: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 4.0.0 (branches/release_40 296509). The release will follow soon. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. Also note that as of 4.0.0, lld should be able to link the base system on amd64 and aarch64. See the WITH_LLD_IS_LLD setting in src.conf(5). Though please be aware that this is work in progress. Release notes for llvm, clang and lld will be available here: <http://releases.llvm.org/4.0.0/docs/ReleaseNotes.html> <http://releases.llvm.org/4.0.0/tools/clang/docs/ReleaseNotes.html> <http://releases.llvm.org/4.0.0/tools/lld/docs/ReleaseNotes.html> Thanks to Ed Maste, Jan Beich, Antoine Brodin and Eric Fiselier for their help. Relnotes: yes Exp-run: antoine PR: 215969, 216008 MFC r314708: For now, revert r287232 from upstream llvm trunk (by Daniil Fukalov): [SCEV] limit recursion depth of CompareSCEVComplexity Summary: CompareSCEVComplexity goes too deep (50+ on a quite a big unrolled loop) and runs almost infinite time. Added cache of "equal" SCEV pairs to earlier cutoff of further estimation. Recursion depth limit was also introduced as a parameter. Reviewers: sanjoy Subscribers: mzolotukhin, tstellarAMD, llvm-commits Differential Revision: https://reviews.llvm.org/D26389 This commit is the cause of excessive compile times on skein_block.c (and possibly other files) during kernel builds on amd64. We never saw the problematic behavior described in this upstream commit, so for now it is better to revert it. An upstream bug has been filed here: https://bugs.llvm.org/show_bug.cgi?id=32142 Reported by: mjg MFC r314795: Reapply r287232 from upstream llvm trunk (by Daniil Fukalov): [SCEV] limit recursion depth of CompareSCEVComplexity Summary: CompareSCEVComplexity goes too deep (50+ on a quite a big unrolled loop) and runs almost infinite time. Added cache of "equal" SCEV pairs to earlier cutoff of further estimation. Recursion depth limit was also introduced as a parameter. Reviewers: sanjoy Subscribers: mzolotukhin, tstellarAMD, llvm-commits Differential Revision: https://reviews.llvm.org/D26389 Pull in r296992 from upstream llvm trunk (by Sanjoy Das): [SCEV] Decrease the recursion threshold for CompareValueComplexity Fixes PR32142. r287232 accidentally increased the recursion threshold for CompareValueComplexity from 2 to 32. This change reverses that change by introducing a separate flag for CompareValueComplexity's threshold. The latter revision fixes the excessive compile times for skein_block.c. MFC r314907 | mmel | 2017-03-08 12:40:27 +0100 (Wed, 08 Mar 2017) | 7 lines Unbreak ARMv6 world. The new compiler_rt library imported with clang 4.0.0 have several fatal issues (non-functional __udivsi3 for example) with ARM specific instrict functions. As temporary workaround, until upstream solve these problems, disable all thumb[1][2] related feature. MFC r315016: Update clang, llvm, lld, lldb, compiler-rt and libc++ to 4.0.0 release. We were already very close to the last release candidate, so this is a pretty minor update. Relnotes: yes MFC r316005: Revert r314907, and pull in r298713 from upstream compiler-rt trunk (by Weiming Zhao): builtins: Select correct code fragments when compiling for Thumb1/Thum2/ARM ISA. Summary: Value of __ARM_ARCH_ISA_THUMB isn't based on the actual compilation mode (-mthumb, -marm), it reflect's capability of given CPU. Due to this: - use __tbumb__ and __thumb2__ insteand of __ARM_ARCH_ISA_THUMB - use '.thumb' directive consistently in all affected files - decorate all thumb functions using DEFINE_COMPILERRT_THUMB_FUNCTION() --------- Note: This patch doesn't fix broken Thumb1 variant of __udivsi3 ! Reviewers: weimingz, rengolin, compnerd Subscribers: aemerson, dim Differential Revision: https://reviews.llvm.org/D30938 Discussed with: mmel Notes: svn path=/stable/11/; revision=316423