Skip to content

[SR-359] Undef. symbols when linking to Foundation (ARM) #4199

@hpux735

Description

@hpux735
Previous ID SR-359
Radar None
Original Reporter @hpux735
Type Sub-task
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Foundation, Standard Library
Labels Sub-task, Linux, arm, armhf
Assignee @hpux735
Priority Medium

md5: d10c8c3be55a3b67735aede67f24479b

Parent-Task:

  • SR-40 Port Swift to Linux on Raspberry Pi

Issue Description:

Applications linking to Framework on Linux-ARM fail to link. There are (at least) three undefined symbols:

{{wdillon@tegra-ubuntu:~$ swiftc frameworkTest.swift
/opt/apple/usr/lib/swift/linux/libFoundation.so: undefined reference to `TTSf4s_s_s_nTFs18_fatalErrorMessageFTVs12StaticStringS_S_Su_T*'
/opt/apple/usr/lib/swift/linux/libFoundation.so: undefined reference to `_TFVs13_StringBufferg9usedCountSi'
/opt/apple/usr/lib/swift/linux/libFoundation.so: undefined reference to `TTSf4sTFVs11_StringCore15_invariantCheckfT_T*'
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)
wdillon@tegra-ubuntu:~$
}}

The demangled references all seem to call back into string:

function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Exploded> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> ()
Swift._StringBuffer.usedCount.getter : Swift.Int
function signature specialization <Arg[0] = Exploded> of Swift._StringCore._invariantCheck () -> ()

Swift._fatalErrorMessage() exists in stdlib/public/core/AssertCommon.swift
The comment in the implementation of _fatalErrorMessage says that it should not be used outside of the implementation of stdlib. It's not clear why foundation would be referencing it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions