Skip to content

[build] properly install compiler-rt from Xcode toolchain #31247

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

Merged
merged 6 commits into from
Oct 12, 2020

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Apr 23, 2020

Similarly to what was done for #25547, copy the compiler-rt built-ins
for embedded platforms from the Xcode toolchain into the new generated
one, so to avoid link time errors.

Addresses SR-12001, rdar://57837918

Similarly to what was done for swiftlang#25547, copy the compiler-rt built-ins
for embedded platforms from the Xcode toolchain into the new generated
one, so to avoid link time errors.

Addresses SR-12001, rdar://57837918
@edymtt
Copy link
Contributor Author

edymtt commented Apr 23, 2020

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Apr 23, 2020

@swift-ci Please Build Toolchain macOS Platform

@swift-ci
Copy link
Contributor

macOS Toolchain
Download Toolchain
Git Sha - 3894e37

Install command
tar -zxf swift-PR-31247-499-osx.tar.gz --directory ~/

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small comments, and +1 on @compnerd's comments. LGTM otherwise.

@edymtt
Copy link
Contributor Author

edymtt commented Apr 24, 2020

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Apr 24, 2020

@swift-ci Please Build Toolchain macOS Platform

@edymtt
Copy link
Contributor Author

edymtt commented Apr 24, 2020

@swift-ci Please Build Toolchain Linux Platform

@edymtt
Copy link
Contributor Author

edymtt commented Apr 24, 2020

@swift-ci please test Windows

@shahmishal
Copy link
Member

Another way to fix this issue would be to remove the compiler-rt lib from Swift Toolchain, and let Xcode automatically pick up the lib from XcodeDefault toolchain.

@shahmishal
Copy link
Member

@edymtt What is the status of this PR? Which option are we going forward with copying the compiler-rt in the swift.org toolchain or using the compiler-rt from XcodeDefault toolchain?

@shahmishal
Copy link
Member

Please update the base branch to main by Oct 5th otherwise the pull request will be closed automatically.

  • How to change the base branch: (Link)
  • More detail about the branch update: (Link)

@edymtt edymtt changed the base branch from master to main October 2, 2020 15:59
@edymtt
Copy link
Contributor Author

edymtt commented Oct 2, 2020

@shahmishal apologies for the overdue reply -- as per previous offline discussions, we are going forward with copying the compiler-rt in the swift.org toolchain

@edymtt edymtt requested a review from hyp October 2, 2020 16:34
@edymtt
Copy link
Contributor Author

edymtt commented Oct 2, 2020

For the sake of completeness, the merge revolves around integrating correctly #33133

@edymtt
Copy link
Contributor Author

edymtt commented Oct 6, 2020

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Oct 6, 2020

@swift-ci please build Swift toolchain

@edymtt
Copy link
Contributor Author

edymtt commented Oct 6, 2020

@swift-ci Please Build Toolchain

@shahmishal
Copy link
Member

If we copy the file from Xcode toolchain over to the open source toolchain would it cause any problem if the end user is using different Xcode than CI node?

For example:
Swift CI node has Xcode 12, and they try using the toolchain on Xcode 11.

@swift-ci
Copy link
Contributor

swift-ci commented Oct 6, 2020

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - 024487b

Install command
tar zxf swift-PR-31247-454-ubuntu16.04.tar.gz
More info

@mikeash
Copy link
Contributor

mikeash commented Oct 6, 2020

There shouldn't be any trouble with a version mismatch. We need a compatible library but not necessarily one that precisely matches the Xcode you're using.

@edymtt
Copy link
Contributor Author

edymtt commented Oct 7, 2020

@swift-ci please smoke test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Oct 7, 2020

@swift-ci please smoke test Linux

@edymtt
Copy link
Contributor Author

edymtt commented Oct 7, 2020

@swift-ci Please Build Toolchain

@swift-ci
Copy link
Contributor

swift-ci commented Oct 7, 2020

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - b07c940

Install command
tar zxf swift-PR-31247-457-ubuntu16.04.tar.gz
More info

