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-11124] SwiftPM related tools failed to launch with error: libFoundation.so: cannot open shared object file: No such file or directory #3297

Closed
norio-nomura opened this issue Jul 13, 2019 · 8 comments
Assignees

Comments

@norio-nomura
Copy link
Contributor

Previous ID SR-11124
Radar rdar://problem/53104505
Original Reporter @norio-nomura
Type Bug
Status Closed
Resolution Done
Environment

swift-5.1-DEVELOPMENT-SNAPSHOT-2019-07-12-a on ubuntu 16.04

Additional Detail from JIRA
Votes 1
Component/s Foundation
Labels Bug
Assignee @compnerd
Priority Medium

md5: acc11d097e6ed549fd148a3906b9eb39

is duplicated by:

  • SR-11142 swift-build (at least) links libFoundation.so wrongly

Issue Description:

Reproducing steps:

$ docker run --rm --tty --interactive norionomura/swift:5120190712a
root@6f3055efc0ec:/# swift build --help
/usr/bin/swift-build: error while loading shared libraries: /home/buildnode/jenkins/workspace/oss-swift-5.1-package-linux-ubuntu-16_04/build/buildbot_linux/foundation-linux-x86_64/Foundation.dir/libFoundation.so: cannot open shared object file: No such file or directory
root@6f3055efc0ec:/# swift test --help
/usr/bin/swift-test: error while loading shared libraries: /home/buildnode/jenkins/workspace/oss-swift-5.1-package-linux-ubuntu-16_04/build/buildbot_linux/foundation-linux-x86_64/Foundation.dir/libFoundation.so: cannot open shared object file: No such file or directory
root@6f3055efc0ec:/# swift package --help
/usr/bin/swift-package: error while loading shared libraries: /home/buildnode/jenkins/workspace/oss-swift-5.1-package-linux-ubuntu-16_04/build/buildbot_linux/foundation-linux-x86_64/Foundation.dir/libFoundation.so: cannot open shared object file: No such file or directory
root@6f3055efc0ec:/# ldd $(which swift-build)
    linux-vdso.so.1 =>  (0x00007ffc91df2000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3120376000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f3120173000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f311ff6f000)
    libswiftCore.so => /usr/bin/../lib/swift/linux/libswiftCore.so (0x00007f311fa2d000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f311f724000)
    libswiftGlibc.so => /usr/bin/../lib/swift/linux/libswiftGlibc.so (0x00007f3120bb8000)
    /home/buildnode/jenkins/workspace/oss-swift-5.1-package-linux-ubuntu-16_04/build/buildbot_linux/foundation-linux-x86_64/Foundation.dir/libFoundation.so => not found
    libswiftDispatch.so => /usr/bin/../lib/swift/linux/libswiftDispatch.so (0x00007f3120b83000)
    libdispatch.so => /usr/bin/../lib/swift/linux/libdispatch.so (0x00007f3120b21000)
    libBlocksRuntime.so => /usr/bin/../lib/swift/linux/libBlocksRuntime.so (0x00007f311f521000)
    libllbuildSwift.so => /usr/bin/../lib/swift/pm/llbuild/libllbuildSwift.so (0x00007f3120b05000)
    libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f311f24d000)
    libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007f311f02b000)
    libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f311ee02000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f311ea80000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f311e86a000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f311e4a0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f31209ab000)
    libatomic.so.1 => /usr/lib/x86_64-linux-gnu/libatomic.so.1 (0x00007f311e298000)
    libicui18nswift.so.61 => /usr/bin/../lib/swift/linux/libicui18nswift.so.61 (0x00007f311ddac000)
    libicuucswift.so.61 => /usr/bin/../lib/swift/linux/libicuucswift.so.61 (0x00007f311d9d6000)
    libicudataswift.so.61 => /usr/bin/../lib/swift/linux/libicudataswift.so.61 (0x00007f311be31000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f311bc29000)
    /home/buildnode/jenkins/workspace/oss-swift-5.1-package-linux-ubuntu-16_04/build/buildbot_linux/foundation-linux-x86_64/Foundation.dir/libFoundation.so => not found
    libllbuild.so => /usr/bin/../lib/swift/pm/llbuild/libllbuild.so (0x00007f311b89f000)
@norio-nomura
Copy link
Contributor Author

Same with swift-DEVELOPMENT-SNAPSHOT-2019-07-13-a on ubuntu 16.04.

@ankitspd
Copy link
Member

@swift-ci create

@millenomi
Copy link
Contributor

cc @compnerd

@compnerd
Copy link
Collaborator

We now set `DT_SONAME` on the library properly (we were previously embedding the output name as the `DT_SONAME`. We also normalise the path now (that is `\` will be converted to `/`) which is important for cross-compilation from Windows to Android, but nothing else has changed here.

@ankitspd
Copy link
Member

#2415

@compnerd
Copy link
Collaborator

#2415
apple/swift-corelibs-libdispatch#504
apple/swift-corelibs-xctest#281

Should take care of the wrong path being embedded. CMake 3.15 can't come soon enough 🙁.

@kevints
Copy link
Mannequin

kevints mannequin commented Jul 16, 2019

@compnerd I noticed that I had to workaround a similar issue in CMake 3.15-rc1, in apple/swift-nio#1059 specifically here: https://github.com/apple/swift-nio/pull/1059/files#diff-af3b638bc2a3e6c650974192a53c7291R181, is there a better way to do it?

@norio-nomura
Copy link
Contributor Author

confirmed that this issue has been resolved on swift-5.1-DEVELOPMENT-SNAPSHOT-2019-07-17-a.
Thanks!

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

4 participants