Commit Graph

102 Commits

Author SHA1 Message Date
Thomas A
0253375bb3 Fix Building Libc 2022-04-10 08:30:32 -07:00
Thomas A
0e42ca3e7a Fix Building libmalloc 2022-04-03 17:05:51 -07: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
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
ee4f2c17de
Merge remote-tracking branch 'origin/vchroot-abs-symlinks' into pyobjc 2021-07-04 10:49:30 -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
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
35534fcaa3
Use Apple's open-source JavaNativeFoundation
Closes #963
2021-05-21 13:58:14 -04:00
Ariel Abreu
ca96b4f108
Update a few submodules 2021-04-30 09:43:54 -04:00
Ariel Abreu
1c3749bf8a
Update libxpc 2021-04-22 23:43:14 -04:00
Ariel Abreu
8e59ab1f02
Add a bunch of stubs 2021-02-26 12:43:16 -05:00
Ariel Abreu
758c43e188
Stub some frameworks and constants
With these in place, Xcode 11's `xcodebuild` is now segfaulting for a change!
2021-02-22 23:11:06 -05:00
Ariel Abreu
05a3f730a1
Stub JavaNativeFoundation and JavaRuntimeSupport 2021-02-17 12:01:45 -05:00
Ariel Abreu
f34b642426
Update XPC header symlink paths 2021-01-07 00:25:02 -05:00
Ariel Abreu
d394cd3127
Get xtrace working again (for multithreaded programs)
We basically have to reimplement locking, memory allocation, and TLS for xtrace directly on top of Linux syscalls because it can't use almost anything external (it can pretty much only use libsystem_kernel).

The one exception is that we use `pthread_key`s from libpthread to make TLS easier to implement. The only side effect that has is that it's one less available key for the application we're tracing to use, but we shouldn't ever see that cause problems (and if we do see it cause problems later on, then we can revise that).
2020-12-11 20:48:19 -05:00
Ariel Abreu
767b4082c6
Use our LKM's generated syscall.h in SDK 2020-11-05 10:43:04 -05:00
Ariel Abreu
d076f2bb46
Update SDK symlinks and submodules
[skip ci]

Skipping CI because I know the build is currently broken with this commit; I'm going to revert our use of mDNSResponder and add back our libsystem_dnssd stub, and then patch up libresolv/libinfo to fix DNS resolution (if necessary)
2020-11-01 23:47:05 -05:00
Ariel Abreu
417f10ac21
Update target triplet and emulated OS version 2020-10-29 12:57:07 -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
7a07bbe6e5
Implement _os_cpu_number on top of Linux getcpu 2020-09-27 21:37:56 -04:00
Ariel Abreu
61e930548a
Symlink some Darling headers into the SDK 2020-09-20 18:33:05 -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
59f2d81700
Update SDK symlinks 2020-09-01 10:06:44 -04:00
Ariel Abreu
4e1cc7dc9c
Symlink libarchive into the SDK 2020-08-31 21:32:44 -04:00
Ariel Abreu
7aa85c2c95
Symlink sys/endian.h into the SDK 2020-08-31 20:31:23 -04:00
Ariel Abreu
7ba408b796
Update SDK symlinks 2020-08-27 22:30:44 -04:00
Ariel Abreu
506534033b
Update SDK symlinks 2020-08-20 16:47:11 -04:00
Ariel Abreu
7819ca3ece
Stub CFOpenDirectory
The public headers are imported from the macOS SDK and from the last released OpenDirectory (version 146); it's ok to import them from the SDK because they're still APSL licensed
2020-08-20 16:33:31 -04:00
Ariel Abreu
4af426111c
Update SDK symlinks 2020-08-18 20:04:07 -04:00
Ariel Abreu
7bf91da1d4
Add some pre-generated MIG headers
Reason: CMake's dependency scanner doesn't detect that some of the headers are generated and it doesn't try to generate them for other targets that depend on them indirectly (e.g. libc) and therefore parallel builds will fail.

The temporary solution is to check-in the generated headers into the source (just like we were doing before in `platform-include`). The proper solution would be to manually add dependencies for each target that needs the headers (which is pretty much *everything*), but that's ridiculous. Honestly, CMake should be able to detect this on its own, but whatever; this is a workaround.
2020-08-04 15:12:12 -04:00
Ariel Abreu
6a70ee5af5
Add libutil.h symlink into the SDK 2020-08-02 14:34:21 -04:00
Ariel Abreu
d9eb59b7ae
Add/update some more SDK includes 2020-08-01 22:11:10 -04:00
Ariel Abreu
aceaa68bf2
Add msgcat.h SDK symlink 2020-07-30 14:30:42 -04:00
Ariel Abreu
e18f03beeb
Update expat and some SDK symlinks 2020-07-29 08:57:35 -04:00
Ariel Abreu
12c6e2d6fa
Add some more SDK symlinks 2020-07-28 11:04:36 -04:00
Ariel Abreu
24cb5d03b9
Update SDK symlinks 2020-07-26 21:46:23 -04:00
Ariel Abreu
b91f298c19
Add BerkeleyDB 2020-07-26 21:45:39 -04:00
Ariel Abreu
7af80ac66c
Add fmdb symlink in SDK 2020-07-24 23:13:39 -04:00
Ariel Abreu
f5722174cf
Add libtelnet SDK symlinks 2020-07-24 16:54:35 -04:00
Ariel Abreu
504a614902
Update SDK symlinks
Added IOKit to usr/include for IOKitTools (IIRC?) because it uses `Kernel/IOKit/IOKitDebugging.h`, and our Kernel framework headers directory is just a symlink to usr/include at the moment (this'll be fixed later)
2020-07-24 14:44:17 -04:00
Ariel Abreu
cbfc616cbd Update SDK symlinks 2020-07-23 15:41:09 -04:00
Ariel Abreu
9ec6315bda
Update CFNetwork header symlinks to include private headers 2020-07-16 14:42:12 -04:00
Ariel Abreu
f72cf64a79
Update SDK symlinks 2020-07-15 12:17:07 -04:00
Ariel Abreu
157c5445aa
xar-420 2020-07-05 21:52:08 -04:00
Ariel Abreu
c62a60df69
Add some more SDK header symlinks 2020-07-05 13:46:21 -04:00