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-9821] Swift Static Standard Library is being treated as private api #52238

swift-ci opened this issue Jan 31, 2019 · 1 comment

[SR-9821] Swift Static Standard Library is being treated as private api #52238

swift-ci opened this issue Jan 31, 2019 · 1 comment


Copy link

@swift-ci swift-ci commented Jan 31, 2019

Previous ID SR-9821
Radar None
Original Reporter KarosLi (JIRA User)
Type Bug
Status Resolved
Resolution Invalid

Xcode 10.1

Swift 4.2

Mac OS 10.14

Additional Detail from JIRA
Votes 0
Labels Bug
Assignee None
Priority Medium

md5: 8a8e795235bb7f1b9ab39ca22458b87d

relates to:

  • SR-730 Flag to statically link Swift standard library

Issue Description:

Since Xcode 10 with swift 4.2 support swift static standard library, so I try it in my oc&swift mix project. And everything is ok in my debug and testing phase. But once I upload I to apple connect, it will give me following issue:

Non-public API usage:
  •  The app references non-public symbols in LeoaoApp: __NSGetMachExecuteHeader, _unorm2_getNFCInstance, _unorm2_hasBoundaryBefore, _unorm2_normalize, _unorm2_spanQuickCheckYes

But if I upload build by using swift dynamic standard library, I can upload build successfully.

So I use nm tool to check which library contains these symbol.

nm -u /Applications/ >> symbols.txt

I found that libswiftCore.a contains these private api.

         U __NSGetMachExecuteHeader
         U _u_hasBinaryProperty
         U _u_isdefined
         U _ubrk_close
         U _ubrk_following
         U _ubrk_open
         U _ubrk_preceding
         U _ubrk_setText
         U _unorm2_getNFCInstance
         U _unorm2_hasBoundaryBefore
         U _unorm2_normalize
         U _unorm2_spanQuickCheckYes

Continue, I try to print libswiftCore.dyld symbols. The dynamic symbols also contains these private api.

nm -u /Applications/ >> dynamicsymbols.txt
_unorm2_getNFCInstance _unorm2_hasBoundaryBefore _unorm2_normalize _unorm2_spanQuickCheckYes

So I don't know why apple treat swift static standard library as a private api not swift dynamic standard library. Could any one help me to know this? Very thanks.

Following is my steps for to involve it:

1. add swift static standard library path to library search path.


2. add force_load to other link flags. It will make my swift code link to swift static standard library.

  1. add libc++.tbd to link library in build phase.

  2. set Always Embed Swift Standard Libraries to NO. Because we don't need swift dynamic swift standard library any more. If you still set it to YES, the apple connect process will give the following error

Invalid Swift Support - The SwiftSupport folder is empty. Rebuild your app using the current public (GM) version of Xcode and resubmit it. 
Copy link

@belkadan belkadan commented Jan 31, 2019

Hi, Karos. The static standard libraries are not supported for iOS (for various reasons, not just this); it is a mistake that they were shipped at all. Sorry for the trouble.

For future issues with the App Store, please file at; the Swift Open Source project usually doesn't have control over these things.

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

No branches or pull requests

2 participants