Uploaded image for project: 'Swift'
  1. Swift
  2. SR-14904

iOS Build Instructions do not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: SwiftSyntax
    • Labels:
      None
    • Environment:

      BS 11.4 M1 Mac Mini

      Description

      I'm trying to build SwiftSyntax for iOS using the simple steps described in the README: https://github.com/apple/swift-syntax/blob/main/README.md

      git clone https://github.com/apple/swift.git
      ./swift/utils/update-checkout --clone
      ./swift/utils/build-parser-lib --release --no-assertions --build-dir /tmp/parser-lib-build-ios --host iphoneos --architectures arm64

      Unfortunately that fails pretty quickly in the CC detection:

      -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
      -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - broken
      CMake Error at /usr/local/Cellar/cmake/3.20.3/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
        The C compiler
      
          "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"
      
        is not able to compile a simple test program.
      
        It fails with the following output:
      
          Change Dir: /tmp/parser-lib-build-ios/arm64/obj/CMakeFiles/CMakeTmp
          
          Run Build Command(s):/usr/local/bin/ninja cmTC_3a1e2 && [1/2] Building C object CMakeFiles/cmTC_3a1e2.dir/testCCompiler.c.o
          [2/2] Linking C executable cmTC_3a1e2
          FAILED: cmTC_3a1e2 
          : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch arm64 -target arm64-apple-ios10.0  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk -miphoneos-version-min=10.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_3a1e2.dir/testCCompiler.c.o -o cmTC_3a1e2   && :
          ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/usr/lib/libSystem.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/usr/lib/libSystem.tbd (4 slices)
          ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          ninja: build stopped: subcommand failed.
      

        Attachments

          Activity

            People

            Assignee:
            rwidmann Robert Widmann
            Reporter:
            helge Helge Heß
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: