Release Cosmopolitan v3.6.0

This release is an atomic upgrade to GCC 14.1.0 with C23 and C++23
This commit is contained in:
Justine Tunney 2024-07-23 03:16:17 -07:00
parent 62ace3623a
commit 5660ec4741
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
1585 changed files with 117353 additions and 271644 deletions

View file

@ -133,8 +133,8 @@ int nice(int) libcesque;
int open(const char *, int, ...) libcesque;
int openat(int, const char *, int, ...) libcesque;
int pause(void) libcesque;
int pipe(int[hasatleast 2]) libcesque;
int pipe2(int[hasatleast 2], int) libcesque;
int pipe(int[2]) libcesque;
int pipe2(int[2], int) libcesque;
int posix_fadvise(int, int64_t, int64_t, int) libcesque;
int posix_madvise(void *, uint64_t, int) libcesque;
int raise(int) libcesque;

View file

@ -33,7 +33,7 @@
* @asyncsignalsafe
* @see pipe2()
*/
int pipe(int pipefd[hasatleast 2]) {
int pipe(int pipefd[2]) {
int rc;
if (!pipefd) {
// needed for windows which is polyfilled

View file

@ -39,7 +39,7 @@
* @param flags can have O_CLOEXEC or O_DIRECT or O_NONBLOCK
* @return 0 on success, or -1 w/ errno and pipefd isn't modified
*/
int pipe2(int pipefd[hasatleast 2], int flags) {
int pipe2(int pipefd[2], int flags) {
int rc;
if (flags & ~(O_CLOEXEC | O_NONBLOCK | (O_DIRECT != -1u ? O_DIRECT : 0))) {
return einval();

View file

@ -20,14 +20,14 @@ struct Map {
intptr_t hand; /* windows nt only */
union {
struct Tree tree;
struct Map *free;
struct Map *freed;
};
};
struct Maps {
atomic_int lock;
struct Tree *maps;
_Atomic(struct Map *) free;
_Atomic(struct Map *) freed;
size_t count;
size_t pages;
_Atomic(char *) pick;

View file

@ -131,7 +131,7 @@ static int __muntrack(char *addr, size_t size, int pagesz,
if (addr <= map_addr && addr + PGUP(size) >= map_addr + PGUP(map_size)) {
// remove mapping completely
tree_remove(&__maps.maps, &map->tree);
map->free = *deleted;
map->freed = *deleted;
*deleted = map;
__maps.pages -= (map_size + pagesz - 1) / pagesz;
__maps.count -= 1;
@ -155,7 +155,7 @@ static int __muntrack(char *addr, size_t size, int pagesz,
__maps.pages -= (left + pagesz - 1) / pagesz;
leftmap->addr = map_addr;
leftmap->size = left;
leftmap->free = *deleted;
leftmap->freed = *deleted;
*deleted = leftmap;
__maps_check();
} else {
@ -171,7 +171,7 @@ static int __muntrack(char *addr, size_t size, int pagesz,
__maps.pages -= (right + pagesz - 1) / pagesz;
rightmap->addr = addr;
rightmap->size = right;
rightmap->free = *deleted;
rightmap->freed = *deleted;
*deleted = rightmap;
__maps_check();
} else {
@ -200,7 +200,7 @@ static int __muntrack(char *addr, size_t size, int pagesz,
__maps.count += 1;
middlemap->addr = addr;
middlemap->size = size;
middlemap->free = *deleted;
middlemap->freed = *deleted;
*deleted = middlemap;
__maps_check();
} else {
@ -217,9 +217,9 @@ static int __muntrack(char *addr, size_t size, int pagesz,
void __maps_free(struct Map *map) {
map->size = 0;
map->addr = MAP_FAILED;
map->free = atomic_load_explicit(&__maps.free, memory_order_relaxed);
map->freed = atomic_load_explicit(&__maps.freed, memory_order_relaxed);
for (;;) {
if (atomic_compare_exchange_weak_explicit(&__maps.free, &map->free, map,
if (atomic_compare_exchange_weak_explicit(&__maps.freed, &map->freed, map,
memory_order_release,
memory_order_relaxed))
break;
@ -229,7 +229,7 @@ void __maps_free(struct Map *map) {
static void __maps_free_all(struct Map *list) {
struct Map *next;
for (struct Map *map = list; map; map = next) {
next = map->free;
next = map->freed;
__maps_free(map);
}
}
@ -285,9 +285,9 @@ static void __maps_insert(struct Map *map) {
struct Map *__maps_alloc(void) {
struct Map *map;
map = atomic_load_explicit(&__maps.free, memory_order_relaxed);
map = atomic_load_explicit(&__maps.freed, memory_order_relaxed);
while (map) {
if (atomic_compare_exchange_weak_explicit(&__maps.free, &map, map->free,
if (atomic_compare_exchange_weak_explicit(&__maps.freed, &map, map->freed,
memory_order_acquire,
memory_order_relaxed))
return map;
@ -346,7 +346,7 @@ static int __munmap(char *addr, size_t size) {
// delete mappings
int rc = 0;
for (struct Map *map = deleted; map; map = map->free) {
for (struct Map *map = deleted; map; map = map->freed) {
if (!IsWindows()) {
if (sys_munmap(map->addr, map->size))
rc = -1;
@ -359,7 +359,7 @@ static int __munmap(char *addr, size_t size) {
}
}
// free mappings
// freed mappings
__maps_free_all(deleted);
return rc;
@ -451,7 +451,7 @@ TryAgain:
}
// polyfill map fixed noreplace
// we assume non-linux gives us addr if it's free
// we assume non-linux gives us addr if it's freed
// that's what linux (e.g. rhel7) did before noreplace
if (noreplace && res.addr != addr) {
if (!IsWindows()) {

View file

@ -1 +0,0 @@
#include "third_party/libcxx/__threading_support"

View file

@ -0,0 +1 @@
#include "third_party/intel/amxcomplexintrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/amxfp16intrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/avxifmaintrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/avxneconvertintrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/avxvnniint16intrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/avxvnniint8intrin.internal.h"

1
libc/isystem/bmmintrin.h Normal file
View file

@ -0,0 +1 @@
#include "third_party/intel/bmmintrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/cmpccxaddintrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/prfchiintrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/raointintrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/sha512intrin.internal.h"

1
libc/isystem/sm3intrin.h Normal file
View file

@ -0,0 +1 @@
#include "third_party/intel/sm3intrin.internal.h"

1
libc/isystem/sm4intrin.h Normal file
View file

@ -0,0 +1 @@
#include "third_party/intel/sm4intrin.internal.h"

View file

@ -0,0 +1 @@
#include "third_party/intel/usermsrintrin.internal.h"

View file

@ -159,10 +159,7 @@ typedef double double_t;
#define fpclassify(x) \
__builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x)
#define signbit(x) \
(sizeof(x) == sizeof(long double) ? __builtin_signbitl(x) \
: sizeof(x) == sizeof(float) ? __builtin_signbitf(x) \
: __builtin_signbit(x))
#define signbit(x) __builtin_signbit(x)
extern int signgam;

View file

@ -271,8 +271,8 @@ textwindows void WinMainForked(void) {
__threaded = false;
// fixup memory manager
__maps.free = 0;
__maps.maps = 0;
__maps.freed = 0;
__maps.count = 0;
__maps.pages = 0;
for (struct Tree *e = tree_first(maps); e; e = tree_next(e)) {

View file

@ -449,7 +449,10 @@ static int __fmt_stoa(int out(const char *, void *, size_t), void *arg,
} else if (signbit == 15) {
precision = strnlen16((const char16_t *)p, precision);
} else {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overread"
precision = strnlen(p, precision);
#pragma GCC diagnostic pop
}
}

View file

@ -204,7 +204,7 @@ static double sin_pi(double x)
double lgamma_r(double x, int *signgamp)
{
union {double f; uint64_t i;} u = {x};
double_t t,y,z,nadj,p,p1,p2,p3,q,r,w;
double_t t,y,z,nadj=0,p,p1,p2,p3,q,r,w;
uint32_t ix;
int sign,i;

View file

@ -139,7 +139,7 @@ static float sin_pi(float x)
float lgammaf_r(float x, int *signgamp)
{
union {float f; uint32_t i;} u = {x};
float t,y,z,nadj,p,p1,p2,p3,q,r,w;
float t,y,z,nadj=0,p,p1,p2,p3,q,r,w;
uint32_t ix;
int i,sign;

View file

@ -247,7 +247,7 @@ static long double sin_pi(long double x)
}
long double lgammal_r(long double x, int *sg) {
long double t, y, z, nadj, p, p1, p2, q, r, w;
long double t, y, z, nadj=0, p, p1, p2, q, r, w;
union ldshape u = {x};
uint32_t ix = (u.i.se & 0x7fffU)<<16 | u.i.m>>48;
int sign = u.i.se >> 15;