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-6262] swiftc error when importing Foundation when target is android #48812

Open
swift-ci opened this issue Oct 31, 2017 · 1 comment
Open
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-6262
Radar None
Original Reporter amraboelela (JIRA User)
Type Bug
Environment

using swift-android-toolchain

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Android
Assignee None
Priority Medium

md5: c125156b40eca36aa250b4289324dca3

Issue Description:

ran:

$SWIFT_PATH/swift-android-toolchain/usr/bin/swiftc \
-v \
-tools-directory ${ANDROID_NDK_PATH}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/bin \
-target armv7-none-linux-androideabi \
-sdk ${ANDROID_NDK_PATH}/platforms/android-21/arch-arm \
-L ${ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a \
-L ${ANDROID_NDK_PATH}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x \
-emit-library -o .build/armv7-none-linux-androideabi/debug/libSwiftLevelDB.so \
Sources/NSObject.swift

got:

Swift version 4.1-dev (LLVM a85c7fe628, Clang 12a3c42f5f, Swift 65f81dfe88)
Target: armv7-none-linux-android
/home/amr/swift/swift-android-toolchain/usr/bin/swift -frontend -c -primary-file Sources/NSObject.swift -target armv7-none-linux-android -disable-objc-interop -sdk /home/amr/android/android-ndk-r14b/platforms/android-21/arch-arm -color-diagnostics -parse-as-library -module-name SwiftLevelDB -o /tmp/NSObject-8f5c4e.o
swift: /home/amr/swift/llvm/tools/clang/lib/Serialization/ASTWriter.cpp:5413: DeclID clang::ASTWriter::getDeclID(const clang::Decl *): Assertion `DeclIDs.find(D) ![](= DeclIDs.end() && "Declaration not emitted)"' failed.
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x3ebcb74]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x3ebceb6]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f1355bde390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f1354103428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f135410502a]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7f13540fbbd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f13540fbc82]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x32fa6d9]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x32f648d]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x3308cff]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x33056bc]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x33485ca]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x2f9ca7c]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x3124935]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x2f594d8]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x2f19ce1]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x2f23cf0]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x3e4ce21]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x3e4cf64]
/home/amr/swift/swift-android-toolchain/usr/bin/swift[0x3ebe32a]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f1355bd46ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f13541d53dd]
Stack dump:
0. <eof> parser at end of file
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)

@swift-ci
Copy link
Collaborator Author

Comment by Pop Flamingo (JIRA)

I have the same issue on Linux Ubuntu 18.04 when trying to use a C library (SDL 2) with SPM

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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