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-333] Compiling hello world fails on ARM Linux #42955

Closed
swift-ci opened this issue Dec 21, 2015 · 11 comments
Closed

[SR-333] Compiling hello world fails on ARM Linux #42955

swift-ci opened this issue Dec 21, 2015 · 11 comments

Comments

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Dec 21, 2015

Previous ID SR-333
Radar None
Original Reporter petevine (JIRA User)
Type Bug
Status Closed
Resolution Done

Attachment: Download

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

md5: 8ff97b9aced2c6f08860f237251b7348

duplicates:

  • SR-23 Build fails on Ubuntu 14.04.1 -> error: opening ... 'SwiftShims': No such file

Issue Description:

Using an unofficial ARM distribution from here I'm getting:

swiftc hello.swift
<unknown>:0: error: opening import file for module 'SwiftShims': No such file or directory

@hpux735
Copy link
Contributor

@hpux735 hpux735 commented Dec 22, 2015

There are a few things to try if you wouldn't mind. Could you make sure that all the pre-requisites from the swift compilation readme are installed:

{{
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config
}}

Also, this part is really important:

{{
sudo apt-get install clang-3.6
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 100
}}
Make sure that you can run clang++ from the command line.

I installed swift on a fresh install of Ubuntu 14.04 on a Tegra TK1 into /opt/apple, and it worked once I installed all those packages. The bit about clang++ tripped me up at first.

If these don't work for you, I'll need to get more information about your system to figure out what might be different.

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Dec 22, 2015

Comment by PeteVine (JIRA)

I'd needed clang before so yes I've got clang installed and symlinked. (clang++ as well)

Some more info and strace:

swiftc -v hello.swift 
Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift f089509539)
Target: armv7-unknown-linux-gnueabihf
/home/odroid/swift/usr/bin/swift -frontend -c -primary-file hello.swift -target armv7-unknown-linux-gnueabihf -disable-objc-interop -color-diagnostics -module-name hello -o /tmp/hello-3bfb0e.o

SwiftShims is being created in :

/tmp/org.llvm.clang.odroid/ModuleCache/13ZB8KO/SwiftShims-GBDR64.pcm

My guess is some search paths were hardcoded in your build so it doesn't work here. I'm new to swift's command line and have no idea which options could be fixing this.

Have a look at the attached strace.
swift.trace

@hpux735
Copy link
Contributor

@hpux735 hpux735 commented Dec 23, 2015

Is this a duplicate of SR-23?

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Dec 23, 2015

Comment by PeteVine (JIRA)

Looks like the same problem but over there it's happening during the build process itself. That should provide a clue as runtime requirements are much simpler - probably pointing at clang again...

@hpux735
Copy link
Contributor

@hpux735 hpux735 commented Jan 9, 2016

Someone else mentioned this issue using a raspi version 2. In an effort to reproduce the bug, I bought one and installed a fresh image of raspian. I documented my process here:

http://www.housedillon.com/?p=2293

I wasn't able to reproduce this bug.

Would you mind replying with your exact environment (device, distribution, clang version, method for getting swift, etc.)?

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Jan 9, 2016

Comment by Félix Lapalme (JIRA)

I have that exact same bug and I downloaded the version from your website (I used the option 1).
Here's some info about my Pi:

pi@raspberrypi ~ $ uname -a
Linux raspberrypi 4.1.6-v7+ #&#8203;810 SMP PREEMPT Tue Aug 18 15:32:12 BST 2015 armv7l
 GNU/Linux
pi@raspberrypi ~ $ clang --version
Debian clang version 3.8.0-svn250696-1 (trunk) (based on LLVM 3.8.0)
Target: arm-unknown-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/local/bin
pi@raspberrypi ~ $ lsb_release -da
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.0 (wheezy)
Release:        7.0
Codename:       wheezy
pi@raspberrypi ~ $

If you want to, I could give you remote access to my Pi.

What version of Raspbian is your Pi running ?

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Jan 9, 2016

Comment by PeteVine (JIRA)

@@hpux735

If I were you I'd start by tracking down the exact condition in the source that triggers the error. Possibly clang's source.

Maybe it's simply a case of certain hardcoded paths which is why it works on some distributions.

@hpux735
Copy link
Contributor

@hpux735 hpux735 commented Jan 9, 2016

petevine (JIRA User) Because I can't reproduce this bug, it is very low priority. I have a lot on my plate trying to get the support that is there into swift 2.2, then I have a bigger project with tienex on my plate. You're encouraged to investigate if you'd like.

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Jan 9, 2016

Comment by PeteVine (JIRA)

I completely forgot about swift so those were just some parting remarks. Good luck!

@hpux735
Copy link
Contributor

@hpux735 hpux735 commented Jan 16, 2016

Darren Mo made some excellent progress on what I suspect is a duplicate of this:

https://bugs.swift.org/browse/SR-23

I've had good luck with the Raspian Jessie Light distribution, if you would like to see if that helps.

https://www.raspberrypi.org/downloads/raspbian/

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Jan 23, 2018

Comment by Umberto Raimondi (JIRA)

Old bug, Swift 3.x works correctly on armv6 and armv7 SBCs.

@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
Projects
None yet
Development

No branches or pull requests

2 participants