Giter Site home page Giter Site logo

ld64's Introduction

ld64

These instructions are for building ld64 based on Apple's sources for the ld64 that comes with Xcode 10.1 and the dyld from Mojave (10.14.1) with clang/llvm 7.0.1.

Thanks to @rmaz for helping simplify my instructions.

  1. Initial setup
    1. Install Xcode 10.1 from Apple
    2. Clone this project, or download the zip.
    3. Navigate to the project directory in the terminal.
    4. Make sure there are no spaces in the current directory path, or things will go badly for you.
  2. Get Sources
    1. curl https://opensource.apple.com/tarballs/ld64/ld64-409.12.tar.gz --output ld64-409.12.tar.gz | tar xz
    2. curl https://opensource.apple.com/tarballs/dyld/dyld-635.2.tar.gz --output dyld-635.2.tar.gz | tar xz
    3. mkdir tapi-master
    4. curl -L https://github.com/ributzka/tapi/tarball/master | tar xz -C tapi-master --strip-components=1
    5. curl http://releases.llvm.org/7.0.1/llvm-7.0.1.src.tar.xz | tar xJ
    6. curl http://releases.llvm.org/7.0.1/cfe-7.0.1.src.tar.xz | tar xJ
  3. Apply patches
    1. patch -p1 -d tapi-master < patches/tapi.patch
    2. patch -p1 -d ld64-409.12 < patches/ld64.patch
    3. patch -p1 -d dyld-635.2 < patches/dyld.patch
  4. Configure ld64 project
    1. open ld64-409.12/ld64.xcodeproj
    2. Change the Base SDK for the ld64 project from macosx.internal to macos alt text
    3. Remove the override for Base SDK from the ld target so it changes from macosx.internal to macos (you can do this be selecting it and hitting delete). alt text
    4. Add the following Header Search Paths:
      • $(SRCROOT)/../tapi-master/include
      • $(SRCROOT)/../dyld-635.2/include
      • $(SRCROOT)/../llvm-7.0.1.src/include
      • $(SRCROOT)/../cfe-7.0.1.src/include alt text
    5. Set Treat Warnings as Errors to No alt text
  5. Select the ld target to build
  6. Build

You should be able to replace the ld64 that comes with Xcode 10.1 with this one (located in /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/). It will successfully link macOS 10.14, iOS 12 apps.

Be sure to back up your original ld64!!!

Do not ship anything to Apple that was linked with this linker. This is purely for debugging linker related issues.

Level of support

This is not an officially supported Google product.

ld64's People

Contributors

dmaclach avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.