mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
parent
446a1f7c5a
commit
06f9a5b627
34 changed files with 115 additions and 51 deletions
8
Makefile
8
Makefile
|
@ -61,13 +61,19 @@
|
|||
|
||||
SHELL = build/bootstrap/cocmd.com
|
||||
HOSTS ?= freebsd openbsd netbsd rhel7 rhel5 win10 xnu
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
MAKEFLAGS += -j --no-builtin-rules
|
||||
|
||||
.SUFFIXES:
|
||||
.DELETE_ON_ERROR:
|
||||
.FEATURES: output-sync
|
||||
.PHONY: all o bins check test depend tags
|
||||
|
||||
ifneq ($(m),)
|
||||
ifeq ($(MODE),)
|
||||
MODE := $(m)
|
||||
endif
|
||||
endif
|
||||
|
||||
all: o
|
||||
o: o/$(MODE)
|
||||
|
||||
|
|
25
README.md
25
README.md
|
@ -27,7 +27,7 @@ wget https://justine.lol/cosmopolitan/cosmopolitan-amalgamation-2.0.1.zip
|
|||
unzip cosmopolitan-amalgamation-2.0.1.zip
|
||||
printf 'main() { printf("hello world\\n"); }\n' >hello.c
|
||||
gcc -g -Os -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone \
|
||||
-fno-omit-frame-pointer -pg -mnop-mcount -mno-tls-direct-seg-refs \
|
||||
-fno-omit-frame-pointer -pg -mnop-mcount -mno-tls-direct-seg-refs -gdwarf-4 \
|
||||
-o hello.com.dbg hello.c -fuse-ld=bfd -Wl,-T,ape.lds -Wl,--gc-sections \
|
||||
-include cosmopolitan.h crt.o ape-no-modify-self.o cosmopolitan.a
|
||||
objcopy -S -O binary hello.com.dbg hello.com
|
||||
|
@ -100,7 +100,7 @@ heavyweight features like tracing to your binaries by default. In that
|
|||
case, you may want to consider using our build system:
|
||||
|
||||
```sh
|
||||
make -j8 MODE=tiny
|
||||
make m=tiny
|
||||
```
|
||||
|
||||
Which will cause programs such as `hello.com` and `life.com` to shrink
|
||||
|
@ -155,7 +155,7 @@ cd cosmopolitan
|
|||
This will build the entire repository and run all the tests:
|
||||
|
||||
```sh
|
||||
build/bootstrap/make.com -j16
|
||||
build/bootstrap/make.com
|
||||
o//examples/hello.com
|
||||
find o -name \*.com | xargs ls -rShal | less
|
||||
```
|
||||
|
@ -174,7 +174,7 @@ having minimal deterministic builds. For example, if you wanted to build
|
|||
only hello.com then you could do that as follows:
|
||||
|
||||
```sh
|
||||
build/bootstrap/make.com -j16 o//examples/hello.com
|
||||
build/bootstrap/make.com o//examples/hello.com
|
||||
```
|
||||
|
||||
Sometimes it's desirable to build a subset of targets, without having to
|
||||
|
@ -183,7 +183,7 @@ directory name. For example, if you wanted to build only the targets and
|
|||
subtargets of the chibicc package including its tests, you would say:
|
||||
|
||||
```sh
|
||||
build/bootstrap/make.com -j16 o//third_party/chibicc
|
||||
build/bootstrap/make.com o//third_party/chibicc
|
||||
o//third_party/chibicc/chibicc.com --help
|
||||
```
|
||||
|
||||
|
@ -191,18 +191,19 @@ Cosmopolitan provides a variety of build modes. For example, if you want
|
|||
really tiny binaries (as small as 12kb in size) then you'd say:
|
||||
|
||||
```sh
|
||||
build/bootstrap/make.com -j16 MODE=tiny
|
||||
build/bootstrap/make.com m=tiny
|
||||
```
|
||||
|
||||
Here's some other build modes you can try:
|
||||
|
||||
```sh
|
||||
build/bootstrap/make.com -j16 MODE=dbg # asan + ubsan + debug
|
||||
build/bootstrap/make.com -j16 MODE=asan # production memory safety
|
||||
build/bootstrap/make.com -j16 MODE=opt # -march=native optimizations
|
||||
build/bootstrap/make.com -j16 MODE=rel # traditional release binaries
|
||||
build/bootstrap/make.com -j16 MODE=optlinux # optimal linux-only performance
|
||||
build/bootstrap/make.com -j16 MODE=tinylinux # tiniest linux-only 4kb binaries
|
||||
build/bootstrap/make.com m=dbg # asan + ubsan + debug
|
||||
build/bootstrap/make.com m=asan # production memory safety
|
||||
build/bootstrap/make.com m=opt # -march=native optimizations
|
||||
build/bootstrap/make.com m=rel # traditional release binaries
|
||||
build/bootstrap/make.com m=optlinux # optimal linux-only performance
|
||||
build/bootstrap/make.com m=fastbuild # build 28% faster w/o debugging
|
||||
build/bootstrap/make.com m=tinylinux # tiniest linux-only 4kb binaries
|
||||
```
|
||||
|
||||
For further details, see [//build/config.mk](build/config.mk).
|
||||
|
|
|
@ -282,6 +282,28 @@ TARGET_ARCH ?= \
|
|||
-msse3
|
||||
endif
|
||||
|
||||
# GCC11 Mode
|
||||
# https://justine.lol/compilers/x86_64-linux-musl__x86_64-linux-musl__g++-11.2.0.tar.xz
|
||||
ifeq ($(MODE), gcc11)
|
||||
.UNVEIL += rx:/opt/gcc11
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -DSYSDEBUG -O2
|
||||
AS = /opt/gcc11/bin/x86_64-linux-musl-as
|
||||
CC = /opt/gcc11/bin/x86_64-linux-musl-gcc
|
||||
CXX = /opt/gcc11/bin/x86_64-linux-musl-g++
|
||||
CXXFILT = /opt/gcc11/bin/x86_64-linux-musl-c++filt
|
||||
LD = /opt/gcc11/bin/x86_64-linux-musl-ld.bfd
|
||||
NM = /opt/gcc11/bin/x86_64-linux-musl-nm
|
||||
GCC = /opt/gcc11/bin/x86_64-linux-musl-gcc
|
||||
STRIP = /opt/gcc11/bin/x86_64-linux-musl-strip
|
||||
OBJCOPY = /opt/gcc11/bin/x86_64-linux-musl-objcopy
|
||||
OBJDUMP = /opt/gcc11/bin/x86_64-linux-musl-objdump
|
||||
ADDR2LINE = /opt/gcc11/bin/x86_64-linux-musl-addr2line
|
||||
CONFIG_CCFLAGS += $(BACKTRACES) $(FTRACE) -O2 -Wno-stringop-overread
|
||||
CONFIG_CFLAGS += -Wno-old-style-definition
|
||||
CONFIG_CPPFLAGS += -DNDEBUG -DSYSDEBUG
|
||||
TARGET_ARCH ?= -msse3
|
||||
endif
|
||||
|
||||
# LLVM Mode
|
||||
ifeq ($(MODE), llvm)
|
||||
TARGET_ARCH ?= -msse3
|
||||
|
|
|
@ -148,6 +148,7 @@ DEFAULT_CCFLAGS = \
|
|||
|
||||
DEFAULT_OFLAGS = \
|
||||
-g \
|
||||
-gdwarf-4 \
|
||||
-gdescribe-dies
|
||||
|
||||
DEFAULT_COPTS = \
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
* @see ttyconfig(), ttyrestore()
|
||||
*/
|
||||
int ttyconfig(int ttyfd, ttyconf_f fn, int64_t arg,
|
||||
const struct termios *opt_out_oldconf) {
|
||||
struct termios *opt_out_oldconf) {
|
||||
struct termios conf[2];
|
||||
if (tcgetattr(ttyfd, &conf[0]) != -1 &&
|
||||
fn(memcpy(&conf[1], &conf[0], sizeof(conf[0])), arg) != -1 &&
|
||||
|
|
|
@ -44,7 +44,7 @@ int ttysendtitle(int, const char *, const struct TtyIdent *);
|
|||
int ttyident(struct TtyIdent *, int, int);
|
||||
void ttyidentclear(struct TtyIdent *);
|
||||
char *ttydescribe(char *, size_t, const struct TtyIdent *);
|
||||
int ttyconfig(int, ttyconf_f, int64_t, const struct termios *);
|
||||
int ttyconfig(int, ttyconf_f, int64_t, struct termios *);
|
||||
int ttyrestore(int, const struct termios *);
|
||||
int ttysetrawdeadline(struct termios *, int64_t);
|
||||
int ttysetrawmode(struct termios *, int64_t);
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/calls/syscall-nt.internal.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int __sys_utimensat(int, const char *, const struct timespec *, int) hidden;
|
||||
int __sys_utimensat(int, const char *, const struct timespec[2], int) hidden;
|
||||
int sys_clock_getres(int, struct timespec *) hidden;
|
||||
int sys_clock_gettime(int, struct timespec *) hidden;
|
||||
int sys_clock_gettime_nt(int, struct timespec *) hidden;
|
||||
int sys_clock_gettime_xnu(int, struct timespec *) hidden;
|
||||
int sys_futimens(int, const struct timespec *) hidden;
|
||||
int sys_futimens(int, const struct timespec[2]) hidden;
|
||||
int sys_nanosleep(const struct timespec *, struct timespec *) hidden;
|
||||
int sys_nanosleep_nt(const struct timespec *, struct timespec *) hidden;
|
||||
int sys_nanosleep_xnu(const struct timespec *, struct timespec *) hidden;
|
||||
int sys_utimensat(int, const char *, const struct timespec *, int) hidden;
|
||||
int sys_utimensat_nt(int, const char *, const struct timespec *, int) hidden;
|
||||
int sys_utimensat_xnu(int, const char *, const struct timespec *, int) hidden;
|
||||
int sys_utimensat(int, const char *, const struct timespec[2], int) hidden;
|
||||
int sys_utimensat_nt(int, const char *, const struct timespec[2], int) hidden;
|
||||
int sys_utimensat_xnu(int, const char *, const struct timespec[2], int) hidden;
|
||||
|
||||
const char *DescribeTimespec(char[45], int, const struct timespec *);
|
||||
#define DescribeTimespec(rc, ts) DescribeTimespec(alloca(45), rc, ts)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "libc/testlib/testlib.h"
|
||||
|
||||
bool testlib_strcaseequals(size_t cw, const void *s1, const void *s2) {
|
||||
return testlib_strncaseequals(cw, s1, s2, SIZE_MAX);
|
||||
return testlib_strncaseequals(cw, s1, s2, LONG_MAX);
|
||||
}
|
||||
|
||||
bool testlib_strncaseequals(size_t cw, const void *s1, const void *s2,
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "libc/testlib/testlib.h"
|
||||
|
||||
bool testlib_strequals(size_t cw, const void *s1, const void *s2) {
|
||||
return testlib_strnequals(cw, s1, s2, SIZE_MAX);
|
||||
return testlib_strnequals(cw, s1, s2, LONG_MAX);
|
||||
}
|
||||
|
||||
bool testlib_strnequals(size_t cw, const void *s1, const void *s2, size_t n) {
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
static char buf_asctime[MAX_ASCTIME_BUF_SIZE];
|
||||
|
||||
char *
|
||||
asctime_r(register const struct tm *timeptr, char *buf)
|
||||
asctime_r(register const struct tm *timeptr, char buf[hasatleast 26])
|
||||
{
|
||||
register const char * wn;
|
||||
register const char * mn;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
char *ctime_r(const time_t *timep, char *buf) {
|
||||
char *ctime_r(const time_t *timep, char buf[hasatleast 26]) {
|
||||
struct tm mytm;
|
||||
struct tm *tmp = localtime_r(timep, &mytm);
|
||||
return tmp ? asctime_r(tmp, buf) : NULL;
|
||||
|
|
|
@ -18,7 +18,7 @@ struct tm {
|
|||
};
|
||||
|
||||
char *asctime(const struct tm *);
|
||||
char *asctime_r(const struct tm *, char[hasatleast 64]);
|
||||
char *asctime_r(const struct tm *, char[hasatleast 26]);
|
||||
char *iso8601(char[hasatleast 20], struct tm *);
|
||||
char *strptime(const char *, const char *, struct tm *);
|
||||
int64_t mktime(struct tm *);
|
||||
|
|
|
@ -18,7 +18,7 @@ extern long timezone;
|
|||
extern int daylight;
|
||||
|
||||
char *ctime(const int64_t *);
|
||||
char *ctime_r(const int64_t *, char[hasatleast 64]);
|
||||
char *ctime_r(const int64_t *, char[hasatleast 26]);
|
||||
double difftime(int64_t, int64_t) dontthrow pureconst;
|
||||
extern long double (*nowl)(void);
|
||||
int64_t clock(void);
|
||||
|
|
|
@ -29,7 +29,7 @@ char buf[6] = {0};
|
|||
struct rlimit rlim = {0, 10};
|
||||
|
||||
TEST(pipe, efault) {
|
||||
EXPECT_SYS(EFAULT, -1, pipe(0));
|
||||
EXPECT_SYS(EFAULT, -1, pipe(VEIL("r", (void *)0)));
|
||||
}
|
||||
|
||||
TEST(pipe, einval) {
|
||||
|
|
1
third_party/libcxx/__config
vendored
1
third_party/libcxx/__config
vendored
|
@ -16,6 +16,7 @@
|
|||
#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
|
||||
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
|
||||
#define _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION
|
||||
#define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
|
|
8
third_party/libcxx/algorithm.cc
vendored
8
third_party/libcxx/algorithm.cc
vendored
|
@ -55,8 +55,10 @@ template unsigned __sort5<__less<long double>&, long double*>(long double*, long
|
|||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
_LIBCPP_SAFE_STATIC static __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER;
|
||||
#endif
|
||||
unsigned __rs_default::__c_ = 0;
|
||||
|
||||
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
|
||||
|| defined(_LIBCPP_BUILDING_LIBRARY)
|
||||
unsigned __rs_default::__c_ = 0;
|
||||
__rs_default::__rs_default()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
|
@ -64,12 +66,10 @@ __rs_default::__rs_default()
|
|||
#endif
|
||||
__c_ = 1;
|
||||
}
|
||||
|
||||
__rs_default::__rs_default(const __rs_default&)
|
||||
{
|
||||
++__c_;
|
||||
}
|
||||
|
||||
__rs_default::~__rs_default()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
|
@ -79,13 +79,13 @@ __rs_default::~__rs_default()
|
|||
--__c_;
|
||||
#endif
|
||||
}
|
||||
|
||||
__rs_default::result_type
|
||||
__rs_default::operator()()
|
||||
{
|
||||
static mt19937 __rs_g;
|
||||
return __rs_g();
|
||||
}
|
||||
#endif
|
||||
|
||||
__rs_default
|
||||
__rs_get()
|
||||
|
|
8
third_party/libcxx/exception_fallback.hh
vendored
8
third_party/libcxx/exception_fallback.hh
vendored
|
@ -14,23 +14,25 @@
|
|||
namespace std {
|
||||
|
||||
_LIBCPP_SAFE_STATIC static std::terminate_handler __terminate_handler;
|
||||
_LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
|
||||
|
||||
#if _LIBCPP_STD_VER <= 14 || \
|
||||
defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) || \
|
||||
defined(_LIBCPP_BUILDING_LIBRARY)
|
||||
_LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
|
||||
// libcxxrt provides implementations of these functions itself.
|
||||
unexpected_handler set_unexpected(unexpected_handler func) _NOEXCEPT {
|
||||
return __libcpp_atomic_exchange(&__unexpected_handler, func);
|
||||
}
|
||||
|
||||
unexpected_handler get_unexpected() _NOEXCEPT {
|
||||
return __libcpp_atomic_load(&__unexpected_handler);
|
||||
}
|
||||
|
||||
_LIBCPP_NORETURN
|
||||
void unexpected() {
|
||||
(*get_unexpected())();
|
||||
// unexpected handler should not return
|
||||
terminate();
|
||||
}
|
||||
#endif
|
||||
|
||||
terminate_handler set_terminate(terminate_handler func) _NOEXCEPT {
|
||||
return __libcpp_atomic_exchange(&__terminate_handler, func);
|
||||
|
|
10
third_party/make/read.c
vendored
10
third_party/make/read.c
vendored
|
@ -427,7 +427,9 @@ eval_makefile (const char *filename, unsigned short flags)
|
|||
fclose (ebuf.fp);
|
||||
|
||||
free (ebuf.bufstart);
|
||||
alloca (0);
|
||||
|
||||
/* [jart] breaks gcc11 (also wat) */
|
||||
void *volatile wat = alloca (0);
|
||||
|
||||
errno = 0;
|
||||
return deps;
|
||||
|
@ -469,7 +471,8 @@ eval_buffer (char *buffer, const floc *flocp)
|
|||
|
||||
reading_file = curfile;
|
||||
|
||||
alloca (0);
|
||||
/* [jart] breaks gcc11 (also wat) */
|
||||
void *volatile wat = alloca (0);
|
||||
}
|
||||
|
||||
/* Check LINE to see if it's a variable assignment or undefine.
|
||||
|
@ -2495,7 +2498,8 @@ find_percent_cached (const char **string)
|
|||
if (! new)
|
||||
{
|
||||
slen = strlen (*string);
|
||||
new = alloca (slen + 1);
|
||||
/* [jart] can't prove alloca() isn't returned; let's just leak */
|
||||
new = malloc (slen + 1);
|
||||
memcpy (new, *string, slen + 1);
|
||||
p = new + (p - *string);
|
||||
*string = new;
|
||||
|
|
2
third_party/make/remake.c
vendored
2
third_party/make/remake.c
vendored
|
@ -322,7 +322,7 @@ update_file (struct file *file, unsigned int depth)
|
|||
check_renamed (f);
|
||||
|
||||
/* Clean up any alloca() used during the update. */
|
||||
alloca (0);
|
||||
void *volatile wat = alloca (0);
|
||||
|
||||
/* If we got an error, don't bother with double_colon etc. */
|
||||
if (new && !keep_going_flag)
|
||||
|
|
4
third_party/mbedtls/bigmul4.c
vendored
4
third_party/mbedtls/bigmul4.c
vendored
|
@ -29,7 +29,7 @@
|
|||
* @note words are host endian while array is little endian
|
||||
* @mayalias
|
||||
*/
|
||||
void (*Mul4x4)(uint64_t C[8], const uint64_t A[4], const uint64_t B[4]);
|
||||
void (*Mul4x4)(uint64_t C[16], const uint64_t A[8], const uint64_t B[8]);
|
||||
|
||||
static textstartup void Mul4x4Init()
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ static textstartup void Mul4x4Init()
|
|||
|
||||
const void *const Mul4x4Ctor[] initarray = {Mul4x4Init};
|
||||
|
||||
void Mul4x4Pure(uint64_t C[8], const uint64_t A[4], const uint64_t B[4])
|
||||
void Mul4x4Pure(uint64_t C[16], const uint64_t A[8], const uint64_t B[8])
|
||||
{
|
||||
uint128_t t;
|
||||
uint64_t h, c1, c2, c3;
|
||||
|
|
2
third_party/mbedtls/test/test_suite_ssl.c
vendored
2
third_party/mbedtls/test/test_suite_ssl.c
vendored
|
@ -2699,7 +2699,7 @@ void test_ssl_message_queue_insufficient_buffer_wrapper( void ** params )
|
|||
void test_ssl_message_mock_uninitialized( )
|
||||
{
|
||||
enum { MSGLEN = 10 };
|
||||
unsigned char message[MSGLEN], received[MSGLEN];
|
||||
unsigned char message[MSGLEN] = {0}, received[MSGLEN];
|
||||
mbedtls_mock_socket client, server;
|
||||
mbedtls_test_message_queue server_queue, client_queue;
|
||||
mbedtls_test_message_socket_context server_context, client_context;
|
||||
|
|
|
@ -38,6 +38,10 @@
|
|||
#include "third_party/python/Modules/_decimal/libmpdec/typearith.h"
|
||||
/* clang-format off */
|
||||
|
||||
#if __GNUC__ >= 11
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
|
||||
#endif
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
libmpdec (BSD-2)\\n\
|
||||
Copyright 2008-2016 Stefan Krah\"");
|
||||
|
|
|
@ -90,7 +90,7 @@ NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
|
|||
static const ENCODING *
|
||||
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
|
||||
# define ENCODING_MAX 128
|
||||
char buf[ENCODING_MAX];
|
||||
char buf[ENCODING_MAX] = {0}; /* [jart] wut */
|
||||
char *p = buf;
|
||||
int i;
|
||||
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
|
||||
|
|
6
third_party/sqlite3/build.c
vendored
6
third_party/sqlite3/build.c
vendored
|
@ -24,6 +24,10 @@
|
|||
*/
|
||||
#include "third_party/sqlite3/sqliteInt.inc"
|
||||
|
||||
#if __GNUC__ >= 11
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
|
||||
#endif
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
|
@ -4230,7 +4234,7 @@ void sqlite3DefaultRowEst(Index *pIdx){
|
|||
if( x<99 ){
|
||||
pIdx->pTable->nRowLogEst = x = 99;
|
||||
}
|
||||
if( pIdx->pPartIdxWhere!=0 ) x -= 10; assert( 10==sqlite3LogEst(2) );
|
||||
if( pIdx->pPartIdxWhere!=0 ) x -= 10; /*assert( 10==sqlite3LogEst(2) );*/
|
||||
a[0] = x;
|
||||
|
||||
/* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is
|
||||
|
|
5
third_party/sqlite3/fts5.c
vendored
5
third_party/sqlite3/fts5.c
vendored
|
@ -14170,10 +14170,13 @@ static int sqlite3Fts5IndexQuery(
|
|||
/* If the QUERY_SCAN flag is set, all other flags must be clear. */
|
||||
assert( (flags & FTS5INDEX_QUERY_SCAN)==0 || flags==FTS5INDEX_QUERY_SCAN );
|
||||
|
||||
/* [jart] what is with these gcc11 warnings */
|
||||
void *MemCpy(void *, const void *, size_t) asm("memcpy");
|
||||
|
||||
if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){
|
||||
int iIdx = 0; /* Index to search */
|
||||
int iPrefixIdx = 0; /* +1 prefix index */
|
||||
if( nToken ) memcpy(&buf.p[1], pToken, nToken);
|
||||
if( nToken ) MemCpy(&buf.p[1], pToken, nToken);
|
||||
|
||||
/* Figure out which index to search and set iIdx accordingly. If this
|
||||
** is a prefix query for which there is no prefix index, set iIdx to
|
||||
|
|
4
third_party/sqlite3/where.c
vendored
4
third_party/sqlite3/where.c
vendored
|
@ -20,6 +20,10 @@
|
|||
#include "third_party/sqlite3/whereInt.inc"
|
||||
/* clang-format off */
|
||||
|
||||
#if __GNUC__ >= 11
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Extra information appended to the end of sqlite3_index_info but not
|
||||
** visible to the xBestIndex function, at least not directly. The
|
||||
|
|
2
third_party/tidy/access.c
vendored
2
third_party/tidy/access.c
vendored
|
@ -891,7 +891,7 @@ static Bool CompareColors( const int rgbBG[3], const int rgbFG[3] )
|
|||
* blue = 5.
|
||||
*********************************************************************/
|
||||
|
||||
static Bool GetRgb( ctmbstr color, int rgb[] )
|
||||
static Bool GetRgb( ctmbstr color, int rgb[3] )
|
||||
{
|
||||
uint x;
|
||||
|
||||
|
|
4
third_party/tidy/attrs.c
vendored
4
third_party/tidy/attrs.c
vendored
|
@ -14,6 +14,10 @@
|
|||
#include "libc/fmt/fmt.h"
|
||||
#include "third_party/tidy/utf8.h"
|
||||
|
||||
#if __GNUC__ >= 11 /* [jart] this one looks legit */
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
|
||||
#endif
|
||||
|
||||
/*
|
||||
Bind attribute types to procedures to check values.
|
||||
You can add new procedures for better validation
|
||||
|
|
4
third_party/unzip/unzip.c
vendored
4
third_party/unzip/unzip.c
vendored
|
@ -75,6 +75,10 @@
|
|||
#include "third_party/unzip/unzvers.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#if __GNUC__ >= 11 /* [jart] worth looking into */
|
||||
#pragma GCC diagnostic ignored "-Wrestrict"
|
||||
#endif
|
||||
|
||||
#ifndef WINDLL /* The WINDLL port uses windll/windll.c instead... */
|
||||
|
||||
/***************************/
|
||||
|
|
4
third_party/unzip/unzip.mk
vendored
4
third_party/unzip/unzip.mk
vendored
|
@ -59,6 +59,10 @@ $(THIRD_PARTY_UNZIP_A_OBJS): private \
|
|||
-DHAVE_TERMIOS_H \
|
||||
-DNO_LCHMOD
|
||||
|
||||
$(THIRD_PARTY_UNZIP_A_OBJS): private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
$(OLD_CODE)
|
||||
|
||||
THIRD_PARTY_UNZIP_COMS = o/$(MODE)/third_party/unzip/unzip.com
|
||||
THIRD_PARTY_UNZIP_BINS = $(THIRD_PARTY_UNZIP_COMS) $(THIRD_PARTY_UNZIP_COMS:%=%.dbg)
|
||||
THIRD_PARTY_UNZIP_LIBS = $(foreach x,$(THIRD_PARTY_UNZIP_ARTIFACTS),$($(x)))
|
||||
|
|
|
@ -46,7 +46,7 @@ void XlatLinuxToTermios(struct termios *, const struct termios_bits *);
|
|||
void XlatTermiosToLinux(struct termios_bits *, const struct termios *);
|
||||
void XlatWinsizeToLinux(struct winsize_bits *, const struct winsize *);
|
||||
void XlatSigsetToLinux(uint8_t[8], const sigset_t *);
|
||||
void XlatLinuxToSigset(sigset_t *, const uint8_t[]);
|
||||
void XlatLinuxToSigset(sigset_t *, const uint8_t[8]);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
((eq arg 8) "llvm")
|
||||
(default default)
|
||||
((cosmo-intest) "dbg")
|
||||
(t "")))
|
||||
(t "fastbuild")))
|
||||
|
||||
(defun cosmo--make-suffix (arg)
|
||||
(cond ((eq arg 9) ".chibicc")
|
||||
|
|
|
@ -12,13 +12,13 @@ extern long magikarp_latency_;
|
|||
extern long ycbcr2rgb_latency_;
|
||||
|
||||
void Y2Rgb(long yn, long xn, unsigned char[restrict 3][yn][xn], long yys,
|
||||
long yxs, const unsigned char[restrict yys][yxs], const int[4][4],
|
||||
long yxs, const unsigned char[restrict yys][yxs], const int[8][4],
|
||||
const unsigned char[256]);
|
||||
void YCbCr2Rgb(long yn, long xn, unsigned char[restrict 3][yn][xn], long yys,
|
||||
long yxs, const unsigned char[restrict yys][yxs], long cys,
|
||||
long cxs, const unsigned char[restrict cys][cxs],
|
||||
const unsigned char[restrict cys][cxs], const int[4][4],
|
||||
const int[3][4], const unsigned char[256]);
|
||||
const unsigned char[restrict cys][cxs], const int[8][4],
|
||||
const int[6][4], const unsigned char[256]);
|
||||
|
||||
void YCbCrFree(struct YCbCr **);
|
||||
void YCbCrInit(struct YCbCr **, bool, int, double, const double[3],
|
||||
|
|
Loading…
Reference in a new issue