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-5059] static_assert failed "__swift_ssize_t must be defined as equivalent to ssize_t #47635

Closed
swift-ci opened this issue May 31, 2017 · 11 comments
Assignees
Labels
Android Platform: Android bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-5059
Radar None
Original Reporter amraboelela (JIRA User)
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Android
Assignee @milseman
Priority Medium

md5: 12f8136c165bad62b586a61dda0d51d9

Issue Description:

This happens when running
./utils/build-script \
-R \
--android \
--android-ndk "${ANDROID_NDK_DIR}" \
--android-api-level 21 \
--android-icu-uc "${ANDROID_ICU_DIR}/armeabi-v7a" \
--android-icu-uc-include "${ANDROID_ICU_DIR}/armeabi-v7a/icu/source/common" \
--android-icu-i18n "${ANDROID_ICU_DIR}/armeabi-v7a" \
--android-icu-i18n-include "${ANDROID_ICU_DIR}/armeabi-v7a/icu/source/i18n"

@swift-ci
Copy link
Collaborator Author

Comment by Amr Aboelela (JIRA)

Full error is:
swift/stdlib/public/stubs/LibcShims.cpp:32:1: error: static_assert failed "__swift_ssize_t must be defined as equivalent to ssize_t"
static_assert(std::is_same<ssize_t, swift::__swift_ssize_t>::value,

@swift-ci
Copy link
Collaborator Author

Comment by Amr Aboelela (JIRA)

@milseman I suspect it is the change we made in LibcShims.h:

#if defined(linux) && defined (arm) && !defined(ANDROID)

So now I am trying it like this:

#if defined(linux) && defined (arm) //&& !defined(ANDROID)

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jun 1, 2017

Comment by Amr Aboelela (JIRA)

Removing && !defined(ANDROID_) seems to be working fine. Should I create a PR with this change?

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jun 1, 2017

Comment by Amr Aboelela (JIRA)

Yes I confirm, it now builds correctly.

@milseman
Copy link
Mannequin

milseman mannequin commented Jun 1, 2017

I'm a little confused. What changed here that caused the breakage? I know we were careful about defining pthread_key_t earlier, but not sure why that would affect ssize_t.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jun 1, 2017

Comment by Amr Aboelela (JIRA)

Remember, we changed 2 lines, I am talking here about line 36 it used to be like this:
#if defined(linux) && defined (arm) && !defined(android)

all small letters, and because they use all caps, so ![](defined(android) was returning true. But now as we use all caps, )defined(ANDROID) is returning false for Android environment.

@milseman
Copy link
Mannequin

milseman mannequin commented Jun 1, 2017

I see, so it was a bug in the original guard, that is Android platform was not defining the lower case variant?

Do you have a PR?

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jun 1, 2017

Comment by Amr Aboelela (JIRA)

Not yet, do you want me to change it to:

#if defined(_linux) && defined (arm)

i.e. removing the && !defined(ANDROID_) part

@milseman
Copy link
Mannequin

milseman mannequin commented Jun 1, 2017

Yes, if that works.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jun 1, 2017

Comment by Amr Aboelela (JIRA)

@milseman I made a new pull request:
#10060

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jun 6, 2017

Comment by Amr Aboelela (JIRA)

This PR got merged so I am closing this issue.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Platform: Android bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant