cosmopolitan/ape
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
..
public Improve open source compatibility 2022-09-08 03:19:35 -07:00
aarch64.lds Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
ape-m1.c Introduce dlopen() support 2023-11-03 06:37:18 -07:00
ape.h Get rid of kmalloc() 2023-09-11 21:56:00 -07:00
ape.internal.h Get aarch64 hello world working 2023-05-10 04:20:47 -07:00
ape.lds Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
ape.mk Get Fat Emacs working on Apple Silicon 2023-08-17 22:01:42 -07:00
ape.S Make improvements 2023-09-18 21:04:47 -07:00
apeinstall.sh Introduce new fatcosmocc command 2023-08-11 22:52:11 -07:00
apeuninstall.sh Introduce new fatcosmocc command 2023-08-11 22:52:11 -07:00
blink-linux-aarch64.gz Make blink support conditionally linkable into APE 2023-06-17 07:55:35 -07:00
blink-xnu-aarch64.gz Make blink support conditionally linkable into APE 2023-06-17 07:55:35 -07:00
idata.internal.h Introduce new linker for fat ape binaries 2023-08-11 04:39:19 -07:00
launch.S Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
loader-macho.S Mint APE Loader v1.3 2023-07-23 17:08:14 -07:00
loader.c Fix some issues 2023-10-09 20:19:09 -07:00
loader.lds Mint APE Loader v1.3 2023-07-23 17:08:14 -07:00
macros.internal.h [metal] Fix bug: do not initialize IDT & TSS if unneeded (#654) 2022-10-10 20:54:46 -07:00
mz.ansi Initial import 2020-06-15 07:18:57 -07:00
notice.inc Initial import 2020-06-15 07:18:57 -07:00
relocations.h Optimize memory layout 2022-09-12 04:26:52 -07:00
sections.internal.h Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
start.S Get Fat Emacs working on Apple Silicon 2023-08-17 22:01:42 -07:00
systemcall.S Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00