@swift-ci
Copy link
Contributor

swift-ci commented Oct 7, 2020

macOS Toolchain
Download Toolchain
Git Sha - b07c940

Install command
tar -zxf swift-PR-31247-717-osx.tar.gz --directory ~/

@edymtt
Copy link
Contributor Author

edymtt commented Oct 7, 2020

Tested the program attached to SR-12001 with the macOS toolchain, now it builds fine

Also inspected the generated toolchain to ensure the files are correctly copied at usr/lib/clang/10.0.0/lib/darwin

@shahmishal
Copy link
Member

We should cherry-pick this over the release/5.3 branch because it's broken on 5.3.

@edymtt
Copy link
Contributor Author

edymtt commented Oct 7, 2020

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Oct 7, 2020

@swift-ci Please Build Toolchain

@swift-ci
Copy link
Contributor

swift-ci commented Oct 7, 2020

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - 813f5d2

Install command
tar zxf swift-PR-31247-458-ubuntu16.04.tar.gz
More info

@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

@swift-ci please smoke test macOS

1 similar comment
@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

@swift-ci please smoke test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

@swift-ci Please Build Toolchain macOS

edymtt added a commit to edymtt/swift that referenced this pull request Oct 8, 2020
Similarly to what was done for swiftlang#25547, copy the compiler-rt built-ins
for embedded platforms from the Xcode toolchain into the new generated
one, so to avoid link time errors.

Addresses SR-12001, rdar://57837918

Cherry-pick of swiftlang#31247 -- this also brings in the improvements from swiftlang#34049
@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

@swift-ci please smoke test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

@swift-ci Please clean Build Toolchain macOS

@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

@swift-ci Please Build Toolchain macOS

@shahmishal
Copy link
Member

02:30:22.266 -- Copying file /Users/buildnode/jenkins/workspace/swift-PR-toolchain-osx/branch-main/swift-nightly-install/Library/Developer/Toolchains/swift-PR-31247-720.xctoolchain/usr/lib/swift/watchsimulator/libswiftCompatibilityDynfatal error: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/buildnode/jenkins/workspace/swift-PR-toolchain-osx/branch-main/buildbot_osx/intermediate-install/macosx-x86_64/Library/Developer/Toolchains/swift-PR-31247-720.xctoolchain/usr/lib/swift/macosx/libswiftObjectiveC.dylib and /Users/buildnode/jenkins/workspace/swift-PR-toolchain-osx/branch-main/buildbot_osx/intermediate-install/macosx-arm64/Library/Developer/Toolchains/swift-PR-31247-720.xctoolchain/usr/lib/swift/macosx/libswiftObjectiveC.dylib have the same architectures (x86_64) and can't be in the same fat output file

@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

This error does not seem related to this PR (since it happens when installing Swift) and from the log there is no concrete evidence on why those files end up with the same architecture.

@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

#34236 did not have this failure, so this seems to rule out my change -- trying again

@edymtt
Copy link
Contributor Author

edymtt commented Oct 8, 2020

@swift-ci Please Build Toolchain macOS

@swift-ci
Copy link
Contributor

swift-ci commented Oct 9, 2020

macOS Toolchain
Download Toolchain
Git Sha - 813f5d2

Install command
tar -zxf swift-PR-31247-725-osx.tar.gz --directory ~/

@edymtt
Copy link
Contributor Author

edymtt commented Oct 9, 2020

Verified that the new toolchain (725) is able to compile the program attached to SR-12001 and that it contains the compiler-rt libraries as usr/lib/clang/10.0.0/lib/darwin

@edymtt edymtt merged commit 0f6611c into swiftlang:main Oct 12, 2020
edymtt added a commit that referenced this pull request Oct 12, 2020
Similarly to what was done for #25547, copy the compiler-rt built-ins
for embedded platforms from the Xcode toolchain into the new generated
one, so to avoid link time errors.

Addresses SR-12001, rdar://57837918

Cherry-pick of #31247 -- this also brings in the improvements from #34049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants