Commit Graph

3700 Commits

Author SHA1 Message Date
Thomas A
0253375bb3 Fix Building Libc 2022-04-10 08:30:32 -07:00
Thomas A
fd9e88ce46 Add darling-Libc submodule 2022-04-10 08:26:33 -07:00
Thomas A
223f262a08 Remove Libc From Darling Repo
This will be relocated in a seperate repo instead.
2022-04-10 08:24:42 -07:00
CuriousTommy
7da675d827
Merge pull request #1157 from iinux/patch-1
Update .gitmodules
2022-04-10 07:14:17 -07:00
Adolf Bonaparte
bc89a0c5ff
Update .gitmodules
To unify the style, use relative paths.
2022-04-10 20:45:01 +08:00
CuriousTommy
d1ea90aab8
Merge pull request #1145 from darlinghq/relocate_libmalloc
Relocate `libmalloc` Into Seperate Repo
2022-04-03 21:27:52 -07:00
Thomas A
8d343d3679 Fix libmalloc in libc CMakeLists.txt 2022-04-03 21:26:45 -07:00
Thomas A
0e42ca3e7a Fix Building libmalloc 2022-04-03 17:05:51 -07:00
Thomas A
de252b5b7a Add libmalloc submodule 2022-04-03 13:41:53 -07:00
Thomas A
9631286a66 Remove libmalloc from darling repo
I want to relocate this to darling-libmalloc instead
2022-04-03 13:20:06 -07:00
Ariel Abreu
156c306232
AudioToolbox: Remove unnecessary include
This should fix building with libavcodec 58 (which should also fix the CI build)
2022-03-03 23:31:53 -05:00
Ariel Abreu
4d400c5d0d
Update CoreAudio for new libavcodec
Some previously deprecated functions have now been removed entirely. Note that this updated implementation has NOT been tested.
2022-03-03 23:27:19 -05:00
Ariel Abreu
597325bc70
Merge pull request #1028 from JCWasmx86/master
Added CloudKit stubs
2022-01-25 10:00:28 -05:00
Ariel Abreu
df8cbdfc92
Move macOS version flag to non-native build section
Now the flag is only set for targets being built for the Darling environment, not those being built to run natively.

Fixes #1064
2022-01-25 09:43:03 -05:00
Ariel Abreu
9f31a8ae39
Update Foundation; fixes #1054 2022-01-25 09:33:45 -05:00
Ariel Abreu
e3bbaa11e8
Switch to libresample 2022-01-24 14:23:26 -05:00
Ariel Abreu
3b89729cd5
Update LKM 2022-01-24 14:22:35 -05:00
Ariel Abreu
97fc8eeaa4
Create our own passwd files during prefix setup
Previously, we were just using Linux's passwd, which caused inconsistencies, e.g., with home directory lookups.

