File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -115,15 +115,13 @@ extension WebAssemblyToolchain {
115115 commandLine. appendPath ( path)
116116 }
117117
118- // Link the standard library.
119- let linkFilePath : VirtualPath = VirtualPath . lookup ( targetInfo. runtimeResourcePath. path)
120- . appending (
121- components: targetTriple. platformName ( ) ?? " " ,
122- " static-executable-args.lnk "
123- )
124-
118+ // Link the standard library and dependencies.
119+ let linkFilePath : VirtualPath =
120+ VirtualPath . lookup ( targetInfo. runtimeResourcePath. path)
121+ . appending ( components: targetTriple. platformName ( ) ?? " " ,
122+ " static-executable-args.lnk " )
125123 guard try fileSystem. exists ( linkFilePath) else {
126- fatalError ( " \( linkFilePath) not found " )
124+ throw Error . missingExternalDependency ( linkFilePath. name )
127125 }
128126 commandLine. append ( . responseFilePath( linkFilePath) )
129127
@@ -133,7 +131,7 @@ extension WebAssemblyToolchain {
133131 // Delegate to Clang for sanitizers. It will figure out the correct linker
134132 // options.
135133 guard sanitizers. isEmpty else {
136- fatalError ( " WebAssembly does not support sanitizers, but a runtime library was found " )
134+ throw Error . sanitizersUnsupportedForTarget ( targetTriple . triple )
137135 }
138136
139137 guard !parsedOptions. hasArgument ( . profileGenerate) else {
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public final class WebAssemblyToolchain: Toolchain {
2424 case dynamicLibrariesUnsupportedForTarget( String )
2525 case sanitizersUnsupportedForTarget( String )
2626 case profilingUnsupportedForTarget( String )
27+ case missingExternalDependency( String )
2728
2829 public var description : String {
2930 switch self {
@@ -35,6 +36,8 @@ public final class WebAssemblyToolchain: Toolchain {
3536 return " sanitizers are unsupported for target ' \( triple) ' "
3637 case . profilingUnsupportedForTarget( let triple) :
3738 return " profiling is unsupported for target ' \( triple) ' "
39+ case . missingExternalDependency( let dependency) :
40+ return " missing external dependency ' \( dependency) ' "
3841 }
3942 }
4043 }
You can’t perform that action at this time.
0 commit comments