Static linking an executable on CentOS

Hello! I've got into some errors when statically linking a project with FoundationXML and FoundationNetworking dependency on CentOS 7, Swift 5.4.1. What's the right way of static link?

/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function ___CFSetupXMLInterface_block_invoke: error: undefined reference to 'xmlInitParser'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function ___CFSetupXMLInterface_block_invoke: error: undefined reference to 'xmlGetExternalEntityLoader'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function ___CFSetupXMLInterface_block_invoke: error: undefined reference to 'xmlSetExternalEntityLoader'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceNoNetExternalEntityLoader: error: undefined reference to 'xmlNoNetExternalEntityLoader'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _errorCallback: error: undefined reference to 'xmlCtxtGetLastError'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceSetStructuredErrorFunc: error: undefined reference to 'xmlSetStructuredErrorFunc'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceCreatePushParserCtxt: error: undefined reference to 'xmlCreatePushParserCtxt'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceCtxtUseOptions: error: undefined reference to 'xmlCtxtUseOptions'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceParseChunk: error: undefined reference to 'xmlParseChunk'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceStopParser: error: undefined reference to 'xmlStopParser'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceDestroyContext: error: undefined reference to 'xmlFreeDoc'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceDestroyContext: error: undefined reference to 'xmlFreeParserCtxt'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceSAX2GetLineNumber: error: undefined reference to 'xmlSAX2GetLineNumber'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceSAX2GetColumnNumber: error: undefined reference to 'xmlSAX2GetColumnNumber'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceSAX2InternalSubset: error: undefined reference to 'xmlSAX2InternalSubset'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceSAX2ExternalSubset: error: undefined reference to 'xmlSAX2ExternalSubset'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceGetPredefinedEntity: error: undefined reference to 'xmlGetPredefinedEntity'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDTDNewElementDesc: error: undefined reference to 'xmlAddElementDecl'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDTDNewElementDesc: error: undefined reference to 'xmlNewDtd'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDTDNewElementDesc: error: undefined reference to 'xmlAddElementDecl'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDTDNewElementDesc: error: undefined reference to 'xmlFreeDtd'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlHashLookup'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlHashLookup'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlHashLookup3'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlHashRemoveEntry3'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlHashLookup'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlHashRemoveEntry'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlHashLookup'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlHashRemoveEntry'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlUnlinkNode'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLUnlinkNode: error: undefined reference to 'xmlHashRemoveEntry'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDTDNewAttributeDesc: error: undefined reference to 'xmlAddAttributeDecl'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDTDNewAttributeDesc: error: undefined reference to 'xmlNewDtd'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDTDNewAttributeDesc: error: undefined reference to 'xmlAddAttributeDecl'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDTDNewAttributeDesc: error: undefined reference to 'xmlFreeDtd'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceSAX2GetEntity: error: undefined reference to 'xmlSAX2GetEntity'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceFreeEnumeration: error: undefined reference to 'xmlFreeEnumeration'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLInterfaceSAX2UnparsedEntityDecl: error: undefined reference to 'xmlSAX2UnparsedEntityDecl'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewNode: error: undefined reference to 'xmlNewNode'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLCopyNode: error: undefined reference to 'xmlCopyDoc'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLCopyNode: error: undefined reference to 'xmlCopyDtd'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLCopyNode: error: undefined reference to 'xmlCopyNode'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewDoc: error: undefined reference to 'xmlNewDoc'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewProcessingInstruction: error: undefined reference to 'xmlNewPI'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewTextNode: error: undefined reference to 'xmlNewText'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewComment: error: undefined reference to 'xmlNewComment'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewProperty: error: undefined reference to 'xmlSplitQName2'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewProperty: error: undefined reference to 'xmlNewProp'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewProperty: error: undefined reference to 'xmlNewNs'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewProperty: error: undefined reference to 'xmlNewNsProp'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewProperty: error: undefined reference to 'xmlFree'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNewProperty: error: undefined reference to 'xmlFree'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetURI: error: undefined reference to 'xmlSearchNsByHref'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetURI: error: undefined reference to 'xmlNewNs'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetURI: error: undefined reference to 'xmlSetNs'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetURI: error: undefined reference to 'xmlFree'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetURI: error: undefined reference to 'xmlStrdup'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetURI: error: undefined reference to 'xmlFree'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetURI: error: undefined reference to 'xmlStrdup'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeCopyName: error: undefined reference to 'xmlBuildQName'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeForceSetName: error: undefined reference to 'xmlStrdup'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetName: error: undefined reference to 'xmlNodeSetName'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeNameEqual: error: undefined reference to 'xmlStrcmp'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeCopyContent: error: undefined reference to 'xmlSnprintfElementContent'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeCopyContent: error: undefined reference to 'xmlNodeGetContent'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetContent: error: undefined reference to 'xmlFreeDocElementContent'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetContent: error: undefined reference to 'xmlRegFreeRegexp'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetContent: error: undefined reference to 'xmlFreeDocElementContent'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeSetContent: error: undefined reference to 'xmlNodeSetContent'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLParseDTDNode: error: undefined reference to 'xmlStrlen'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLParseDTDNode: error: undefined reference to 'xmlParserInputBufferCreateMem'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLParseDTDNode: error: undefined reference to 'xmlIOParseDTD'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLParseDTDNode: error: undefined reference to 'xmlUnlinkNode'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLParseDTDNode: error: undefined reference to 'xmlHashScan'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLFreeNode: error: undefined reference to 'xmlFreeNode'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLFreeNode: error: undefined reference to 'xmlUnlinkNode'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLFreeNode: error: undefined reference to 'xmlFreeEnumeration'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLFreeNode: error: undefined reference to 'xmlDictOwns'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLFreeNode: error: undefined reference to 'xmlDictOwns'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLFreeNode: error: undefined reference to 'xmlDictOwns'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLFreeNode: error: undefined reference to 'xmlDictOwns'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLEncodeEntities: error: undefined reference to 'xmlEncodeEntitiesReentrant'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDocRootElement: error: undefined reference to 'xmlDocGetRootElement'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDocSetRootElement: error: undefined reference to 'xmlDocSetRootElement'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDocSetCharacterEncoding: error: undefined reference to 'xmlStrdup'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDocDTD: error: undefined reference to 'xmlGetIntSubset'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDocSetDTD: error: undefined reference to 'xmlAddPrevSibling'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLDocSetDTD: error: undefined reference to 'xmlAddChild'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeGetElementChildCount: error: undefined reference to 'xmlChildElementCount'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeAddChild: error: undefined reference to 'xmlAddChild'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeAddPrevSibling: error: undefined reference to 'xmlAddPrevSibling'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeAddNextSibling: error: undefined reference to 'xmlAddNextSibling'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLNodeReplaceNode: error: undefined reference to 'xmlReplaceNode'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLGetDocEntity: error: undefined reference to 'xmlGetDocEntity'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLGetDTDEntity: error: undefined reference to 'xmlGetDtdEntity'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLGetParameterEntity: error: undefined reference to 'xmlGetParameterEntity'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLCopyStringWithOptions: error: undefined reference to 'xmlBufferCreate'
/usr/lib/swift_static/linux/libCFXMLInterface.a(CFXMLInterface.c.o):CFXMLInterface.c:function _CFXMLCopyStringWithOptions: error: undefined reference to 'xmlSaveToBuffer'
(stripped)
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC03rawE0Svvpfi: error: undefined reference to 'CFURLSessionMultiHandleInit'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC13configuration9workQueueAeC14_ConfigurationV_8Dispatch0jH0CtcfC: error: undefined reference to 'CFURLSessionMultiHandleInit'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC13configuration9workQueueAeC14_ConfigurationV_8Dispatch0jH0CtcfC: error: undefined reference to 'CFURLSessionMultiOptionPIPELINING'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC13configuration9workQueueAeC14_ConfigurationV_8Dispatch0jH0CtcfC: error: undefined reference to 'CFURLSession_multi_setopt_l'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC13configuration9workQueueAeC14_ConfigurationV_8Dispatch0jH0CtcfC: error: undefined reference to 'CFURLSessionMultiCodeOK'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC13configuration9workQueueAeC14_ConfigurationV_8Dispatch0jH0Ctcfc: error: undefined reference to 'CFURLSessionMultiHandleInit'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC13configuration9workQueueAeC14_ConfigurationV_8Dispatch0jH0Ctcfc: error: undefined reference to 'CFURLSessionMultiOptionPIPELINING'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC13configuration9workQueueAeC14_ConfigurationV_8Dispatch0jH0Ctcfc: error: undefined reference to 'CFURLSession_multi_setopt_l'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC13configuration9workQueueAeC14_ConfigurationV_8Dispatch0jH0Ctcfc: error: undefined reference to 'CFURLSessionMultiCodeOK'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC14setupCallbacks33_76FB65EF45BDE9115477B690E87F5E28LLyyF: error: undefined reference to 'CFURLSessionMultiOptionSOCKETDATA'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC14setupCallbacks33_76FB65EF45BDE9115477B690E87F5E28LLyyF: error: undefined reference to 'CFURLSession_multi_setopt_ptr'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC14setupCallbacks33_76FB65EF45BDE9115477B690E87F5E28LLyyF: error: undefined reference to 'CFURLSessionMultiCodeOK'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC14setupCallbacks33_76FB65EF45BDE9115477B690E87F5E28LLyyF: error: undefined reference to 'CFURLSessionMultiOptionSOCKETFUNCTION'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC14setupCallbacks33_76FB65EF45BDE9115477B690E87F5E28LLyyF: error: undefined reference to 'CFURLSession_multi_setopt_sf'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC14setupCallbacks33_76FB65EF45BDE9115477B690E87F5E28LLyyF: error: undefined reference to 'CFURLSessionMultiOptionTIMERDATA'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC14setupCallbacks33_76FB65EF45BDE9115477B690E87F5E28LLyyF: error: undefined reference to 'CFURLSession_multi_setopt_ptr'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC14setupCallbacks33_76FB65EF45BDE9115477B690E87F5E28LLyyF: error: undefined reference to 'CFURLSessionMultiOptionTIMERFUNCTION'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC14setupCallbacks33_76FB65EF45BDE9115477B690E87F5E28LLyyF: error: undefined reference to 'CFURLSession_multi_setopt_tf'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC9configure4withyAC14_ConfigurationV_tF: error: undefined reference to 'CFURLSessionMultiOptionPIPELINING'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC9configure4withyAC14_ConfigurationV_tF: error: undefined reference to 'CFURLSession_multi_setopt_l'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC9configure4withyAC14_ConfigurationV_tF: error: undefined reference to 'CFURLSessionMultiCodeOK'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleCfd: error: undefined reference to 'CFURLSessionMultiHandleRemoveHandle'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleCfd: error: undefined reference to 'CFURLSessionMultiHandleRemoveHandle'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleCfd: error: undefined reference to 'CFURLSessionMultiHandleDeinit'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC3addyyAA05_EasyE0CF: error: undefined reference to 'CFURLSessionMultiHandleAddHandle'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC3addyyAA05_EasyE0CF: error: undefined reference to 'CFURLSessionSocketTimeout'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC6removeyyAA05_EasyE0CF: error: undefined reference to 'CFURLSessionMultiHandleRemoveHandle'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionMultiHandleAction'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionMultiHandleInfoRead'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeOK'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeUNSUPPORTED_PROTOCOL'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeURL_MALFORMAT'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeCOULDNT_RESOLVE_HOST'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeRECV_ERROR'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeSEND_ERROR'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeGOT_NOTHING'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeABORTED_BY_CALLBACK'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeCOULDNT_CONNECT'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeOPERATION_TIMEDOUT'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionMultiHandleInfoRead'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC25readAndWriteAvailableData33_76FB65EF45BDE9115477B690E87F5E28LL2onys5Int32V_tKF: error: undefined reference to 'CFURLSessionEasyCodeDescription'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC8register33_76FB65EF45BDE9115477B690E87F5E28LL6socket3for4what0N9SourcePtrs5Int32VAM_SvAMSvSgtFTf4ndnnn_n: error: undefined reference to 'CFURLSessionPollNone'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC8register33_76FB65EF45BDE9115477B690E87F5E28LL6socket3for4what0N9SourcePtrs5Int32VAM_SvAMSvSgtFTf4ndnnn_n: error: undefined reference to 'CFURLSessionPollIn'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC8register33_76FB65EF45BDE9115477B690E87F5E28LL6socket3for4what0N9SourcePtrs5Int32VAM_SvAMSvSgtFTf4ndnnn_n: error: undefined reference to 'CFURLSessionPollOut'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC8register33_76FB65EF45BDE9115477B690E87F5E28LL6socket3for4what0N9SourcePtrs5Int32VAM_SvAMSvSgtFTf4ndnnn_n: error: undefined reference to 'CFURLSessionPollInOut'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC8register33_76FB65EF45BDE9115477B690E87F5E28LL6socket3for4what0N9SourcePtrs5Int32VAM_SvAMSvSgtFTf4ndnnn_n: error: undefined reference to 'CFURLSessionPollRemove'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC8register33_76FB65EF45BDE9115477B690E87F5E28LL6socket3for4what0N9SourcePtrs5Int32VAM_SvAMSvSgtFTf4ndnnn_n: error: undefined reference to 'CFURLSessionMultiHandleAssign'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC18updateTimeoutTimer33_76FB65EF45BDE9115477B690E87F5E28LL2toyAE01_G0AGLLO_tFyycfU0_TA: error: undefined reference to 'CFURLSessionSocketTimeout'
/usr/lib/swift_static/linux/libFoundationNetworking.a(MultiHandle.swift.o):MultiHandle.swift.o:function $s20FoundationNetworking10URLSessionC12_MultiHandleC18updateTimeoutTimer33_76FB65EF45BDE9115477B690E87F5E28LL2toyAE01_G0AGLLO_tFyycfU_TA: error: undefined reference to 'CFURLSessionSocketTimeout'
/usr/lib/swift_static/linux/libFoundationNetworking.a(libcurlHelpers.swift.o):libcurlHelpers.swift.o:function $s20FoundationNetworking17initializeLibcurlyyF: error: undefined reference to 'CFURLSessionInit'
/usr/lib/swift_static/linux/libFoundationNetworking.a(BodySource.swift.o):BodySource.swift.o:function $s20FoundationNetworking15_BodyFileSourceC13readNextChunk33_4778345EAE5363022BCB039E4AF7D195LLyyF: error: undefined reference to 'CFURLSessionMaxWriteSize'
(stripped)

The source code is under the Examples/CloudFunctions directory of stevapple/swift-tencent-scf-runtime which is a fork of SwiftAWSLambdaRuntime. You can use scripts/build-and-package.sh CurrencyExchange to build it in a Docker image of CentOS 7.7 with Swift 5.4.1.

Linker settings:

.linkedLibrary("idn"),
.linkedLibrary("ssh2"),
.linkedLibrary("ssl3"),
.linkedLibrary("smime3"),
.linkedLibrary("nss3"),
.linkedLibrary("nssutil3"),
.linkedLibrary("plds4"),
.linkedLibrary("plc4"),
.linkedLibrary("nspr4"),
.linkedLibrary("gssapi_krb5"),
.linkedLibrary("krb5"),
.linkedLibrary("k5crypto"),
.linkedLibrary("com_err"),
.linkedLibrary("lber"),
.linkedLibrary("ldap"),
.linkedLibrary("z")

swift-build command:

swift build --product CurrencyExchange -c release -Xswiftc -static-executable

Actual swift command:

/usr/bin/swiftc -g -L /workspace/Examples/CloudFunctions/.build/x86_64-unknown-linux-gnu/release -o /workspace/Examples/CloudFunctions/.build/x86_64-unknown-linux-gnu/release/CurrencyExchange -module-name CurrencyExchange -emit-executable -Xlinker '-rpath=$ORIGIN' @/workspace/Examples/CloudFunctions/.build/x86_64-unknown-linux-gnu/release/CurrencyExchange.product/Objects.LinkFileList -target x86_64-unknown-linux-gnu -lidn -lssh2 -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -llber -lldap -lz -static-executable -L /usr/lib

