diff --git a/build.ps1 b/build.ps1 index 66490c1..ab0a194 100644 --- a/build.ps1 +++ b/build.ps1 @@ -156,9 +156,19 @@ function Invoke-Swift([string[]]$SwiftArgs, [hashtable]$Sql) { # depends on clang honouring CPATH โ€” if it didn't, the failure would be an inscrutable # "'sqlite3.h' file not found" from inside GRDB's module build. -Xlinker only matters # when something actually links (tests, executables); a library build needs just the -I. + # + # TEMPORARY โ€” /FORCE:MULTIPLE (docs/WINDOWS_PORT.md ยง14.1.1). swift-crypto's + # CCryptoBoringSSL and swift-nio-ssl's CNIOBoringSSL both land in every Windows link, and + # `p_thread_callback_boringssl` (crypto/thread_win.cc) collides between them: BoringSSL's + # prefix maps are generated by building on a POSIX host, so symbols from the Windows-only + # translation units are never prefixed. The same pair links clean on Linux, where the + # equivalent file is thread_pthread.c and IS prefixed. Drop this flag the moment one copy + # carries the prefix โ€” it is global, so it also downgrades any FUTURE duplicate to a + # warning. Read the warnings. $full = @($SwiftArgs) + @( '-Xcc', "-I$($Sql.Include)", - '-Xlinker', "-LIBPATH:$($Sql.Lib)") + '-Xlinker', "-LIBPATH:$($Sql.Lib)", + '-Xlinker', '/FORCE:MULTIPLE') Write-Note "swift $($full -join ' ')" # Out-Host, not the pipeline: a native command's stdout would otherwise become this # function's return value, and the caller's exit-code check would see an array.