Commit Graph

3431 Commits

Author SHA1 Message Date
Ariel Abreu
8cecb9a630
Add some more Mach port traps
These are for guarded ports. While I believe we don't currently deliver port guard violation exceptions, there are certain updated programs (like `notifyd`) that need to be able to create and destroy Mach ports using `mach_port_{construct,destruct}`. This commit therefore adds some of the necessary plumbing (which is enough to satisfy `notifyd`) and leaves it up to a future commit to add proper support for guarded ports and port guard violation exceptions.
2020-09-28 13:48:21 -04:00
Thomas A
03db084961 Abstract Architecture Detection/Assignment
The main goal of this commit is to make it more easy to add or update any architecture we want to support (such as ARM64). Any changes we want to make would be done in the architectures.cmake file.

The secondary goal of this commit is to encourage a more architecture generic nomenclature. We shouldn't use i368/x86_64 unless we are dealing with code that is specific to those architectures.
2020-09-27 18:54:06 -07:00
Ariel Abreu
2fe7f1ae07
Update libdispatch and libpthread 2020-09-27 21:49:42 -04:00
Ariel Abreu
10d7373f86
Update workq_kernreturn for some API changes
First, libpthread now expects `workq_kernreturn` not to return when called with `WQOPS_THREAD_RETURN`. We have to resume the thread and give it a special value for `nkevents` that tells it to kill itself.

Next, Apple has reworked the priority system into a "Quality of Service" (QoS) system. Unfortunately, since we're building libdispatch with a few different settings than Apple's configuration, it seems that they've forgotten to correctly set QoS in some cases, so we have to it for them so that libdispatch doesn't blow up.

Finally, `WQOPS_SETUP_DISPATCH` has been stubbed so libdispatch thinks everything is fine. In the future, we might want to do something with the values it passes in, but for now we have nothing to do with them.
2020-09-27 21:49:27 -04:00
Ariel Abreu
4cc0178c42
Fix workqueue thread support
I was accidentally clobbering the `stack_addr` arg which is actually the `flags` arg for workqueues.

Also, use `stack_addr` from `args` instead of `rdi` (which is the dthread pointer) because the user could have allocated a custom stack and libpthread passes that in.

Finally, workqueues have a separate flag to indicate that the TSD base has been set.
2020-09-27 21:41:49 -04:00
Ariel Abreu
7a07bbe6e5
Implement _os_cpu_number on top of Linux getcpu 2020-09-27 21:37:56 -04:00
Ariel Abreu
f5a965c8ac
Update LKM and IOKit 2020-09-25 15:26:31 -04:00
Ariel Abreu
62def59523
Additional vfork assembly fix
This fix allows the child to actually return correctly.

