This website requires JavaScript.
Explore
Help
Sign in
mirrors
/
cosmopolitan
Watch
1
Star
0
Fork
You've already forked cosmopolitan
0
mirror of
https://github.com/jart/cosmopolitan.git
synced
2025-01-31 11:37:35 +00:00
Code
Issues
Projects
Releases
Packages
Wiki
Activity
Actions
68c7c9c1e0
cosmopolitan
/
libc
/
isystem
/
dlfcn.h
5 lines
87 B
C
Raw
Normal View
History
Unescape
Escape
Clean up more code - Found some bugs in LLVM compiler-rt library - The useless LIBC_STUBS package is now deleted - Improve the overflow checking story even further - Get chibicc tests working in MODE=dbg mode again - The libc/isystem/ headers now have correctly named guards
2023-06-18 07:55:09 +00:00
#
ifndef _DLFCN_H
#
define _DLFCN_H
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 13:04:13 +00:00
#
include
"libc/dlopen/dlfcn.h"
Clean up more code - Found some bugs in LLVM compiler-rt library - The useless LIBC_STUBS package is now deleted - Improve the overflow checking story even further - Get chibicc tests working in MODE=dbg mode again - The libc/isystem/ headers now have correctly named guards
2023-06-18 07:55:09 +00:00
#
endif
/* _DLFCN_H */
Reference in a new issue
Copy permalink