mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-25 20:10:29 +00:00
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:
parent
62ace3623a
commit
5660ec4741
1585 changed files with 117353 additions and 271644 deletions
|
@ -9,7 +9,7 @@ reach a broader audience from the platform(s) of your choosing.
|
|||
|
||||
## What's Included
|
||||
|
||||
This toolchain bundles GCC 12.3.0, Cosmopolitan Libc, LLVM LIBCXX, LLVM
|
||||
This toolchain bundles GCC 14.1.0, Cosmopolitan Libc, LLVM LIBCXX, LLVM
|
||||
compiler-rt, and LLVM OpenMP. Additional libraries were provided by Musl
|
||||
Libc, and the venerable BSDs OSes. This lets you benefit from the
|
||||
awesome modern GCC compiler with the strongest GPL barrier possible. The
|
||||
|
@ -297,9 +297,9 @@ EINVAL: ... }` in cases where constants like `EINVAL` are linkable
|
|||
symbols. Your code will be rewritten in such cases to use a series of if
|
||||
statements instead, so that Cosmopolitan Libc's system constants will
|
||||
work as expected. Our modifications to GNU GCC are published under the
|
||||
ISC license at <https://github.com/ahgamut/gcc/tree/portcosmo-12.3>. The
|
||||
ISC license at <https://github.com/ahgamut/gcc/tree/portcosmo-14.1>. The
|
||||
binaries you see here were first published at
|
||||
<https://github.com/ahgamut/superconfigure/releases/tag/z0.0.43> which
|
||||
<https://github.com/ahgamut/superconfigure/releases/tag/z0.0.47> which
|
||||
is regularly updated.
|
||||
|
||||
## Legal
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
BIN=${0%/*}
|
||||
PROG=${0##*/}
|
||||
ORIGINAL="$0 $*"
|
||||
GCC_VERSION=12.3.0
|
||||
GCC_VERSION=14.1.0
|
||||
TMPDIR=${TMPDIR:-/tmp}
|
||||
|
||||
if [ "$1" = "--version" ]; then
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
BIN=${0%/*}
|
||||
PROG=${0##*/}
|
||||
GCC_VERSION=12.3.0
|
||||
GCC_VERSION=14.1.0
|
||||
|
||||
if [ "$1" = "--version" ]; then
|
||||
cat <<EOF
|
||||
|
|
|
@ -19,7 +19,7 @@ OUTDIR=${1:-cosmocc}
|
|||
APELINK=o/$(mode)/tool/build/apelink
|
||||
AMD64=${2:-x86_64}
|
||||
ARM64=${3:-aarch64}
|
||||
GCCVER=12.3.0
|
||||
GCCVER=14.1.0
|
||||
|
||||
make -j64 m= \
|
||||
$APELINK
|
||||
|
@ -118,10 +118,10 @@ fetch() {
|
|||
OLD=$PWD
|
||||
cd "$OUTDIR/"
|
||||
if [ ! -x bin/x86_64-linux-cosmo-gcc ]; then
|
||||
fetch https://github.com/ahgamut/superconfigure/releases/download/z0.0.46/aarch64-gcc.zip
|
||||
fetch https://github.com/ahgamut/superconfigure/releases/download/z0.0.47/aarch64-gcc.zip
|
||||
unzip aarch64-gcc.zip
|
||||
rm -f aarch64-gcc.zip
|
||||
fetch https://github.com/ahgamut/superconfigure/releases/download/z0.0.46/x86_64-gcc.zip
|
||||
fetch https://github.com/ahgamut/superconfigure/releases/download/z0.0.47/x86_64-gcc.zip
|
||||
unzip x86_64-gcc.zip
|
||||
rm -f x86_64-gcc.zip
|
||||
fi
|
||||
|
|
|
@ -4,6 +4,14 @@
|
|||
#include "libc/runtime/runtime.h"
|
||||
#include "tool/lambda/lib/blc.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 14
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
|
||||
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
|
||||
#pragma GCC diagnostic ignored "-Wreturn-mismatch"
|
||||
#pragma GCC diagnostic ignored "-Wint-conversion"
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-int"
|
||||
#endif
|
||||
|
||||
#define A 500000
|
||||
#define X 8
|
||||
#define Int long
|
||||
|
|
|
@ -52,7 +52,7 @@ char *StringifyMatrixByte(long yn, long xn, const unsigned char M[yn][xn],
|
|||
StringTableFormatter formatter, const char *param1,
|
||||
const char *param2, const char *param3) {
|
||||
struct StringBuilder *sb = NewStringBuilder();
|
||||
FormatMatrixByte(yn, xn, M, StringBuilderAppend, sb, formatter, param1,
|
||||
param2, param3);
|
||||
FormatMatrixByte(yn, xn, M, (void *)StringBuilderAppend, sb, formatter,
|
||||
param1, param2, param3);
|
||||
return FreeStringBuilder(sb);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ char *StringifyMatrixDouble(long yn, long xn, const double M[yn][xn],
|
|||
const char *param2, const char *param3, double digs,
|
||||
double rounder(double)) {
|
||||
struct StringBuilder *sb = NewStringBuilder();
|
||||
FormatMatrixDouble(yn, xn, M, StringBuilderAppend, sb, formatter, param1,
|
||||
param2, param3, digs, rounder);
|
||||
FormatMatrixDouble(yn, xn, M, (void *)StringBuilderAppend, sb, formatter,
|
||||
param1, param2, param3, digs, rounder);
|
||||
return FreeStringBuilder(sb);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ char *StringifyMatrixShort(long yn, long xn, const short M[yn][xn],
|
|||
StringTableFormatter formatter, const char *param1,
|
||||
const char *param2, const char *param3) {
|
||||
struct StringBuilder *sb = NewStringBuilder();
|
||||
FormatMatrixShort(yn, xn, M, StringBuilderAppend, sb, formatter, param1,
|
||||
param2, param3);
|
||||
FormatMatrixShort(yn, xn, M, (void *)StringBuilderAppend, sb, formatter,
|
||||
param1, param2, param3);
|
||||
return FreeStringBuilder(sb);
|
||||
}
|
||||
|
|
|
@ -77,31 +77,33 @@ static const char *GetStorageSpecifier(const char *type, int *out_width,
|
|||
|
||||
static void EmitSection(long yn, long xn, int w, int arrayalign, int emit(),
|
||||
void *a) {
|
||||
void (*Emit)(const char *, void *) = (void (*)(const char *, void *))emit;
|
||||
char alignstr[21];
|
||||
FormatUint32(alignstr, arrayalign);
|
||||
if (arrayalign <= 8 && yn * xn * w == 8) {
|
||||
emit("\t.rodata.cst", a);
|
||||
emit("8\n", a);
|
||||
Emit("\t.rodata.cst", a);
|
||||
Emit("8\n", a);
|
||||
} else if (arrayalign <= 16 && yn * xn * w == 16) {
|
||||
emit("\t.rodata.cst", a);
|
||||
emit("16\n", a);
|
||||
Emit("\t.rodata.cst", a);
|
||||
Emit("16\n", a);
|
||||
} else if (arrayalign <= 32 && yn * xn * w == 32) {
|
||||
emit("\t.rodata.cst", a);
|
||||
emit("32\n", a);
|
||||
Emit("\t.rodata.cst", a);
|
||||
Emit("32\n", a);
|
||||
} else if (arrayalign <= 64 && yn * xn * w == 64) {
|
||||
emit("\t.rodata.cst", a);
|
||||
emit("64\n", a);
|
||||
Emit("\t.rodata.cst", a);
|
||||
Emit("64\n", a);
|
||||
} else {
|
||||
emit("\t.rodata\n", a);
|
||||
emit("\t.align\t", a);
|
||||
emit(alignstr, a);
|
||||
emit("\n", a);
|
||||
Emit("\t.rodata\n", a);
|
||||
Emit("\t.align\t", a);
|
||||
Emit(alignstr, a);
|
||||
Emit("\n", a);
|
||||
}
|
||||
}
|
||||
|
||||
void *FormatStringTableAsAssembly(long yn, long xn, const char *const T[yn][xn],
|
||||
int emit(), void *a, const char *type,
|
||||
const char *name, const char *scope) {
|
||||
void (*Emit)(const char *, void *) = (void (*)(const char *, void *))emit;
|
||||
int w, align;
|
||||
const char *storage;
|
||||
char ynstr[21], xnstr[21];
|
||||
|
@ -110,16 +112,16 @@ void *FormatStringTableAsAssembly(long yn, long xn, const char *const T[yn][xn],
|
|||
FormatUint64(ynstr, yn);
|
||||
FormatUint64(xnstr, xn);
|
||||
EmitSection(yn, xn, w, GetArrayAlignment(yn, xn, w, align), emit, a);
|
||||
emit(name, a);
|
||||
emit(":", a);
|
||||
Emit(name, a);
|
||||
Emit(":", a);
|
||||
if (strwidth(name, 0) >= 8)
|
||||
emit("\n", a);
|
||||
Emit("\n", a);
|
||||
FormatStringTable(yn, xn, T, emit, a, gc(xstrcat("\t.", storage, "\t")), ",",
|
||||
"\n");
|
||||
emit("\t.endobj\t", a);
|
||||
emit(name, a);
|
||||
emit(",", a);
|
||||
emit(firstnonnull(scope, "globl"), a);
|
||||
emit("\n\t.previous\n", a);
|
||||
Emit("\t.endobj\t", a);
|
||||
Emit(name, a);
|
||||
Emit(",", a);
|
||||
Emit(firstnonnull(scope, "globl"), a);
|
||||
Emit("\n\t.previous\n", a);
|
||||
return (/* unconst */ void *)T;
|
||||
}
|
||||
|
|
|
@ -23,18 +23,19 @@
|
|||
void *FormatStringTableAsCode(long yn, long xn, const char *const T[yn][xn],
|
||||
int emit(), void *arg, const char *type,
|
||||
const char *name, const char *ignored) {
|
||||
void (*Emit)(const char *, void *) = (void (*)(const char *, void *))emit;
|
||||
char ynstr[21], xnstr[21];
|
||||
FormatUint64(ynstr, yn);
|
||||
FormatUint64(xnstr, xn);
|
||||
emit(type, arg);
|
||||
emit(" ", arg);
|
||||
emit(firstnonnull(name, "M"), arg);
|
||||
emit("[", arg);
|
||||
emit(ynstr, arg);
|
||||
emit("][", arg);
|
||||
emit(xnstr, arg);
|
||||
emit("] = {", arg);
|
||||
Emit(type, arg);
|
||||
Emit(" ", arg);
|
||||
Emit(firstnonnull(name, "M"), arg);
|
||||
Emit("[", arg);
|
||||
Emit(ynstr, arg);
|
||||
Emit("][", arg);
|
||||
Emit(xnstr, arg);
|
||||
Emit("] = {", arg);
|
||||
FormatStringTable(yn, xn, T, emit, arg, "\n {", ", ", "},");
|
||||
emit("\n};\n", arg);
|
||||
Emit("\n};\n", arg);
|
||||
return (/* unconst */ void *)T;
|
||||
}
|
||||
|
|
|
@ -46,18 +46,19 @@ static unsigned GetBiggestCellWidth(long yn, long xn,
|
|||
void *FormatStringTable(long yn, long xn, const char *const T[yn][xn],
|
||||
int emit(), void *a, const char *startrow,
|
||||
const char *comma, const char *endrow) {
|
||||
void (*Emit)(const char *, void *) = (void (*)(const char *, void *))emit;
|
||||
long w, y, x, i, n;
|
||||
w = GetBiggestCellWidth(yn, xn, T);
|
||||
for (y = 0; y < yn; ++y) {
|
||||
emit(startrow, a);
|
||||
Emit(startrow, a);
|
||||
for (x = 0; x < xn; ++x) {
|
||||
if (x)
|
||||
emit(comma, a);
|
||||
Emit(comma, a);
|
||||
for (n = w - strwidth(T[y][x], 0), i = 0; i < n; ++i)
|
||||
emit(" ", a);
|
||||
emit(T[y][x], a);
|
||||
Emit(" ", a);
|
||||
Emit(T[y][x], a);
|
||||
}
|
||||
emit(endrow, a);
|
||||
Emit(endrow, a);
|
||||
}
|
||||
return (/* unconst */ void *)T;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue