this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge remote-tracking branch 'origin/master' into update-sources

+43 -11
+2 -2
src/dyld/CMakeLists.txt
··· 81 81 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_SAVED} -nostdlib") 82 82 83 83 add_executable(system_loader 84 + src/dyldStartup.S 84 85 src/dyld2.cpp 85 86 src/dyldAPIs.cpp 86 87 src/dyld_debugger.cpp ··· 94 95 src/ImageLoaderMegaDylib.cpp 95 96 src/dyldExceptions.c 96 97 src/glue.c 97 - src/dyldStartup.S 98 98 src/stub_binding_helper.S 99 99 src/start_glue.S 100 100 hell.c ··· 123 123 use_ld64(system_loader) 124 124 set_target_properties(system_loader PROPERTIES OUTPUT_NAME "dyld") 125 125 set_property(TARGET system_loader APPEND_STRING PROPERTY 126 - COMPILE_FLAGS " -DBUILDING_DYLD=1 -gfull -fno-pic") 126 + COMPILE_FLAGS " -DBUILDING_DYLD=1 -gfull -fPIC -fno-stack-check") 127 127 set_property(TARGET system_loader APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-dylinker -Wl,-dead_strip -Wl,-data_const -nostdlib -Wl,-e,__dyld_start -Wl,-fixup_chains -Wl,-image_base,0x1fe00000 -Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/src/dyld.exp") 128 128 target_link_libraries(system_loader libc_static system_blocks_static 129 129 cxx_static
+3 -1
src/kernel/emulation/linux/errno.c
··· 1 1 #include "errno.h" 2 2 #include "base.h" 3 3 #include "duct_errno.h" 4 + #include <stddef.h> 4 5 5 6 static const int linux_to_darwin[512] = { 6 7 ··· 90 91 [LINUX_ETIME] = ETIME, 91 92 [LINUX_EOPNOTSUPP] = EOPNOTSUPP, 92 93 }; 94 + const size_t length_of_translation_array = sizeof(linux_to_darwin)/sizeof(const int); 93 95 94 96 int errno_linux_to_bsd(int err) 95 97 { ··· 97 99 if (v < 0) 98 100 v = -v; 99 101 100 - if (linux_to_darwin[v]) 102 + if ((v < length_of_translation_array) && (linux_to_darwin[v])) 101 103 { 102 104 v = linux_to_darwin[v]; 103 105 return (err < 0) ? -v : v;
+1 -1
src/kernel/libsyscall/bsdsyscalls/___syscall.S
··· 37 37 pushl %ecx 38 38 UNIX_SYSCALL_TRAP 39 39 movl (%esp),%edx // add one element to stack so 40 - pushl %ecx // caller "pop" will work 40 + pushl %edx // caller "pop" will work 41 41 jnb 2f 42 42 BRANCH_EXTERN(tramp_cerror) 43 43 2:
+30 -2
src/startup/darling.c
··· 501 501 } 502 502 } 503 503 504 + // Replace each quote character (') with the sequence '\'' 505 + // (copying the result to dest, if non-null) 506 + // and return the length of the result. 507 + static size_t escapeQuotes(char *dest, const char *src) 508 + { 509 + size_t len = 0; 510 + 511 + for (; *src != 0; src++) 512 + { 513 + if (*src == '\'') 514 + { 515 + if (dest) 516 + memcpy(&dest[len], "'\\''", 4); 517 + len += 4; 518 + } 519 + else 520 + { 521 + if (dest) 522 + dest[len] = *src; 523 + len++; 524 + } 525 + } 526 + if (dest) 527 + dest[len] = 0; 528 + 529 + return len; 530 + } 531 + 504 532 void spawnShell(const char** argv) 505 533 { 506 534 size_t total_len = 0; ··· 514 542 if (argv != NULL) 515 543 { 516 544 for (count = 0; argv[count] != NULL; count++) 517 - total_len += strlen(argv[count]); 545 + total_len += escapeQuotes(NULL, argv[count]); 518 546 519 547 buffer = malloc(total_len + count*3); 520 548 ··· 524 552 if (to != buffer) 525 553 to = stpcpy(to, " "); 526 554 to = stpcpy(to, "'"); 527 - to = stpcpy(to, argv[i]); 555 + to += escapeQuotes(to, argv[i]); 528 556 to = stpcpy(to, "'"); 529 557 } 530 558 }
+7 -5
tools/uninstall
··· 1 - #!/bin/bash 1 + #!/bin/sh 2 2 set +e 3 3 4 4 if [ "$(whoami)" != "root" ] ··· 8 8 exit 9 9 fi 10 10 11 + INSTALL_PREFIX="$(dirname "$(dirname "$(which darling)")")" 12 + 11 13 if command -v darling 12 14 then 13 15 darling shutdown 14 16 fi 15 - if [ -d /usr/local/libexec ] 17 + if [ -d "${INSTALL_PREFIX}/libexec" ] 16 18 then 17 - rm -rf /usr/local/libexec/darling 18 - rmdir --ignore-fail-on-non-empty /usr/local/libexec 19 + rm -rf "${INSTALL_PREFIX}/libexec/darling" 20 + rmdir --ignore-fail-on-non-empty "${INSTALL_PREFIX}/libexec" 19 21 fi 20 - rm -f /usr/local/bin/darling 22 + rm -f "${INSTALL_PREFIX}/bin/darling" 21 23 find /lib/modules -name darling-mach.ko -delete 22 24 echo "Uninstall complete"