It was present in an older commit but it got removed in a commit from a few months ago, in what looks like an accidental change (not sure how this code was still working, though).
2020-09-24 16:57:56 -04:00
Ariel Abreu
e68bac6263
Fix vfork assembly
I had forgotten to add some Darling fixes from the old code (some were clearly labeled with `#ifdef DARLING`, some weren't)
2020-09-24 11:23:15 -04:00
Ariel Abreu
6e8fc61857
Add some new Mach port traps 2020-09-24 08:23:27 -04:00
Ariel Abreu
fe5c825b90
Update LKM and libpthread 2020-09-23 19:28:32 -04:00
Ariel Abreu
3bc12db4bc
Update pthread wrapper code to work with new libpthread 2020-09-23 19:28:02 -04:00
Ariel Abreu
b594131166
Update LKM and libobjc 2020-09-21 20:00:44 -04:00
Ariel Abreu
6f84e31a86
Update libplatform, libpthread, and lkm 2020-09-20 18:44:21 -04:00
Ariel Abreu
1e8a3ecbae
Implement strncmp for libsystem_kernel
I don't know why Apple felt the need to move those functions out, but we need to implement `strncmp` for ourselves because we use it before libplatform is initialized
2020-09-20 18:43:55 -04:00
Ariel Abreu
5af5695758
Allow "simple" libsystem_kernel functions to be used in C++ 2020-09-20 18:42:07 -04:00
Ariel Abreu
4f83e4cee7
Add back some Darling fixes I forgot about 2020-09-20 18:39:28 -04:00
Ariel Abreu
b4efc3265a
Fix a crash in dyld when handling libcache
We can't use an initializer in libraries that are part of libSystem
2020-09-20 18:34:21 -04:00
Ariel Abreu
61e930548a
Symlink some Darling headers into the SDK 2020-09-20 18:33:05 -04:00
Ariel Abreu
5383328564
Update LKM again 2020-09-18 15:33:01 -04:00
Ariel Abreu
a1311ac7d1
Update LKM 2020-09-18 09:40:16 -04:00
Ariel Abreu
24c06dff23
Fix the temporary LKM compilation fix
Forgot that, for DKMS, the LKM source resides in /usr/src/darling-mach-0.1/lkm
2020-09-17 16:28:31 -04:00
Ariel Abreu
715f6da002
Update a bunch of submodules 2020-09-17 13:34:21 -04:00
Ariel Abreu
8ce89d6044
xar: Fix install steps 2020-09-17 09:01:06 -04:00
Ariel Abreu
1ac17e037d
Temporary workaround to build with Clang
Like my last commit in the LKM, this is only temporary so I can build for testing
2020-09-17 07:28:50 -04:00
Ariel Abreu
3b9161f239
Update LKM 2020-09-17 07:27:46 -04:00
Ariel Abreu
9735d6fbd7
Fix InstallSymlink.cmake directory creation 2020-09-17 07:27:25 -04:00
Ariel Abreu
3d8c184d57
Update ruby (again) 2020-09-01 12:14:46 -04:00
Ariel Abreu
20e8ea393d
Update ruby 2020-09-01 11:42:55 -04:00
Ariel Abreu
f3ceb29b57
Update ruby 2020-09-01 11:40:58 -04:00
Ariel Abreu
2aa4ede0f5
Update JavaScriptCore 2020-09-01 11:18:47 -04:00
Ariel Abreu
b216e6f371
Update ruby 2020-09-01 11:10:54 -04:00
Ariel Abreu
0938576ed5
Update zsh 2020-09-01 10:47:17 -04:00
Ariel Abreu
2467bda513
Check-in netname.h
This is another one of those libsyscall headers that needs to be available ahead of time because of parallel builds
2020-09-01 10:14:32 -04:00
Ariel Abreu
37cae473ba
Update a few submodules 2020-09-01 10:07:18 -04:00
Ariel Abreu
59f2d81700
Update SDK symlinks 2020-09-01 10:06:44 -04:00
Ariel Abreu
840d1f0029
PackageKit: Don't do manual memory management when using ARC 2020-09-01 10:06:21 -04:00
Ariel Abreu
3daebaec32
Fix PowerLog and ProtocolBuffer stubs 2020-09-01 10:05:50 -04:00
Ariel Abreu
4e1cc7dc9c
Symlink libarchive into the SDK 2020-08-31 21:32:44 -04:00
Ariel Abreu
4d303f6ba0
Update ColorSync header to work when included in C++ 2020-08-31 20:58:03 -04:00
Ariel Abreu
7aa85c2c95
Symlink sys/endian.h into the SDK 2020-08-31 20:31:23 -04:00
Ariel Abreu
6e4fba6c29
Fix open_memstream stub in CoreImage
Not sure why CoreImage has its own open_memstream, since the update libc already has one, but whatever
2020-08-31 20:31:04 -04:00
Ariel Abreu
4bc30bd8cc
Update another few submodules 2020-08-31 19:10:41 -04:00
Ariel Abreu
e4f9638d7c
Update a few submodules 2020-08-31 16:33:17 -04:00
Ariel Abreu
ef2d9c7622
Shut up a repeated warning (-Wavailability)
It happens because non-Apple clang doesn't understand the iosmac, bridgeos, and a few other newer Apple platforms, and it complains about it
2020-08-31 16:31:10 -04:00
Ariel Abreu
361c666156
Add stubs for libcache 2020-08-31 16:29:34 -04:00
Ariel Abreu
7f5baebc33
Stub rootless_check_datavault_flag 2020-08-31 16:23:37 -04:00
Ariel Abreu
67c1033092
CoreServices: Add BackupCore and MDItem stubs
MDItem's current code is just a bunch of stubs. However, BackupCore's current code is technically implemented (Darling doesn't do backups, so it just tells users that everything is excluded from backups).

Note that I didn't verify the values of each and every MDItem constant, but those kinds of constants usually follow a pattern, and in this case, the pattern seemed to be that their string content is just a copy of their variable names. (I could probably have used a macro to do it, but *shrug*, my editor made it easy).
2020-08-28 23:22:08 -04:00
Ariel Abreu
0118b41223
Fix libstdcxx build by moving libcxx include 2020-08-28 14:54:15 -04:00
Ariel Abreu
50c347b4eb
Forgot to remove early returns in dirhelper
That would've caused some issues later on...
2020-08-28 07:20:55 -04:00