"Not found"s:

/usr/bin/ld.gold: error: cannot find -lxml2
/usr/bin/ld.gold: error: cannot find -lidn
/usr/bin/ld.gold: error: cannot find -lssh2
/usr/bin/ld.gold: error: cannot find -lssl3
/usr/bin/ld.gold: error: cannot find -lsmime3
/usr/bin/ld.gold: error: cannot find -lnss3
/usr/bin/ld.gold: error: cannot find -lnssutil3
/usr/bin/ld.gold: error: cannot find -lplds4
/usr/bin/ld.gold: error: cannot find -lplc4
/usr/bin/ld.gold: error: cannot find -lnspr4
/usr/bin/ld.gold: error: cannot find -lgssapi_krb5
/usr/bin/ld.gold: error: cannot find -lkrb5
/usr/bin/ld.gold: error: cannot find -lk5crypto
/usr/bin/ld.gold: error: cannot find -lcom_err
/usr/bin/ld.gold: error: cannot find -llber
/usr/bin/ld.gold: error: cannot find -lldap
/usr/bin/ld.gold: error: cannot find -lz

Trivial question, do you have those static libraries installed? On Fedora Core 33, I see this, which you shouldn't:

> dnf list --installed libxml2-static
Error: No matching Packages to list

If you have them, try running SPM with the flags -v -Xswiftc -v appended, which will show you the failing linker command.

Terms of Service

Privacy Policy

Cookie Policy