Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Swift 5.0 Raspbian linker fail #28

Open
AleyRobotics opened this issue Apr 8, 2020 · 4 comments
Open

Swift 5.0 Raspbian linker fail #28

AleyRobotics opened this issue Apr 8, 2020 · 4 comments

Comments

@AleyRobotics
Copy link

Swift version 5.0 (swift-5.0-RELEASE)
Target: armv6-unknown-linux-gnueabihf

linker LOG:

$ swift build -c release -Xswiftc -g -v
which clang
/usr/local/bin/swiftc -sdk / -g -L /home/pi/Swish/ProjectFolder/.build/armv6-unknown-linux-gnueabihf/debug -o /home/pi/Swish/ProjectFolder/.build/armv6-unknown-linux-gnueabihf/debug/ProjectFolder -module-name Project -emit-executable -Xlinker '-rpath=$ORIGIN' @/home/pi/Swish/ProjectFolder/.build/armv6-unknown-linux-gnueabihf/debug/ProjectFolder/Objects.LinkFileList
/home/pi/Swish/ProjectFolder/.build/checkouts/swift-backtrace/Sources/CBacktrace/backtrace.c:75: error: undefined reference to '_Unwind_GetIPInfo'
/home/pi/Swish/ProjectFolder/.build/checkouts/swift-backtrace/Sources/CBacktrace/simple.c:70: error: undefined reference to '_Unwind_GetIPInfo'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
@weissi
Copy link
Collaborator

weissi commented Apr 9, 2020

@AleyRobotics could you try adding a -Xswiftc -lunwind to the command line? And do you have libunwind installed?

@picnicbob
Copy link

@weissi I'm working through the same issue on a Raspberry Pi 4. I was able to install libunwind8 but get:
/usr/bin/ld.gold: error: cannot find -lunwind

@picnicbob
Copy link

picnicbob commented Jun 2, 2021

I can build without -Xswiftc -lunwind by commenting out #define HAVE_GETIPINFO 1, but then when there's something to report it calls an illegal instruction:
Current stack trace:
Illegal instruction

@picnicbob
Copy link

This is the output of swift test at 54a65d6 with #define HAVE_GETIPINFO 1 commented out. Should I see a stack trace?

dan@pi4:~/swift-backtrace $ swift test
[5/5] Linking swift-backtracePackageTests.xctest
Test Suite 'All tests' started at 2021-06-02 13:38:15.549
Test Suite 'debug.xctest' started at 2021-06-02 13:38:15.552
Test Suite 'BacktraceTests' started at 2021-06-02 13:38:15.553
Test Case 'BacktraceTests.testBacktrace' started at 2021-06-02 13:38:15.553
Fatal error: 9053EA13-E81B-44CB-B892-864CD6C72724: file /home/dan/swift-backtrace/Sources/Sample/main.swift, line 19
Current stack trace:

Test Case 'BacktraceTests.testBacktrace' passed (0.509 seconds)
Test Suite 'BacktraceTests' passed at 2021-06-02 13:38:16.062
Executed 1 test, with 0 failures (0 unexpected) in 0.509 (0.509) seconds
Test Suite 'debug.xctest' passed at 2021-06-02 13:38:16.063
Executed 1 test, with 0 failures (0 unexpected) in 0.509 (0.509) seconds
Test Suite 'All tests' passed at 2021-06-02 13:38:16.063
Executed 1 test, with 0 failures (0 unexpected) in 0.509 (0.509) second

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants