Skip to content

[SR-730] Flag to statically link Swift standard library #43345

Closed
@drewcrawford

Description

@drewcrawford
Previous ID SR-730
Radar None
Original Reporter @drewcrawford
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a

Additional Detail from JIRA
Votes 6
Component/s Compiler
Labels Bug, Driver
Assignee @drewcrawford
Priority Medium

md5: 750294aa83c3f055bad270719f53d070

relates to:

  • SR-648 swift package manager should have the option to produce statically linked binaries
  • SR-2280 swiftc -static-stdlib option fails on Ubuntu 14.04 & 15.10
  • SR-727 (emscripten support) Compile Swift code with statically linked stdlib
  • SR-9821 Swift Static Standard Library is being treated as private api

Issue Description:

If I build an executable with swiftc:

$ swiftc test.swift

Then I find out the Swift standard library was dynamically linked:

$ otool -L test
@rpath/libswiftCore.dylib (compatibility version 0.0.0, current version 0.0.0)

However, the binary distributions also have a static version that I didn't use:

/Library/Developer/Toolchains/swift-latest.xctoolchain//usr/lib/swift_static/macosx/libswiftCore.a

I want to pass e.g. -static-stdlib to swiftc to compile a program that is statically linked with the Swift standard library.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselflegacy driverArea → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions