mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +00:00
Improve build latency
This commit is contained in:
parent
8d8aecb6d9
commit
4ed4a1095a
7 changed files with 247 additions and 222 deletions
|
@ -326,120 +326,6 @@ TEST(open, lotsOfFds) {
|
|||
}
|
||||
}
|
||||
|
||||
static int64_t GetInode(const char *path) {
|
||||
struct stat st;
|
||||
ASSERT_SYS(0, 0, stat(path, &st));
|
||||
return st.st_ino;
|
||||
}
|
||||
|
||||
TEST(open, drive) {
|
||||
if (!IsWindows())
|
||||
return;
|
||||
ASSERT_NE(GetInode("/"), GetInode("."));
|
||||
ASSERT_EQ(GetInode("/"), GetInode("/c")); // sorry you have to run on c:/
|
||||
ASSERT_EQ(GetInode("/"), GetInode("/c/"));
|
||||
ASSERT_SYS(0, 3, open("/", O_RDONLY));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
}
|
||||
|
||||
TEST(open, readOnlyCreatMode) {
|
||||
char buf[8];
|
||||
struct stat st;
|
||||
ASSERT_SYS(0, 3, open("x", O_RDWR | O_CREAT | O_TRUNC, 0500));
|
||||
ASSERT_SYS(0, 2, pwrite(3, "MZ", 2, 0));
|
||||
ASSERT_SYS(0, 2, pread(3, buf, 8, 0));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
ASSERT_SYS(0, 0, stat("x", &st));
|
||||
ASSERT_EQ(0100500, st.st_mode);
|
||||
if (getuid()) {
|
||||
ASSERT_SYS(EACCES, -1, open("x", O_RDWR));
|
||||
ASSERT_SYS(EACCES, -1, open("x", O_RDWR | O_CREAT, 0666));
|
||||
} else {
|
||||
// root is invulnerable to eacces
|
||||
ASSERT_SYS(0, 3, open("x", O_RDWR));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
ASSERT_SYS(0, 3, open("x", O_RDWR | O_CREAT, 0666));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
SPAWN(fork);
|
||||
setuid(1000);
|
||||
setgid(1000);
|
||||
ASSERT_SYS(EACCES, -1, open("x", O_RDWR));
|
||||
ASSERT_SYS(EACCES, -1, open("x", O_RDWR | O_CREAT, 0666));
|
||||
EXITS(0);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(open, parentSymlink) {
|
||||
struct stat st;
|
||||
ASSERT_SYS(0, 0, mkdir("parent", 0755));
|
||||
// create directory symlink
|
||||
ASSERT_SYS(0, 0, symlink("parent", "parent-link"));
|
||||
// test the symlink we just made is a symlink
|
||||
ASSERT_SYS(0, 0, lstat("parent-link", &st));
|
||||
ASSERT_TRUE(S_ISLNK(st.st_mode));
|
||||
// create regular file when parent component is symlink dir
|
||||
ASSERT_SYS(0, 0, touch("parent-link/regular", 0644));
|
||||
// test stat works
|
||||
ASSERT_SYS(0, 0, stat("parent-link/regular", &st));
|
||||
ASSERT_TRUE(S_ISREG(st.st_mode));
|
||||
// test open works
|
||||
ASSERT_SYS(0, 3, open("parent-link/regular", O_RDONLY));
|
||||
ASSERT_SYS(0, 0, fstat(3, &st));
|
||||
ASSERT_TRUE(S_ISREG(st.st_mode));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
// test O_NOFOLLOW doesn't apply to parent components
|
||||
ASSERT_SYS(0, 3, open("parent-link/regular", O_RDONLY | O_NOFOLLOW));
|
||||
ASSERT_SYS(0, 0, fstat(3, &st));
|
||||
ASSERT_TRUE(S_ISREG(st.st_mode));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
// create regular symlink
|
||||
ASSERT_SYS(0, 0, symlink("regular", "parent-link/regular-link"));
|
||||
// test stat works
|
||||
ASSERT_SYS(0, 0, stat("parent-link/regular-link", &st));
|
||||
ASSERT_TRUE(S_ISREG(st.st_mode));
|
||||
ASSERT_SYS(0, 0, lstat("parent-link/regular-link", &st));
|
||||
ASSERT_TRUE(S_ISLNK(st.st_mode));
|
||||
// test open works
|
||||
ASSERT_SYS(0, 3, open("parent-link/regular-link", O_RDONLY));
|
||||
ASSERT_SYS(0, 0, fstat(3, &st));
|
||||
ASSERT_TRUE(S_ISREG(st.st_mode));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
// test O_NOFOLLOW applies to last component
|
||||
ASSERT_SYS(ELOOP, -1,
|
||||
open("parent-link/regular-link", O_RDONLY | O_NOFOLLOW));
|
||||
}
|
||||
|
||||
TEST(open, readonlyCreateMode_dontChangeStatusIfExists) {
|
||||
char buf[8];
|
||||
struct stat st;
|
||||
ASSERT_SYS(0, 3, creat("wut", 0700));
|
||||
ASSERT_SYS(0, 2, pwrite(3, "MZ", 2, 0));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
// since the file already exists, unix doesn't change read-only
|
||||
ASSERT_SYS(0, 3, open("wut", O_CREAT | O_TRUNC | O_RDWR, 0500));
|
||||
ASSERT_SYS(0, 0, pread(3, buf, 8, 0));
|
||||
ASSERT_SYS(0, 0, fstat(3, &st));
|
||||
ASSERT_EQ(0100600, st.st_mode & 0700666);
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
}
|
||||
|
||||
TEST(open, creatRdonly) {
|
||||
char buf[8];
|
||||
ASSERT_SYS(EINVAL, -1, open("foo", O_CREAT | O_TRUNC | O_RDONLY, 0700));
|
||||
ASSERT_SYS(0, 3, open("foo", O_CREAT | O_RDONLY, 0700));
|
||||
ASSERT_SYS(EBADF, -1, pwrite(3, "MZ", 2, 0));
|
||||
ASSERT_SYS(0, 0, pread(3, buf, 8, 0));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
}
|
||||
|
||||
TEST(open, sequentialRandom_EINVAL) {
|
||||
if (!IsWindows())
|
||||
return;
|
||||
ASSERT_SYS(
|
||||
EINVAL, -1,
|
||||
open("foo", O_CREAT | O_TRUNC | O_RDWR | O_SEQUENTIAL | O_RANDOM, 0700));
|
||||
}
|
||||
|
||||
// "If O_CREAT is set and the file did not previously exist, upon
|
||||
// successful completion, open() shall mark for update the last data
|
||||
// access, last data modification, and last file status change
|
||||
|
@ -485,33 +371,3 @@ TEST(open, trunc_touchesMtimCtim) {
|
|||
EXPECT_EQ(1, timespec_cmp(st.st_mtim, birth));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
}
|
||||
|
||||
TEST(open, mereOpen_doesntTouch) {
|
||||
struct stat st;
|
||||
struct timespec birth;
|
||||
ASSERT_SYS(0, 0, touch("regular", 0755));
|
||||
ASSERT_SYS(0, 0, stat("regular", &st));
|
||||
birth = st.st_ctim;
|
||||
sleep(2);
|
||||
ASSERT_SYS(0, 3, open("regular", O_RDWR));
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
ASSERT_SYS(0, 0, stat("regular", &st));
|
||||
EXPECT_EQ(0, timespec_cmp(st.st_ctim, birth));
|
||||
#if 0 // todo: why flake on rhel7?
|
||||
EXPECT_EQ(0, timespec_cmp(st.st_mtim, birth));
|
||||
EXPECT_EQ(0, timespec_cmp(st.st_atim, birth));
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(open, canTruncateExistingFile) {
|
||||
struct stat st;
|
||||
ASSERT_SYS(0, 0, xbarf("foo", "hello", -1));
|
||||
ASSERT_SYS(0, 0, stat("foo", &st));
|
||||
ASSERT_EQ(5, st.st_size);
|
||||
ASSERT_SYS(0, 3, open("foo", O_RDWR | O_TRUNC));
|
||||
ASSERT_SYS(0, 0, fstat(3, &st));
|
||||
ASSERT_EQ(0, st.st_size);
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
ASSERT_SYS(0, 0, stat("foo", &st));
|
||||
ASSERT_EQ(0, st.st_size);
|
||||
}
|
||||
|
|
3
third_party/libcxx/BUILD.mk
vendored
3
third_party/libcxx/BUILD.mk
vendored
|
@ -1064,6 +1064,9 @@ third_party/libcxx/ios.instantiations.cpp \
|
|||
third_party/libcxx/iostream.cpp \
|
||||
third_party/libcxx/legacy_pointer_safety.cpp \
|
||||
third_party/libcxx/locale.cpp \
|
||||
third_party/libcxx/locale2.cpp \
|
||||
third_party/libcxx/locale3.cpp \
|
||||
third_party/libcxx/locale4.cpp \
|
||||
third_party/libcxx/memory.cpp \
|
||||
third_party/libcxx/memory_resource.cpp \
|
||||
third_party/libcxx/mutex.cpp \
|
||||
|
|
69
third_party/libcxx/locale.cpp
vendored
69
third_party/libcxx/locale.cpp
vendored
|
@ -5643,75 +5643,6 @@ void moneypunct_byname<wchar_t, true>::init(const char* nm) {
|
|||
}
|
||||
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
|
||||
void __do_nothing(void*) {}
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<wchar_t>;)
|
||||
|
||||
template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<wchar_t>;)
|
||||
|
||||
template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, false>;
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, true>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, false>;)
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, true>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, false>;
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, true>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, false>;)
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, true>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<wchar_t, char, mbstate_t>;)
|
||||
template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
|
||||
codecvt_byname<char16_t, char, mbstate_t>;
|
||||
template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
|
||||
codecvt_byname<char32_t, char, mbstate_t>;
|
||||
#ifndef _LIBCPP_HAS_NO_CHAR8_T
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char8_t, mbstate_t>;
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char8_t, mbstate_t>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
|
69
third_party/libcxx/locale2.cpp
vendored
Normal file
69
third_party/libcxx/locale2.cpp
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <__utility/no_destroy.h>
|
||||
#include <algorithm>
|
||||
#include <clocale>
|
||||
#include <codecvt>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <locale>
|
||||
#include <new>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <typeinfo>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
# include <cwctype>
|
||||
#endif
|
||||
|
||||
#if defined(_AIX)
|
||||
# include <sys/localedef.h> // for __lc_ctype_ptr
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_MSVCRT)
|
||||
# define _CTYPE_DISABLE_MACROS
|
||||
#endif
|
||||
|
||||
#if !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__) && !defined(__BIONIC__) && !defined(__NuttX__)
|
||||
# include <langinfo.h>
|
||||
#endif
|
||||
|
||||
#include "atomic_support.h"
|
||||
#include "sso_allocator.h"
|
||||
|
||||
// On Linux, wint_t and wchar_t have different signed-ness, and this causes
|
||||
// lots of noise in the build log, but no bugs that I know of.
|
||||
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wsign-conversion")
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
void __do_nothing(void*) {}
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<wchar_t>;)
|
||||
|
||||
template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<wchar_t>;)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_POP_MACROS
|
95
third_party/libcxx/locale3.cpp
vendored
Normal file
95
third_party/libcxx/locale3.cpp
vendored
Normal file
|
@ -0,0 +1,95 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <__utility/no_destroy.h>
|
||||
#include <algorithm>
|
||||
#include <clocale>
|
||||
#include <codecvt>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <locale>
|
||||
#include <new>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <typeinfo>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
# include <cwctype>
|
||||
#endif
|
||||
|
||||
#if defined(_AIX)
|
||||
# include <sys/localedef.h> // for __lc_ctype_ptr
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_MSVCRT)
|
||||
# define _CTYPE_DISABLE_MACROS
|
||||
#endif
|
||||
|
||||
#if !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__) && !defined(__BIONIC__) && !defined(__NuttX__)
|
||||
# include <langinfo.h>
|
||||
#endif
|
||||
|
||||
#include "atomic_support.h"
|
||||
#include "sso_allocator.h"
|
||||
|
||||
// On Linux, wint_t and wchar_t have different signed-ness, and this causes
|
||||
// lots of noise in the build log, but no bugs that I know of.
|
||||
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wsign-conversion")
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, false>;
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, true>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, false>;)
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, true>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, false>;
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, true>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, false>;)
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, true>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<wchar_t, char, mbstate_t>;)
|
||||
template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
|
||||
codecvt_byname<char16_t, char, mbstate_t>;
|
||||
template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
|
||||
codecvt_byname<char32_t, char, mbstate_t>;
|
||||
#ifndef _LIBCPP_HAS_NO_CHAR8_T
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char8_t, mbstate_t>;
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char8_t, mbstate_t>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_POP_MACROS
|
70
third_party/libcxx/locale4.cpp
vendored
Normal file
70
third_party/libcxx/locale4.cpp
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <__utility/no_destroy.h>
|
||||
#include <algorithm>
|
||||
#include <clocale>
|
||||
#include <codecvt>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <locale>
|
||||
#include <new>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <typeinfo>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
# include <cwctype>
|
||||
#endif
|
||||
|
||||
#if defined(_AIX)
|
||||
# include <sys/localedef.h> // for __lc_ctype_ptr
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_MSVCRT)
|
||||
# define _CTYPE_DISABLE_MACROS
|
||||
#endif
|
||||
|
||||
#if !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__) && !defined(__BIONIC__) && !defined(__NuttX__)
|
||||
# include <langinfo.h>
|
||||
#endif
|
||||
|
||||
#include "atomic_support.h"
|
||||
#include "sso_allocator.h"
|
||||
|
||||
// On Linux, wint_t and wchar_t have different signed-ness, and this causes
|
||||
// lots of noise in the build log, but no bugs that I know of.
|
||||
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wsign-conversion")
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<wchar_t>;)
|
||||
|
||||
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<char>;
|
||||
_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<wchar_t>;)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_POP_MACROS
|
|
@ -19,12 +19,13 @@ OUTDIR=${1:-cosmocc}
|
|||
APELINK=o/$(mode)/tool/build/apelink
|
||||
AMD64=${2:-x86_64}
|
||||
ARM64=${3:-aarch64}
|
||||
NPROC=$(($(nproc)/2))
|
||||
GCCVER=14.1.0
|
||||
|
||||
make -j64 m= \
|
||||
make -j$NPROC m= \
|
||||
$APELINK
|
||||
|
||||
make -j64 m=$AMD64 \
|
||||
make -j$NPROC m=$AMD64 \
|
||||
o/cosmocc.h.txt \
|
||||
o/$AMD64/ape/ape.lds \
|
||||
o/$AMD64/libc/crt/crt.o \
|
||||
|
@ -61,7 +62,7 @@ make -j64 m=$AMD64 \
|
|||
o/$AMD64/third_party/make/make.dbg \
|
||||
o/$AMD64/third_party/ctags/ctags.dbg
|
||||
|
||||
make -j64 m=$AMD64-tiny \
|
||||
make -j$NPROC m=$AMD64-tiny \
|
||||
o/cosmocc.h.txt \
|
||||
o/$AMD64-tiny/ape/ape.lds \
|
||||
o/$AMD64-tiny/libc/crt/crt.o \
|
||||
|
@ -73,7 +74,7 @@ make -j64 m=$AMD64-tiny \
|
|||
o/$AMD64-tiny/cosmopolitan.a \
|
||||
o/$AMD64-tiny/third_party/libcxx/libcxx.a \
|
||||
|
||||
make -j64 m=$AMD64-dbg \
|
||||
make -j$NPROC m=$AMD64-dbg \
|
||||
o/cosmocc.h.txt \
|
||||
o/$AMD64-dbg/ape/ape.lds \
|
||||
o/$AMD64-dbg/libc/crt/crt.o \
|
||||
|
@ -85,7 +86,7 @@ make -j64 m=$AMD64-dbg \
|
|||
o/$AMD64-dbg/cosmopolitan.a \
|
||||
o/$AMD64-dbg/third_party/libcxx/libcxx.a \
|
||||
|
||||
make CONFIG_TARGET_ARCH= -j64 m=$AMD64-optlinux \
|
||||
make CONFIG_TARGET_ARCH= -j$NPROC m=$AMD64-optlinux \
|
||||
o/cosmocc.h.txt \
|
||||
o/$AMD64-optlinux/ape/ape.lds \
|
||||
o/$AMD64-optlinux/libc/crt/crt.o \
|
||||
|
@ -97,7 +98,7 @@ make CONFIG_TARGET_ARCH= -j64 m=$AMD64-optlinux \
|
|||
o/$AMD64-optlinux/cosmopolitan.a \
|
||||
o/$AMD64-optlinux/third_party/libcxx/libcxx.a \
|
||||
|
||||
make -j64 m=$ARM64 \
|
||||
make -j$NPROC m=$ARM64 \
|
||||
o/$ARM64/ape/ape.elf \
|
||||
o/$ARM64/ape/aarch64.lds \
|
||||
o/$ARM64/libc/crt/crt.o \
|
||||
|
@ -131,7 +132,7 @@ make -j64 m=$ARM64 \
|
|||
o/$ARM64/third_party/make/make.dbg \
|
||||
o/$ARM64/third_party/ctags/ctags.dbg
|
||||
|
||||
make -j64 m=$ARM64-tiny \
|
||||
make -j$NPROC m=$ARM64-tiny \
|
||||
o/$ARM64-tiny/ape/ape.elf \
|
||||
o/$ARM64-tiny/ape/aarch64.lds \
|
||||
o/$ARM64-tiny/libc/crt/crt.o \
|
||||
|
@ -140,7 +141,7 @@ make -j64 m=$ARM64-tiny \
|
|||
o/$ARM64-tiny/cosmopolitan.a \
|
||||
o/$ARM64-tiny/third_party/libcxx/libcxx.a \
|
||||
|
||||
make -j64 m=$ARM64-dbg \
|
||||
make -j$NPROC m=$ARM64-dbg \
|
||||
o/$ARM64-dbg/ape/ape.elf \
|
||||
o/$ARM64-dbg/ape/aarch64.lds \
|
||||
o/$ARM64-dbg/libc/crt/crt.o \
|
||||
|
@ -149,7 +150,7 @@ make -j64 m=$ARM64-dbg \
|
|||
o/$ARM64-dbg/cosmopolitan.a \
|
||||
o/$ARM64-dbg/third_party/libcxx/libcxx.a \
|
||||
|
||||
make -j64 m=$ARM64-optlinux \
|
||||
make -j$NPROC m=$ARM64-optlinux \
|
||||
o/$ARM64-optlinux/ape/ape.elf \
|
||||
o/$ARM64-optlinux/ape/aarch64.lds \
|
||||
o/$ARM64-optlinux/libc/crt/crt.o \
|
||||
|
|
Loading…
Reference in a new issue