this repo has no description
1
fork

Configure Feed

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

Replaced the original README

+2 -114
+2 -114
README
··· 1 - This is a userland Mach-O loader for linux. 2 - 3 - * Usage 4 - 5 - % make release 6 - % ./ld-mac mac_binary [options...] 7 - 8 - You need OpenCFLite (http://sourceforge.net/projects/opencflite/) 9 - installed if you want to run some programs such as dsymutil. 10 - opencflite-476.17.2 is recommended. 11 - 12 - * How to use compiler tool chains of Xcode 13 - 14 - Get xcode_3.2.6_and_ios_sdk_4.3__final.dmg (or another xcode package). 15 - 16 - % git clone git@github.com:shinh/maloader.git 17 - % ./maloader/unpack_xcode.sh xcode_3.2.6_and_ios_sdk_4.3__final.dmg 18 - % sudo cp -a xcode_3.2.6_and_ios_sdk_4.3__final/root /usr/i686-apple-darwin10 19 - % cd maloader 20 - % make release 21 - % ./ld-mac /usr/i686-apple-darwin10/usr/bin/gcc mach/hello.c 22 - % ./ld-mac a.out 23 - 24 - * How to run Mach-O binaries using binfmt_misc 25 - 26 - % ./binfmt_misc.sh 27 - % /usr/i686-apple-darwin10/usr/bin/gcc mach/hello.c 28 - % ./a.out 29 - 30 - To remove the entries, run the following command: 31 - 32 - % ./binfmt_misc.sh stop 33 - 34 - * How to try 32bit support 35 - 36 - % make clean 37 - % make all BITS=32 38 - 39 - If you see permission errors like 40 - 41 - ld-mac: ./mach/hello.c.bin mmap(file) failed: Operation not permitted 42 - 43 - you should run the following command to allow users to mmap files to 44 - addresses less than 0x10000. 45 - 46 - % sudo sh -c 'echo 4096 > /proc/sys/vm/mmap_min_addr' 47 - 48 - Or, running ld-mac as a super user would also work. 49 - 50 - * How to run both 64bit Mach-O and 32bit Mach-O binaries 51 - 52 - % make both 53 - % ./binfmt_misc.sh start `pwd`/ld-mac.sh 54 - % /usr/i686-apple-darwin10/usr/bin/gcc -arch i386 mach/hello.c -o hello32 55 - % /usr/i686-apple-darwin10/usr/bin/gcc -arch x86_64 mach/hello.c -o hello64 56 - % /usr/i686-apple-darwin10/usr/bin/gcc -arch i386 -arch x86_64 mach/hello.c -o hello 57 - % ./hello32 58 - Hello, 32bit world! 59 - % ./hello64 60 - Hello, 64bit world! 61 - % ./hello 62 - Hello, 64bit world! 63 - % LD_MAC_BITS=32 ./hello 64 - Hello, 32bit world! 65 - 66 - * Which programs should work 67 - 68 - OK 69 - 70 - - gcc-4.2 (link with -g requires OpenCFLite) 71 - - otool 72 - - nm 73 - - dyldinfo 74 - - dwarfdump 75 - - strip 76 - - size 77 - - dsymutil (need OpenCFLite) 78 - - cpp-4.2 79 - - clang 80 - -- clang-70 (xcode 3.2.6): OK, but linking wasn't checked due to lack of sysroot 81 - -- clang-137 (xcode 4.0): OK 82 - 83 - not OK 84 - 85 - - llvm-gcc 86 - - gnumake and bsdmake 87 - - lex and flex 88 - - ar 89 - - m4 90 - - gdb 91 - - libtool 92 - - nasm and ndisasm (i386) 93 - - mpicc, mpicxx, and mpic++ 1 + This is a userspace compatibility layer for runniing Darwin/OS X binaries on Linux. 2 + For more information, visit http://darling.dolezel.info 94 3 95 - * Notice 96 - 97 - - Running all Mac binaries isn't my goal. Only command line tools such 98 - as compiler tool chain can be executed by this loader. 99 - - A slide about this: http://shinh.skr.jp/slide/ldmac/000.html 100 - 101 - * TODO 102 - 103 - - read dwarf for better backtracing 104 - - make llvm-gcc work 105 - - make ld in xcode4 work 106 - - improve 32bit support 107 - - handle dwarf and C++ exception 108 - 109 - * License 110 - 111 - Simplified BSD License. 112 - 113 - Note that all files in "include" directory and some files in "libmac" 114 - were copied from Apple's Libc-594.9.1. 115 - http://www.opensource.apple.com/release/mac-os-x-1064/