{"id":13423619,"url":"https://github.com/tpoechtrager/osxcross","last_synced_at":"2025-03-15T17:32:01.311Z","repository":{"id":11747508,"uuid":"14277172","full_name":"tpoechtrager/osxcross","owner":"tpoechtrager","description":"Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)","archived":false,"fork":false,"pushed_at":"2025-02-07T21:16:50.000Z","size":29528,"stargazers_count":2984,"open_issues_count":126,"forks_count":334,"subscribers_count":81,"default_branch":"master","last_synced_at":"2025-02-07T22:25:39.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpoechtrager.png","metadata":{"files":{"readme":"README.COMPILER-RT.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-10T13:51:50.000Z","updated_at":"2025-02-07T21:16:55.000Z","dependencies_parsed_at":"2023-01-11T20:17:05.679Z","dependency_job_id":"57f6065f-86ec-4e39-9ec8-60f9a93c3b44","html_url":"https://github.com/tpoechtrager/osxcross","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpoechtrager%2Fosxcross","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpoechtrager%2Fosxcross/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpoechtrager%2Fosxcross/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpoechtrager%2Fosxcross/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpoechtrager","download_url":"https://codeload.github.com/tpoechtrager/osxcross/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243767045,"owners_count":20344861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T00:00:39.037Z","updated_at":"2025-03-15T17:32:00.809Z","avatar_url":"https://github.com/tpoechtrager.png","language":"C++","funding_links":[],"categories":["C++","others"],"sub_categories":[],"readme":"## COMPILER-RT ##\n\n### WHAT IS COMPILER-RT? ###\n\nPlease see http://compiler-rt.llvm.org.\n\n### INSTALLATION: ###\n\nEnsure you have finished `build.sh`,\n\nthen run: `./build_compiler_rt.sh`.\n\nBy default, installation steps for compiler-rt will be printed to the terminal\nto run manually, but you can automate the installation process by defining\n`ENABLE_COMPILER_RT_INSTALL`.\n\nYou can verify compiler-rt is working by invoking the following command:\n\n    echo \"int main(void){return 0;}\" | xcrun clang -xc -o/dev/null -v - 2\u003e\u00261 | \\\n      grep \"libclang_rt\" 1\u003e/dev/null \u0026\u0026 echo \"Success\"\n\nIf you see \"Success\", then everything went well.\n\n### USAGE: ###\n\nYou do not need to do anything, clang's doing the job for you.\n\nHowever, `-fsanitize=address` is a bit annoying because the address sanitizer library is linked  \ndynamically, and thus requires you to copy the ASAN runtime library onto the target system. \n\n\\[See [README.DEBUGGING](README.DEBUGGING.md) in how to get a backtrace with line numbers and symbol names]\n\nThe following example illustrates how to achieve this:\n\n    # Example source code.\n    $ cat test.c\n    #include \u003cstdlib.h\u003e\n    #include \u003cstring.h\u003e\n    #include \u003cstdio.h\u003e\n\n    int main(void) {\n      char buf[2];\n      strcpy(buf, \"Hello World\"); /* Buffer overflow. */\n      puts(buf);\n      return 0;\n    }\n\n    # Compile the source file.\n    $ o64-clang test.c -fsanitize=address -o test\n\n    # Ensure the ASAN library is linked in.\n    $ xcrun otool -L test\n    test:\n            /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0) # ASAN dep.\n            @rpath/libclang_rt.asan_osx_dynamic.dylib (compatibility version 0.0.0, current version 0.0.0)\n            /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)\n\n    # Copy 'test' and 'libclang_rt.asan_osx_dynamic.dylib' onto the target system.\n\n    # You can find the ASAN library path easily with this one-liner:\n    $ echo \"int main(void){return 0;}\" | xcrun clang -fsanitize=address -xc -o/dev/null -v - 2\u003e\u00261 | \\\n      tr ' ' '\\n' | grep libclang_rt.asan_osx_dynamic.dylib\n    [...]/bin/../lib/clang/3.6.2/lib/darwin/libclang_rt.asan_osx_dynamic.dylib\n\n    # Run ./test on the target system:\n    $ DYLD_LIBRARY_PATH=. ./test\n    =================================================================\n    ==410==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff58c3ec72 at pc [...]\n    WRITE of size 12 at 0x7fff58c3ec72 thread T0\n        #0 0x1070029ac  ([...]/tmp/libclang_rt.asan_osx_dynamic.dylib+0x3a9ac)\n        #1 0x106fc1d3a  ([...]/tmp/./test+0x100000d3a)\n        #2 0x106fc1bd3  ([...]/tmp/./test+0x100000bd3)\n        #3 0x0  (\u003cunknown module\u003e)\n\n    Address 0x7fff58c3ec72 is located in stack of thread T0 at offset 50 in frame\n        #0 0x106fc1bef  ([...]/tmp/./test+0x100000bef)\n\n      This frame has 2 object(s):\n        [32, 36) ''\n        [48, 50) 'buf' \u003c== Memory access at offset 50 overflows this variable\n    HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext\n          (longjmp and C++ exceptions *are* supported)\n    Shadow bytes around the buggy address:\n      0x1fffeb187d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n      0x1fffeb187d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n      0x1fffeb187d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n      0x1fffeb187d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n      0x1fffeb187d70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n    =\u003e0x1fffeb187d80: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f2[02]f3\n      0x1fffeb187d90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n      0x1fffeb187da0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n      0x1fffeb187db0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n      0x1fffeb187dc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n      0x1fffeb187dd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n    Shadow byte legend (one shadow byte represents 8 application bytes):\n      Addressable:           00\n      Partially addressable: 01 02 03 04 05 06 07 \n      Heap left redzone:       fa\n      Heap right redzone:      fb\n      Freed heap region:       fd\n      Stack left redzone:      f1\n      Stack mid redzone:       f2\n      Stack right redzone:     f3\n      Stack partial redzone:   f4\n      Stack after return:      f5\n      Stack use after scope:   f8\n      Global redzone:          f9\n      Global init order:       f6\n      Poisoned by user:        f7\n      Container overflow:      fc\n      Array cookie:            ac\n      Intra object redzone:    bb\n      ASan internal:           fe\n      Left alloca redzone:     ca\n      Right alloca redzone:    cb\n    ==410==ABORTING\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpoechtrager%2Fosxcross","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpoechtrager%2Fosxcross","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpoechtrager%2Fosxcross/lists"}