Skip to content

Conversation

@hyp
Copy link
Contributor

@hyp hyp commented Jun 18, 2019

Try to build compiler_rt for iOS/watchOS/tvOS.

@hyp
Copy link
Contributor Author

hyp commented Jun 18, 2019

@swift-ci Please clean smoke test

…ain to the build dir so that swift-clang can use them when building for ios/tvos/watchos
@hyp hyp force-pushed the test_embedded branch from 7f4975b to e11e127 Compare June 18, 2019 20:49
@hyp hyp requested review from Rostepher and shahmishal June 18, 2019 20:50
@hyp hyp changed the title Test: build compiler_rt for ios/watchos/tvos [darwin][build] Copy the libclang_rt.{ios/tvos/watchos}.a from toolchain to the build dir so that swift-clang can use them when building for ios/tvos/watchos Jun 18, 2019
@hyp
Copy link
Contributor Author

hyp commented Jun 18, 2019

@swift-ci Please clean smoke test

@hyp hyp merged commit 7351b40 into swiftlang:master Jun 18, 2019
# builtins for iOS/tvOS/watchOS to ensure that Swift's
# stdlib can use compiler-rt builtins when targetting iOS/tvOS/watchOS.
if [[ "${product}" == "llvm" ]]; then
if [[ "$(uname -s)" == "Darwin" ]] ; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason these if statements aren't combined into one?

if [[ "${product}" == "llvm" ]]; then
if [[ "$(uname -s)" == "Darwin" ]] ; then
HOST_CXX_DIR=$(dirname "${HOST_CXX}")
HOST_CXX_BUILTINS_VERSION=$(ls "$HOST_CXX_DIR/../lib/clang" | awk '{print $0}')
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if this directory isn't there?

Copy link
Contributor

Choose a reason for hiding this comment

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

This broke my compilation because it's expanding to

4.0.0
5.0.0
6.0.0
7.0.0

…newlines included. I know that's probably not normal but it'd be good to handle.


echo "copying compiler-rt embedded builtins into the local clang build directory $DEST_BUILTINS_DIR."

if [ -f "$HOST_CXX_BUILTINS_DIR/libclang_rt.ios.a" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably keep using the [[ syntax here for tests.

edymtt added a commit to edymtt/swift that referenced this pull request Apr 22, 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
edymtt added a commit to edymtt/swift that referenced this pull request Apr 23, 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
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 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
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.

3 participants