Now, we also add the user to /etc/master.passwd so programs running as fake root within the prefix can still look our user up (since libinfo checks /etc/master.passwd when running as root instead of /etc/passwd).
2021-11-28 23:55:31 -05:00
Ariel Abreu
a77d2b1060
Update some submodules 2021-11-28 23:50:49 -05:00
Ariel Abreu
c0ed7336b2
Update opendirectoy headers 2021-11-28 23:50:30 -05:00
Ariel Abreu
289628cccf
Don't set O_NONBLOCK on shellspawn's stdin
O_NONBLOCK is a "file status flag", which means it is set on the underlying file, not individual file descriptors. This means that, when we pass our stdin to the child directly, they will see it as O_NONBLOCK (but that's not supposed to happen).

The workaround is to leave it as a blocking file but instead use FIONREAD to determine exactly how many bytes we can read without blocking.
2021-11-16 23:01:50 -05:00
Ariel Abreu
f5036f9d96
Update corecrypto and the LKM 2021-11-15 12:22:40 -05:00
Ariel Abreu
7399bb19e7
Merge pull request #1062 from trungnt2910/dev/trungnt2910/run-dotnet/misc
fix: Various kernel fixes
2021-11-15 12:17:33 -05:00
Trung Nguyen
a1338a4378
fix: Reexport symbols from CoreServices framework.
Some libraries expect special symbols forwarded to CoreServices, else dlopen will fail.
2021-11-15 23:10:37 +07:00
Trung Nguyen
30b39cc860
fix: No SIG_IGN for SIGCHLD 2021-11-15 09:08:24 +07:00
Trung Nguyen
b19a2138d1
fix(waitid): Proper marshalling for siginfo_t
Linux and BSD siginfo_t has different layouts, making processes calling waitid confused about the output.
2021-11-15 09:08:24 +07:00
Trung Nguyen
176375e934
feat(proc_info): Implement additional flavors
Additional flavors are implemented: PIDTASKINFO, PIDTASKALLINFO, PIDLISTTHREADS.
Furthermore, PIDTBSDINFO gets a valid pbi_start_tvsec and pbi_start_tvusec
2021-11-15 09:08:23 +07:00
Trung Nguyen
81f336f0fe
fix: _kernelrpc_mach_vm_deallocate_trap_impl accepts NULL with size 0 2021-11-15 09:07:46 +07:00
Ariel Abreu
1e7b4ce398
Update Security for Clang 13
Fixes #1050
2021-11-14 20:11:22 -05:00
Ariel Abreu
7fc8b6d04c
Many improvements for xtrace
The biggest improvement is the ability to log xtrace's output to a separate file for each thread. Jumbled output has been a big reason why xtrace is hard to use with multi-threaded programs, but this provides a nice optional solution to that problem. It doesn't come without its drawbacks, however: because xtrace has to open descriptors for the logfiles, it can affect program behavior, especially if the program sees the descriptors and decides to do something with them (like close them, which some programs do).

xtrace no longer buffers output on the stack (which could lead to stack overflows or truncated output). Actually, it doesn't buffer output at all anymore, which might be an issue (it means more potentially jumbled output when using the normal output method). If turns out to be a signifcant issue, we can re-add buffering in xtrace_log using a per-thread buffer rather than an on-stack one.

The kevent family of syscalls is now properly described! This means that those calls will now print much more useful output.

Also, to work around a stack overflow issue when running within signal handlers, xtrace now overrides the default sigstack with its own larger one. It's not apparent why xtrace is using so much stack space, but it seems like 16KiB is enough for now (rather than the default of 8KiB).

Executing the xtrace command with no arguments now produces a help message describing the various environment variables that can be used to modify xtrace's behavior.

Also, the simple printf family of functions in libsystem_kernel now support various argument sizes.

Finally, there's no reason to call the wrapper for `semaphore_signal_trap` in `bsdthread_terminate` (causing unnecessary xtrace output), so call our implementation directly instead.
2021-11-14 00:52:12 -05:00
Ariel Abreu
7d753e4203
Fix #1052
Yes, special-casing is ugly, but we already do it in other cases, and we DO want to keep resolving most absolute symlinks relative to the prefix root, so special-casing `/proc` seems to me like the best way to go.
2021-11-11 00:43:19 -05:00
Ariel Abreu
047d73a32f
Update corecrypto 2021-11-10 13:39:06 -05:00
Luboš Doležel
61d1007de1
Merge pull request #1056 from trungnt2910/dev/trungnt2910/run-dotnet
feat: Implemented mlock and munlock syscalls
2021-11-07 17:04:26 +01:00
Ariel Abreu
6faf852693
Don't set CLOEXEC on "created" descriptors in posix_spawn
Instead of using the `inherit` action, LLDB uses `dup2` with both FDs being the same number. This is supported by XNU, so we have to support it as well. The solution is to see if each descriptor we want to set CLOEXEC on is present in the file actions list. If it is, then we *don't* set CLOEXEC on it.

Also, implement octal formatting in `__simple_vsnprintf`.
2021-11-07 01:24:06 -04:00
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
Trung Nguyen
2c033c793d
feat: Implemented mlock and munlock syscalls 2021-11-05 10:02:46 +07:00
Thomas A
c4d944ae01 Update lkm submodule 2021-11-02 20:23:51 -07:00
JCWasmx86
4095b6247c Added CloudKit stubs 2021-09-09 11:20:27 +02: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