3664 Commits

Author SHA1 Message Date
Ariel Abreu
14d6e83ede
Improve xtrace output for posix_spawn and fix(?) xtrace TLS
This makes xtrace print more useful debugging information for posix_spawn. There are other syscalls that could definitely benefit from having more detailed output (e.g. `kevent` and friends).

Also, I was noticing segfaults when processes exited with pthread_terminate; they were due to xtrace using pthread keys after pthread_terminate had been called, which cleans up pthread keys. This new static key approach should be fault free, if only at the expense of leaking some memory per-thread. TODO: add a death hook in libsystem_kernel to notify xtrace when a thread is *actually* going to die.
2021-11-07 01:20:18 -04:00
Thomas A
c4d944ae01 Update lkm submodule 2021-11-02 20:23:51 -07:00
Ariel Abreu
9393db2c6e
Implement machdep.cpu.core_count 2021-08-01 10:01:21 -04:00
Ariel Abreu
1025c8845c
Make LSRegisterURL stub silent without STUB_VERBOSE 2021-08-01 10:01:08 -04:00
Ariel Abreu
1b1fde4a6e
Update Foundation 2021-08-01 10:00:37 -04:00
Ariel Abreu
f436078b0a
Update CF 2021-07-30 14:10:32 -04:00
Ariel Abreu
48c199cfbc
Update LKM 2021-07-25 00:08:55 -04:00
Luboš Doležel
3e4cd67db8
Merge pull request #1001 from rslsp1/fix/cups-libcups
update reference to cups for fix of #1000
2021-07-23 15:08:33 +02:00
rsl
dc1c4d892f update reference to cups for fix of #1000
https://github.com/darlinghq/darling/issues/1000
2021-07-23 11:51:53 +02:00
Ariel Abreu
e03a33d7f0
Update openpam and openssh
This was an attempt to get sshd to run properly, but unfortunately, it still fails to do so
2021-07-07 15:46:34 -04:00
Ariel Abreu
464e4f1587
Add some more stubs in some authentication frameworks
This is for the remaining PAM modules
2021-07-07 15:37:10 -04:00
Ariel Abreu
68c043779a
Stub NetFS framework 2021-07-07 15:33:36 -04:00
Ariel Abreu
50ad72b403
Stub ServerInformation framework 2021-07-07 15:32:41 -04:00
Ariel Abreu
c719e9983b
Add Jenkinsfile for my CI 2021-07-07 12:34:54 -04:00
Ariel Abreu
dd18f7bb25
Merge branch 'master' of https://github.com/darlinghq/darling 2021-07-05 11:15:08 -04:00
Ariel Abreu
9d3a2d29b9
Prevent closing the special LKM fd
Fixes #987
2021-07-05 11:15:06 -04:00
Andrew Hyatt
2761c84286 PPA source package build script 2021-07-05 09:53:48 -04:00
Ariel Abreu
26f4be2c42
Merge pull request #980 from JJTech0130/JJTech0130-clang-update
Update CMake supported clang versions
2021-07-04 21:07:53 -04:00
Ariel Abreu
6dd1d47fe3
Update cocotron, python, and python_modules 2021-07-04 18:10:28 -04:00
Ariel Abreu
ee4f2c17de
Merge remote-tracking branch 'origin/vchroot-abs-symlinks' into pyobjc 2021-07-04 10:49:30 -04:00
Ariel Abreu
1d3aa5dae9
Tell ld about the SDK version we're emulating 2021-06-29 22:45:36 -04:00
Ariel Abreu
9648ea83f4
Update some submodules 2021-06-29 22:16:12 -04:00
Ariel Abreu
831131aa86
Update CF and Foundation 2021-06-29 11:15:51 -04:00
Ariel Abreu
b248894547
Many, many fixes/additions for PyObjC
* Fix the Carbon framework to properly reexport the right frameworks
  * Add many missing Carbon-related type definitions
  * A couple of fixes in some submodules (see their commits)
2021-06-28 23:48:24 -04:00
Ariel Abreu
b806f089fe
Add SyncServices stubs 2021-06-28 23:44:29 -04:00
Ariel Abreu
2aa2f32784
Add ScreenSaver stubs 2021-06-28 23:43:11 -04:00
Ariel Abreu
b6808ef1da
Add InputMethodKit stubs 2021-06-28 23:42:04 -04:00
JJTech0130
d3d43c66f4
added clang 11 and 12 support 2021-06-25 13:02:09 -04:00
Ariel Abreu
4fbf800df4
FIx build with older clang versions
This has been tested with Clang 7, but Clang 6 should work as well.
2021-06-24 23:22:26 -04:00
Ariel Abreu
4fd969bf1e
Implement __simple_vsnprintf
...and use it in the various printing functions, instead of `__simple_vsprintf`. This fixes some buffer overflow issues with really long messages (like for applications with long path names when logging the execv expansion message).

Also, install an empty `/Library/Preferences` directory.
2021-06-22 08:13:45 -04:00
Ariel Abreu
39d818146f
Update cocotron 2021-06-13 09:17:45 -04:00
Ariel Abreu
6e269146cb
Make Darling compatible with musl libc
Also update Cocotron
2021-06-12 22:25:17 -04:00
Ariel Abreu
5c27e7e19a
Use a more compiler-specific header...
...for the compiler include path detection

This fixes include issues with musl libc
2021-06-12 17:09:41 -04:00
Ariel Abreu
eec85acce6
Include stdarg.h in xtracemig.c 2021-06-12 17:07:36 -04:00
Ariel Abreu
3761b3d7f1
Resolve absolute symlinks relative to the prefix
This requires a change in libelfloader to ensure the interpreter is resolved according to the Linux root and not the prefix.
2021-06-12 09:03:07 -04:00
Ariel Abreu
1c83210faa
Fix setjmp on i386 2021-06-11 22:48:54 -04:00
Ariel Abreu
e40a8ee458
Generate dsyms for dyld
No wonder LLDB could never find symbols for dyld: we weren't generating them!
2021-06-11 22:01:57 -04:00
Ariel Abreu
2e5958a0a7
Fix #705 2021-06-11 22:00:53 -04:00
Ariel Abreu
7734638a47
Always disable inode index for overlay mount
Leaving it to the default was causing issues with Arch, because it's on by default there. Having it on causes "device or resource busy" errors.
2021-06-11 08:48:28 -04:00
Ariel Abreu
28352ec112
Make Github Actions run on pull requests too 2021-05-29 19:40:11 -04:00
Ariel Abreu
971cf537b4
Merge pull request #778 from TheBrokenRail/patch-32
Remove Unused Code Cocotron
2021-05-29 17:56:06 -04:00
Ariel Abreu
e87f80bbe1
Update cocotron and Foundation 2021-05-29 16:34:59 -04:00
Ariel Abreu
bec1e987da
Update submodules 2021-05-28 16:19:36 -04:00
TheBrokenRail
fc491097cf Clean Up Cocotron 2021-05-24 17:34:01 -04:00
Ariel Abreu
35534fcaa3
Use Apple's open-source JavaNativeFoundation
Closes #963
2021-05-21 13:58:14 -04:00
Ariel Abreu
33306d6d3e
Update submodules 2021-05-20 12:42:04 -04:00
Ariel Abreu
5d9db0525e
Implement some more options for posix_spawn
POSIX_SPAWN_CLOEXEC_DEFAULT is set to close all fds inherited by the new process except for those explicitly marked as inheritable (or those newly created by posix_spawn actions). We can replicate this by adding O_CLOEXEC to all open fds in the child before performing our actions (except special fds like commpage).

Other than that, some new actions have also been implemented: chdir, fchdir, and inherit. chdir and fchdir change the cwd of the child to the given path or fd. inherit ensures the given fd is inherited by the child (i.e. that O_CLOEXEC is not set on it).
2021-05-20 12:41:54 -04:00
Ariel Abreu
5d9e711f69
Allow xtrace to print to the kernel message log
The new env var XTRACE_KPRINTF can be set, which will cause xtrace to print all tracing messages with kprintf (so you can view them with dmesg).

The current implementation just does a simple little substitution between regular printf and kprintf, which can result in messages being broken up over multiple lines due to the way kernel messages are presented. This should be fixed eventually (possibly by buffering output until a newline).

This commit also gets rid of xtrace's simple.{c,h}, using libsystem_kernel's "simple" functions instead.
2021-05-20 12:35:53 -04:00
Ariel Abreu
7c13ffb5bf
Expose "simple" functions from libsystem_kernel
Some of these (like __simple_printf and __simple_kprintf) were already externally visible, but now all of the functions in the simple.h header are externally visible.

One benefit of this is that we can use these in xtrace and get rid of the redundant code in xtrace's simple.{c,h}
2021-05-20 12:28:46 -04:00
Ariel Abreu
6991f144a7
Fix use-after-free in DebugSymbols
This issue only becomes apparent with darlinghq/darling-corefoundation@1f64a32cfa, but it should have always been a problem. Weird...
2021-05-20 12:25:11 -04:00