Commit graph

1905 commits

Author SHA1 Message Date
Justine Tunney
f047172bd3
Fix uname assignment in Makefile 2023-11-13 05:53:10 -08:00
mattx
5d5b282d12
Inform user when wsl2 interop causes build issues (#952) 2023-11-13 05:29:25 -08:00
Justine Tunney
25a892d6ae
Add some platform notes to the README file 2023-11-13 02:26:34 -08:00
Justine Tunney
d1e764b3cf
Modernize README.md 2023-11-12 22:04:07 -08:00
Paul Kulchenko
5c1fdc9819
Fix session changeset procesing (reverting some of 0d748ad5 changes) (#949)
This removes strdup from Lua SQLite wrapper, as it's applied to binary changeset
strings, thus cutting them short (because of strlen).
2023-11-12 14:25:50 -08:00
Justine Tunney
f25beb341c
Add architecture flag to zipobj 2023-11-12 09:35:59 -08:00
Justine Tunney
bed77186c3
Use simple locks in dlmalloc 2023-11-12 09:00:49 -08:00
Justine Tunney
bcf268adf8
Don't modify argument block on MacOS Arm64
Some dynamic library had access to this information somehow and was
crashing when it didn't have the expected structure.
2023-11-12 05:59:03 -08:00
Justine Tunney
0863427b3a
Make development more pleasant on MacOS Arm64 2023-11-12 05:42:17 -08:00
Justine Tunney
f7cad70da1
Introduce posix tests package 2023-11-12 05:41:48 -08:00
Justine Tunney
48bd3d85df
Fix sigaction() return handler address on XNU/BSD 2023-11-12 05:40:06 -08:00
Justine Tunney
bd56a9cf51
Rename dlopen() to cosmo_dlopen() 2023-11-12 01:19:04 -08:00
Justine Tunney
c6d3802d3a
Add more fixes for new cosmocc toolchain
We now have an `#include <cxxabi.h>` header which defines all the APIs
Cosmopolitan's implemented so far. The `cosmocc` README.md file is now
greatly expanded with documentation.
2023-11-11 23:28:19 -08:00
Gautham
95124cacbe
Fixes for building superconfigure (#948) 2023-11-11 22:11:11 -08:00
Justine Tunney
b320321319
Add build/bootstrap/rollup.com 2023-11-11 19:58:45 -08:00
Justine Tunney
291103ad8d
Redesign cosmocc toolchain
The `cosmocc` compiler is now being distributed as a self-contained
toolchain that's path-agnostic and it no longer requires you clone the
Cosmop repo to use it. The bin/ folder has been deleted from the mono
repo. The `fatcosmocc` command has been renamed to `cosmocc`. MacOS
support now works very well.
2023-11-11 14:18:08 -08:00
Justine Tunney
3802428026
Fix missing .ok file make warning 2023-11-11 02:32:22 -08:00
Justine Tunney
d0ad2694ed
Iterate more on recent changes 2023-11-11 00:28:22 -08:00
Paul Kulchenko
7138399f96
Close Lua state before exiting redbean worker to allow GC to collect (#941) 2023-11-10 18:37:00 -08:00
Justine Tunney
cdbd10c9d0
Introduce X86_CHECK() macro 2023-11-10 15:41:55 -08:00
Justine Tunney
afbef6c361
Freshen build/bootstrap/mkdeps.com 2023-11-10 12:39:52 -08:00
Justine Tunney
3d3cdcf276
Fix APE uname direction
Fixes #942
2023-11-10 12:34:25 -08:00
Justine Tunney
d2f49ca175
Improve mkdeps
Our makefile generator now accepts badly formatted include lines. It's
now more hermetic with better error checking in the cosmo repo, and it
can be configured to not be hermetic at all.
2023-11-10 04:14:27 -08:00
Justine Tunney
241f949540
Use dynamic memory for *NSYNC waiters 2023-11-10 01:42:06 -08:00
Justine Tunney
15af5c2d7e
Fix ucontext_t alignment in strict ansi mode
Using `cosmocc -std=c11` was causing `ucontext_t` to become misaligned.
This change also adds the GNU constants on x86_64 for accessing general
registers, so you will not need `#ifdef`s to support both Cosmo and GNU
2023-11-09 12:48:29 -08:00
Justine Tunney
b8d1377ae1
Give new wait4() another review pass 2023-11-09 11:23:30 -08:00
Justine Tunney
ea28f93a26
Support <isystem> includes in monorepo 2023-11-08 19:14:56 -08:00
Justine Tunney
5330442d85
Avoid APE fork bomb
This change addresses a $PATH resolution issue where APE depends on
uname and uname is an APE program. So sorry to anyone this impacted
we'll get a release out soon.
2023-11-08 11:37:42 -08:00
mataha
cc3e3de044
Make args replace ... only at the end of file (#909)
So that the string '...' can be used verbatim elsewhere in the file.
2023-11-08 10:00:52 -08:00
Justine Tunney
ac125d3e1f
Fix console copy/paste issue
Fixes #936
2023-11-08 09:29:45 -08:00
Justine Tunney
956e68be59
Revert "Use %gs as TLS register when dlopen() is linked"
This reverts commit d71da7fc72.
2023-11-08 01:33:01 -08:00
Justine Tunney
d71da7fc72
Use %gs as TLS register when dlopen() is linked
Fixes #938
2023-11-08 01:11:17 -08:00
Justine Tunney
e961385e55
Put more thought into i/o polyfills
wait4() is now solid enough to run `make -j100` on Windows. You can now
use MSG_DONTWAIT on Windows. There was a handle leak in accept() that's
been fixed. Our WIN32 overlapped i/o code has been simplified. Priority
class now inherits into subprocesses, so the verynice command will work
and the signal mask will now be inherited by execve() and posix_spawn()
2023-11-07 18:32:35 -08:00
Justine Tunney
736fdb757a
Implement raise() with getcontext() / setcontext() 2023-11-05 18:04:36 -08:00
Justine Tunney
dd83db9567
Improve makefile for uname 2023-11-05 16:21:09 -08:00
Justine Tunney
23d812f116
Release Cosmopolitan v3.0.2
It's recommended that all users, especially Apple Arm, re-run:

    ape/apeinstall.sh

Within the Cosmopolitan monorepo to refresh your APE loader.
2023-11-05 15:54:47 -08:00
Justine Tunney
c39eb244d4
Disable an mprotect() test for now due to SIP 2023-11-05 15:38:16 -08:00
Justine Tunney
f63c4d4f52
Use /usr/local/bin/ape on Apple Silicon 2023-11-05 14:52:27 -08:00
Paul Kulchenko
b893479417
Add database and statement readonly checks to sqlite in redbean (#914) 2023-11-05 13:29:09 -08:00
Justine Tunney
d02cba2451
Mint APE Loader v1.9 2023-11-05 13:11:34 -08:00
Justine Tunney
4cf987ddb1
Fix usleep() definition 2023-11-05 13:06:15 -08:00
Justine Tunney
20c794a353
Add strace to aarch64 vfork() 2023-11-05 13:06:15 -08:00
Gregory Haerr
4f100d2aad
Fix stack alignment and auxv for macho APE loader (#931) 2023-11-05 13:06:10 -08:00
Justine Tunney
a12ad17291
Get APE Loader working on MacOS with SIP enabled 2023-11-05 01:36:47 -08:00
Justine Tunney
653c7b2f87
Fatten build/bootstrap/echo.com 2023-11-04 21:01:43 -07:00
Justine Tunney
d7917ea076
Make win32 i/o signals atomic and longjmp() safe 2023-11-04 20:33:29 -07:00
Justine Tunney
585c86e2a4
Support \n in /zip/.args files 2023-11-04 07:25:20 -07:00
Justine Tunney
48e260e653
Introduce NO_ADDRESS constant 2023-11-03 13:56:17 -07:00
Justine Tunney
aa106c9356
Fix Lua test suite regression 2023-11-03 07:01:46 -07:00
Justine Tunney
5e8c928f1a
Introduce dlopen() support
Every program built using Cosmopolitan is statically-linked. However
there are some cases, e.g. GUIs and video drivers, where linking the
host platform libraries is desirable. So what we do in such cases is
launch a stub executable using the host platform's libc, and longjmp
back into this executable. The stub executable passes back to us the
platform-specific dlopen() implementation, which we shall then wrap.

Here's the list of platforms that are supported so far:

- x86-64 Linux w/ Glibc
- x86-64 Linux w/ Musl Libc
- x86-64 FreeBSD
- x86-64 Windows
- aarch64 Linux w/ Glibc
- aarch64 MacOS

What this means is your Cosmo programs can call foreign functions on
your host operating system. However, it's important to note that any
foreign library you link won't have the ability to call functions in
your Cosmopolitan program. For example it's now technically possible
that Lua can load a module, however that almost certainly won't work
since the Lua module won't have access to Cosmo's Lua API.

Kudos to @jacereda for figuring out how to do this.
2023-11-03 06:37:18 -07:00