summaryrefslogtreecommitdiff
path: root/contrib/libc++
Commit message (Collapse)AuthorAgeFilesLines
* Move all sources from the llvm project into contrib/llvm-project.Dimitry Andric2019-12-20215-153750/+0
| | | | | | | | | | | | | This uses the new layout of the upstream repository, which was recently migrated to GitHub, and converted into a "monorepo". That is, most of the earlier separate sub-projects with their own branches and tags were consolidated into one top-level directory, and are now branched and tagged together. Updating the vendor area to match this layout is next. Notes: svn path=/head/; revision=355940
* Merge commit 371ea70bb from llvm git (by Louis Dionne):Dimitry Andric2019-11-111-2/+2
| | | | | | | | | | | | | | | | | | | | | [libc++] Harden usage of static_assert against C++03 In C++03, we emulate static_assert with a macro, and we must parenthesize multiple arguments. llvm-svn: 373328 This is a follow-up to r354460, which causes errors for pre-C++11 programs using <cmath>, similar to: /usr/include/c++/v1/cmath:622:68: error: too many arguments provided to function-like macro invocation Reported by: antoine MFC after: immediately (because of ports breakage) Notes: svn path=/head/; revision=354625
* Merge commit e8316372b from llvm git (by Louis Dionne):Dimitry Andric2019-11-072-21/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [libc++] Add `__truncating_cast` for safely casting float types to integers This is needed anytime we need to clamp an arbitrary floating point value to an integer type. Thanks to Eric Fiselier for the patch. Differential Revision: https://reviews.llvm.org/D66836 llvm-svn: 370891 Merge commit b92deded8 from llvm git (by Louis Dionne): [libc++] Move __clamp_to_integral to <cmath>, and harden against min()/max() macros llvm-svn: 370900 Merge commit 0ec6a4882 from llvm git (by Louis Dionne): [libc++] Fix potential OOB in poisson_distribution See details in the original Chromium bug report: https://bugs.chromium.org/p/chromium/issues/detail?id=994957 Together, these fix a security issue in libc++'s implementation of std::poisson_distribution, which can be exploited to read data which is out of bounds. Note there are no programs in the FreeBSD base system that use std::poisson_distribution, so this is only a possible issue for ports and external programs which have been built against libc++. Therefore, I am bumping __FreeBSD_version for the benefit of our port maintainers. Requested by: emaste Security: potential OOB read MFC after: 3 days Notes: svn path=/head/; revision=354460
* Use __FreeBSD_version to determine if gets() has been removed.John Baldwin2019-10-151-1/+3
| | | | | | | | | | | | | | | | | | | | | GCC compilers set __FreeBSD__ statically to a build-time determined targeted version (which in ports always matches the build host's version). This means that when building any version (12 or 13, etc.) of riscv or some other architecture via GCC on a 12.x host, __FreeBSD__ will always be set to 12. As a result, __FreeBSD__ cannot be used to reliably detect the target FreeBSD version being built. Instead, __FreeBSD_version from either <sys/param.h> (in the kernel) or <osreldate.h> (in userland) should be used. This changes the gets() test in libc++ to use __FreeBSD_version from <osreldate.h>. Reported by: jenkins (riscv64 and amd64-gcc) Reviewed by: dim, imp Differential Revision: https://reviews.freebsd.org/D22034 Notes: svn path=/head/; revision=353579
* Partially undo r351659, which unconditionally removed gets(3) from libc++.Dimitry Andric2019-09-192-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead, pull in r371324 from upstream libc++ trunk (by me): Remove ::gets for FreeBSD 13 and later Summary: In https://svnweb.freebsd.org/changeset/base/351659 @emaste removed gets() from FreeBSD 13's libc, and our copies of libc++ and libstdc++. In that change, the declarations were simply deleted, but I would like to propose this conditional test instead. Reviewers: EricWF, mclow.lists, emaste Reviewed By: mclow.lists Subscribers: krytarowski, christof, ldionne, emaste, libcxx-commits Differential Revision: https://reviews.llvm.org/D67316 This makes these changes more MFCable. Notes: svn path=/projects/clang900-import/; revision=352538
* Merge ^/head r351317 through r351731.Dimitry Andric2019-09-031-4/+0
|\ | | | | | | Notes: svn path=/projects/clang900-import/; revision=351732
| * libc: remove getsEd Maste2019-09-011-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gets is unsafe and shouldn't be used (for many years now). Leave it in the existing symbol version so anything that previously linked aginst it still runs, but do not allow new software to link against it. (The compatability/legacy implementation must not be static so that the symbol and in particular the compat sym gets@FBSD_1.0 make it into libc.) PR: 222796 (exp-run) Reported by: Paul Vixie Reviewed by: allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlier) Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12298 Notes: svn path=/head/; revision=351659
* | Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb, and openmpDimitry Andric2019-09-022-10/+16
| | | | | | | | | | | | | | release_90 branch r370514, and update version numbers. Notes: svn path=/projects/clang900-import/; revision=351722
* | Merge libc++ trunk r366426, resolve conflicts, and add FREEBSD-Xlist.Dimitry Andric2019-08-22220-5324/+6836
|/ | | | Notes: svn path=/projects/clang900-import/; revision=351402
* Pull in r368867 from upstream libc++ trunk (by Marshall Clow):Dimitry Andric2019-08-204-78/+95
| | | | | | | | | | | | | | | | | | | | | Rework recursive_timed_mutex so that it uses __thread_id instead of using the lower-level __libcpp_thread_id. This is prep for fixing PR42918. Reviewed as https://reviews.llvm.org/D65895 Pull in r368916 from upstream libc++ trunk (by Marshall Clow): Fix thread comparison by making sure we never pass our special 'not a thread' value to the underlying implementation. Fixes PR#42918. This should fix std::thread::id::operator==() attempting to call pthread_equal(3) with zero values. Reported by: andrew@tao11.riddles.org.uk PR: 239038, 239550 MFC after: 3 days Notes: svn path=/head/; revision=351253
* Merge ^/head r344178 through r344512.Dimitry Andric2019-02-251-2/+0
|\ | | | | | | Notes: svn path=/projects/clang800-import/; revision=344513
| * Pull in r354515 from upstream libc++ trunk:Dimitry Andric2019-02-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the build with gcc when `-Wredundant-decls` is passed Summary: gcc warns that `__throw_runtime_error` is declared both in `<__locale>` and `<stdexcept>`, if `-Wredundant-decls` is passed on the command line; this is the case with FreeBSD when ${WARNS} == 6. Since `<__locale>` gets its first declaration via a transitive include of `<stdexcept>`, and the second declaration is after the first invocation of `__throw_runtime_error`, delete that second declaration. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com> Reviewers: kristina, MaskRay, EricWF, ldionne, ngie Reviewed By: EricWF Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D58425 Submitted by: ngie MFC after: 3 days Notes: svn path=/head/; revision=344386
| * Pull in r345199 from upstream libc++ trunk (by Petr Hosek):Dimitry Andric2019-02-181-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are floating-point types." This reverts commits r333103 and r333108. _Float16 and __fp16 are C11 extensions and compilers other than Clang don't define these for C++. Differential Revision: https://reviews.llvm.org/D53670 This prevents "_Float16 is not supported on this target" errors in libc++'s type_traits header, in some cases. Reported by: Charlie Li MFC after: 3 days Notes: svn path=/head/; revision=344261
* | Merge libc++ trunk r351319, and resolve conflicts.Dimitry Andric2019-01-2293-1781/+4606
|/ | | | Notes: svn path=/projects/clang800-import/; revision=343309
* Truely fix #if defined broken in -r343111Kirk McKusick2019-01-171-0/+7
| | | | | | | Pointy-hat-to: mckusick Notes: svn path=/head/; revision=343115
* Proper definition of elast3.Kirk McKusick2019-01-171-2/+2
| | | | | | | Reported by: Oliver Pinter <oliver.pinter@hardenedbsd.org> Notes: svn path=/head/; revision=343114
* Fix #if defined broken in -r343111Kirk McKusick2019-01-171-8/+8
| | | | | | | Pointy-hat-to: mckusick Notes: svn path=/head/; revision=343113
* Create new EINTEGRITY error with message "Integrity check failed".Kirk McKusick2019-01-172-13/+42
| | | | | | | | | | | | | | | | | | | | | | An integrity check such as a check-hash or a cross-correlation failed. The integrity error falls between EINVAL that identifies errors in parameters to a system call and EIO that identifies errors with the underlying storage media. EINTEGRITY is typically raised by intermediate kernel layers such as a filesystem or an in-kernel GEOM subsystem when they detect inconsistencies. Uses include allowing the mount(8) command to return a different exit value to automate the running of fsck(8) during a system boot. These changes make no use of the new error, they just add it. Later commits will be made for the use of the new error number and it will be added to additional manual pages as appropriate. Reviewed by: gnn, dim, brueffer, imp Discussed with: kib, cem, emaste, ed, jilles Differential Revision: https://reviews.freebsd.org/D18765 Notes: svn path=/head/; revision=343111
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branchDimitry Andric2018-12-091-1/+0
| | | | | | | | | | r348686 (effectively 7.0.1 rc3), resolve conflicts, and bump version numbers. PR: 230240, 230355 Notes: svn path=/projects/clang700-import/; revision=341763
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branchDimitry Andric2018-09-112-12/+9
| | | | | | | | | r341916, resolve conflicts, and bump version numbers. PR: 230240, 230355 Notes: svn path=/projects/clang700-import/; revision=338597
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branchDimitry Andric2018-08-291-1/+2
| | | | | | | | | r340910, resolve conflicts, and bump version numbers. PR: 230240, 230355 Notes: svn path=/projects/clang700-import/; revision=338391
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branchDimitry Andric2018-08-184-33/+46
| | | | | | | | | r339999, resolve conflicts, and bump version numbers. PR: 230240,230355 Notes: svn path=/projects/clang700-import/; revision=338014
* Undo r337593 (commenting out of timespec_get in libc++'s <ctime>Dimitry Andric2018-08-111-1/+1
| | | | | | | | | header), now that r337576 added that function. PR: 230400 Notes: svn path=/projects/clang700-import/; revision=337654
* Upstream libc++ added a using ::timespec_get line, when in C++17 orDimitry Andric2018-08-101-1/+1
| | | | | | | | | | | | | higher mode, in <https://reviews.llvm.org/rL338419>. Since we do not yet have this C11 function, comment out the line for now, as a workaround for a number of failing ports. Discussion with upstream is ongoing about an acceptable permanent fix. PR: 230400 Reported by: jbeich Notes: svn path=/projects/clang700-import/; revision=337593
* Merge libc++ trunk r338150 (just before the 7.0.0 branch point), andDimitry Andric2018-08-0232-113/+2079
| | | | | | | resolve conflicts. Notes: svn path=/projects/clang700-import/; revision=337153
* Merge libc++ trunk r338150, and resolve conflicts.Dimitry Andric2018-08-02102-9488/+11952
| | | | Notes: svn path=/projects/clang700-import/; revision=337135
* Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ toDimitry Andric2018-06-292-5/+5
| | | | | | | | | | 6.0.1 release (upstream r335540). Relnotes: yes MFC after: 2 weeks Notes: svn path=/head/; revision=335799
* Pull in r321963 from upstream libc++ trunk (by me):Dimitry Andric2018-01-071-4/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pre-C++11 is_constructible wrappers for 3 arguments Summary: After rL319736 for D28253 (which fixes PR28929), gcc cannot compile <memory> anymore in pre-C+11 modes, complaining: In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::make_shared(_A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4365:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4365:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::allocate_shared(const _Alloc&, _A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4444:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4444:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ This is also reported in https://bugs.freebsd.org/224946 (FreeBSD is apparently one of the very few projects that regularly builds programs against libc++ with gcc). The reason is that the static assertions are invoking is_constructible with three arguments, while gcc does not have the built-in is_constructible feature, and the pre-C++11 is_constructible wrappers in <type_traits> only provide up to two arguments. I have added additional wrappers for three arguments, modified the is_constructible entry point to take three arguments instead, and added a simple test to is_constructible.pass.cpp. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: krytarowski, cfe-commits, emaste Differential Revision: https://reviews.llvm.org/D41805 This should allow gcc to compile the libc++ 6.0.0 <memory> header without problems, in pre-C++11 mode. Reported by: jbeich PR: 224946 Notes: svn path=/projects/clang600-import/; revision=327680
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_60 r321788,Dimitry Andric2018-01-0615-226/+336
| | | | | | | update build glue and version numbers. Notes: svn path=/projects/clang600-import/; revision=327657
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ trunk r321545,Dimitry Andric2017-12-291-0/+1
| | | | | | | | update build glue and version numbers, add new intrinsics headers, and update OptionalObsoleteFiles.inc. Notes: svn path=/projects/clang600-import/; revision=327330
* Merge libc++ trunk r321414 to contrib/libc++.Dimitry Andric2017-12-242-4/+5
| | | | Notes: svn path=/projects/clang600-import/; revision=327139
* Merge libc++ trunk r321017 to contrib/libc++.Dimitry Andric2017-12-2064-926/+1634
| | | | Notes: svn path=/projects/clang600-import/; revision=327039
* Upgrade our copies of clang, llvm, lldb and libc++ to r319231 from theDimitry Andric2017-12-037-39/+56
| | | | | | | | | upstream release_50 branch. This corresponds to 5.0.1 rc2. MFC after: 2 weeks Notes: svn path=/head/; revision=326496
* Upgrade our copies of clang, llvm, lld and libc++ to r311219 from theDimitry Andric2017-08-211-1/+2
| | | | | | | | | | upstream release_50 branch. MFC after: 2 months X-MFC-with: r321369 Notes: svn path=/head/; revision=322740
* Upgrade our copies of clang, llvm and libc++ to r310316 from theDimitry Andric2017-08-095-5/+14
| | | | | | | | | | upstream release_50 branch. MFC after: 2 months X-MFC-with: r321369 Notes: svn path=/head/; revision=322320
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r308421, and updateDimitry Andric2017-07-194-30/+7
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=321238
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r307894, and updateDimitry Andric2017-07-139-262/+378
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=320970
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and updateDimitry Andric2017-07-023-20/+14
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=320572
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and updateDimitry Andric2017-06-276-18/+120
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=320397
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305575, and updateDimitry Andric2017-06-1716-145/+292
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=320041
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305145, and updateDimitry Andric2017-06-106-16/+94
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=319799
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304659, and updateDimitry Andric2017-06-031-1/+1
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=319547
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304460, and updateDimitry Andric2017-06-0158-289/+491
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=319479
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and updateDimitry Andric2017-05-302-3/+28
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=319250
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and updateDimitry Andric2017-05-298-14/+350
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=319164
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303291, and updateDimitry Andric2017-05-182-16/+25
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=318477
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and updateDimitry Andric2017-05-1625-128/+228
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=318384
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302418, and updateDimitry Andric2017-05-0822-66/+356
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=317969
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r301441, and updateDimitry Andric2017-04-263-19/+105
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=317472
* Merge libc++ trunk r300890, and update build glue.Dimitry Andric2017-04-2296-3717/+4424
| | | | Notes: svn path=/projects/clang500-import/; revision=317287