Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14904] iOS Build Instructions do not work #396

Closed
swift-ci opened this issue Jul 9, 2021 · 2 comments
Closed

[SR-14904] iOS Build Instructions do not work #396

swift-ci opened this issue Jul 9, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Jul 9, 2021

Previous ID SR-14904
Radar rdar://problem/80383591
Original Reporter helge (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

BS 11.4 M1 Mac Mini

Additional Detail from JIRA
Votes 0
Component/s SwiftSyntax
Labels Bug
Assignee @CodaFi
Priority Medium

md5: 26a25700ee470efd7e3fe2ce646b30e5

Issue 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.
@typesanitizer
Copy link

@swift-ci create

@CodaFi
Copy link
Member

CodaFi commented Jul 12, 2021

Tried the cross build for myself on an x86_64 host with Xcode 13 and ran into what I believe is a related issue.

apple/swift#38352

Could you give this fix a shot locally with Xcode 13 and see if that changes anything here? I suspect there may be a deeper issue with the M1-hosted cross build considering the -arch here is completely bogus.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants