···47474848### Working with DMG images
49495050-DMG images can be attached and deattached from inside `darling shell` with `hdiutil`. This is how you can install Xcode along with its toolchain and SDKs (note that Xcode itself doesn't run yet):
5050+DMG images can be attached and detached from inside `darling shell` with `hdiutil`. This is how you can install Xcode along with its toolchain and SDKs (note that Xcode itself doesn't run yet):
51515252````
5353Darling [~]$ hdiutil attach Xcode_7.2.dmg
+1-1
src/libsimple/src/lock.c
···226226 return;
227227 }; // not reached
228228 case libsimple_once_state_triggered_uncontended: {
229229- // somebody is already perfoming the callback;
229229+ // somebody is already performing the callback;
230230 // now we're waiting, so let's update the state for that
231231 libsimple_once_debug("someone is already performing the callback with no waiters; becoming first waiter...");
232232 exchanged = atomic_compare_exchange_strong_explicit(&once->state, &prev, libsimple_once_state_triggered_contended, memory_order_acq_rel, memory_order_acquire);
+1-1
src/libsystem_coreservices/dirhelper.c
···8282 pthread_mutex_lock(&dir_suffix_lock);
8383 dir_suffix = suffix;
8484 pthread_mutex_unlock(&dir_suffix_lock);
8585- return 1; // weird, it's suppossed to return non-zero on success (maybe it's actually a bool?)
8585+ return 1; // weird, it's supposed to return non-zero on success (maybe it's actually a bool?)
8686};
8787
+1-1
src/startup/mldr/commpage.c
···6060 logcpus = (uint8_t*)CGET(_COMM_PAGE_LOGICAL_CPUS);
6161 *physcpus = *logcpus = *ncpus;
62626363- // I'm not sure if Linux has seperate page sizes for kernel and user space.
6363+ // I'm not sure if Linux has separate page sizes for kernel and user space.
6464 // Apple's code uses left shift logical (1 << user_page_shift) to get the page size value.
6565 // Since it's very unlikely that the page size won't be a power of 2, we can use __builtin_ctzl()
6666 // as a substitute for log2().
+2-2
src/startup/mldr/elfcalls/threads.c
···5858 uintptr_t arg2; // `stack_addr` for normal threads; `flags` for workqueues
5959 uintptr_t arg3; // `flags` for normal threads; `nkevents` for workqueues
6060 union {
6161- void* _backwards_compat; // kept around to avoid modifiying assembly
6161+ void* _backwards_compat; // kept around to avoid modifying assembly
6262 int port;
6363 };
6464 unsigned long pth_obj_size;
···230230231231 // let's check-in with darlingserver on this new thread
232232 int dummy_stack_variable;
233233- // the lifetime pipe fd is ignored as the proces should already have been registered
233233+ // the lifetime pipe fd is ignored as the process should already have been registered
234234 if (dserver_rpc_explicit_checkin(t_server_socket, false, &dummy_stack_variable, -1) < 0) {
235235 // we can't do ANYTHING if darlingserver doesn't acknowledge us successfully
236236 abort();
+1-1
src/xtrace/lock.c
···169169 return;
170170 }; // not reached
171171 case xtrace_once_state_triggered_uncontended: {
172172- // somebody is already perfoming the callback;
172172+ // somebody is already performing the callback;
173173 // now we're waiting, so let's update the state for that
174174 xtrace_once_debug("someone is already performing the callback with no waiters; becoming first waiter...");
175175 exchanged = atomic_compare_exchange_strong_explicit(&once->state, &prev, xtrace_once_state_triggered_contended, memory_order_acq_rel, memory_order_acquire);
+1-1
tools/rename-target
···44import os
55import re
6677-parser = argparse.ArgumentParser(description="Rename a CMake target. Opperates on the current directory.")
77+parser = argparse.ArgumentParser(description="Rename a CMake target. Operates on the current directory.")
8899parser.add_argument("old", help="the target to rename", type=str)
1010parser.add_argument("new", help="the new target name", type=str)
+1-1
tools/stripcomments
···11#!/bin/sh
2233# This cool can be used to strip most of the copyrightable material from header files.
44-# Remember that all files processed with this script stil need to be checked manually!
44+# Remember that all files processed with this script still need to be checked manually!
5566gcc -DNS_BLOCKS_AVAILABLE -fpreprocessed -dD -E "$1" | egrep -v '# [[:digit:]]' | sed -r 's/APPKIT_EXTERN/EXTERN_C/;s/ ?(NS_AVAILABLE(_MAC)?|NS_DEPRECATED_MAC|NS_CLASS_AVAILABLE)\([^)]+\)//;s/#pragma mark.*//;s/NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE//;s/NS_RETURNS_INNER_POINTER//;s/NS_FORMAT_FUNCTION\(([0-9]+), ?([0-9]+)\)//'
77