Skip to content

Commit 696a503

Browse files
authored
Merge pull request #3557 from swiftwasm/main
[pull] swiftwasm from main
2 parents 2a9bad9 + 17d3335 commit 696a503

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

docs/WindowsBuild.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ cmake -B "S:\b\1" ^
122122
-C S:\swift\cmake\caches\Windows-x86_64.cmake ^
123123
-D CMAKE_BUILD_TYPE=Release ^
124124
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
125+
-D CMAKE_C_COMPILER=cl ^
126+
-D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" ^
127+
-D CMAKE_CXX_COMPILER=cl ^
128+
-D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^
129+
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
130+
-D CMAKE_MT=mt ^
131+
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
125132
-D LLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-windows-msvc ^
126133
-D LLVM_ENABLE_PDB=YES ^
127134
-D LLVM_EXTERNAL_CMARK_SOURCE_DIR=S:\cmark ^
@@ -154,6 +161,7 @@ cmake -B S:\b\2 ^
154161
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
155162
-D CMAKE_C_COMPILER=S:/b/1/bin/clang-cl.exe ^
156163
-D CMAKE_CXX_COMPILER=S:/b/1/bin/clang-cl.exe ^
164+
-D CMAKE_MT=mt ^
157165
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
158166
-D ENABLE_SWIFT=YES ^
159167
-G Ninja ^
@@ -175,6 +183,7 @@ cmake -B S:\b\3 ^
175183
-D CMAKE_BUILD_TYPE=RelWithDebInfo ^
176184
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
177185
-D CMAKE_C_COMPILER=S:/b/1/bin/clang-cl.exe ^
186+
-D CMAKE_MT=mt ^
178187
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
179188
-D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" ^
180189
-D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" ^
@@ -204,6 +213,7 @@ path S:\b\3\bin;%PATH%
204213
cmake -B S:\b\4 ^
205214
-D CMAKE_BUILD_TYPE=RelWithDebInfo ^
206215
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
216+
-D CMAKE_MT=mt ^
207217
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
208218
-D dispatch_DIR=S:\b\2\cmake\modules ^
209219
-D Foundation_DIR=S:\b\3\cmake\modules ^
@@ -234,6 +244,7 @@ cmake -B S:\b\3 ^
234244
-D CMAKE_BUILD_TYPE=RelWithDebInfo ^
235245
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
236246
-D CMAKE_C_COMPILER=S:/b/1/bin/clang-cl.exe ^
247+
-D CMAKE_MT=mt ^
237248
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
238249
-D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" ^
239250
-D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" ^
@@ -242,6 +253,7 @@ cmake -B S:\b\3 ^
242253
-D ICU_UC_LIBRARY_RELEASE=S:\Library\icu-67\usr\lib\icuuc67.lib ^
243254
-D LIBXML2_LIBRARY=S:\Library\libxml2-development\usr\lib\libxml2s.lib ^
244255
-D LIBXML2_INCLUDE_DIR=S:\Library\libxml2-development\usr\include\libxml2 ^
256+
-D LIBXML2_DEFINITIONS="/DLIBXML_STATIC" ^
245257
-D ENABLE_TESTING=YES ^
246258
-D dispatch_DIR=S:\b\2\cmake\modules ^
247259
-D XCTest_DIR=S:\b\4\cmake\modules ^
@@ -284,8 +296,9 @@ cmake -B S:\b\6 ^
284296
-D CMAKE_BUILD_TYPE=RelWithDebInfo ^
285297
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
286298
-D CMAKE_CXX_COMPILER=S:/b/1/bin/clang-cl.exe ^
287-
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
288299
-D CMAKE_CXX_FLAGS="-Xclang -fno-split-cold-code" ^
300+
-D CMAKE_MT=mt ^
301+
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
289302
-D LLBUILD_SUPPORT_BINDINGS=Swift ^
290303
-D dispatch_DIR=S:\b\2\cmake\modules ^
291304
-D Foundation_DIR=S:\b\3\cmake\modules ^
@@ -310,6 +323,7 @@ cmake -B S:\b\7 ^
310323
-D BUILD_SHARED_LIBS=YES ^
311324
-D CMAKE_BUILD_TYPE=Release ^
312325
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
326+
-D CMAKE_MT=mt ^
313327
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
314328
-D dispatch_DIR=S:\b\2\cmake\modules ^
315329
-D Foundation_DIR=S:\b\3\cmake\modules ^
@@ -327,6 +341,7 @@ cmake -B S:\b\8 ^
327341
-D BUILD_SHARED_LIBS=YES ^
328342
-D CMAKE_BUILD_TYPE=Release ^
329343
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
344+
-D CMAKE_MT=mt ^
330345
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
331346
-D dispatch_DIR=S:\b\2\cmake\modules ^
332347
-D Foundation_DIR=S:\b\3\cmake\modules ^
@@ -344,6 +359,7 @@ cmake -B S:\b\9 ^
344359
-D BUILD_SHARED_LIBS=YES ^
345360
-D CMAKE_BUILD_TYPE=Release ^
346361
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
362+
-D CMAKE_MT=mt ^
347363
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
348364
-D dispatch_DIR=S:\b\2\cmake\modules ^
349365
-D Foundation_DIR=S:\b\3\cmake\modules ^
@@ -364,8 +380,9 @@ cmake -B S:\b\10 ^
364380
-D BUILD_SHARED_LIBS=YES ^
365381
-D CMAKE_BUILD_TYPE=Release ^
366382
-D CMAKE_C_COMPILER=S:/b/1/bin/clang-cl.exe ^
367-
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
368383
-D CMAKE_INSTALL_PREFIX=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr ^
384+
-D CMAKE_MT=mt ^
385+
-D CMAKE_Swift_COMPILER=S:/b/1/bin/swiftc.exe ^
369386
-D dispatch_DIR=S:\b\2\cmake\modules ^
370387
-D Foundation_DIR=S:\b\3\cmake\modules ^
371388
-D TSC_DIR=S:\b\5\cmake\modules ^

include/swift/Runtime/Portability.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ swift_vasprintf(char **strp, const char *fmt, va_list args) {
4646
char *buffer = reinterpret_cast<char *>(malloc(len + 1));
4747
if (!buffer)
4848
return -1;
49-
int result = vsprintf(buffer, fmt, args);
49+
int result = vsnprintf(buffer, len + 1, fmt, args);
5050
if (result < 0) {
5151
free(buffer);
5252
return -1;

lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ bool SILCombiner::tryOptimizeKeypath(ApplyInst *AI) {
512512
/// %addr = struct_element_addr/ref_element_addr %root_object
513513
/// // use %inout_addr
514514
bool SILCombiner::tryOptimizeInoutKeypath(BeginApplyInst *AI) {
515+
// Disable in OSSA because KeyPathProjector is not fully ported
516+
if (AI->getFunction()->hasOwnership())
517+
return false;
518+
515519
SILFunction *callee = AI->getReferencedFunctionOrNull();
516520
if (!callee)
517521
return false;

test/lit.cfg

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -946,13 +946,9 @@ if run_vendor == 'apple':
946946
lit_config.note('Using freestanding resource dir: ' + new_resource_dir)
947947

948948
# Auto-linking does not work when stdlib is built with LTO, because linked
949-
# libraries are discovered too late (after optimizations are applied). Let's
950-
# explicitly link all libraries needed in tests.
951-
#
952-
# Note that this won't work on Linux (without LLD). The autolinking
953-
# mechanism on Linux will fail due to needing -L arguments to the path even
954-
# with this forced linking as the extracted commands will force the linker
955-
# to look up the linking by name as well.
949+
# libraries are discovered too late (after optimizations are applied), and
950+
# ld64 hits an assert and crashes. Until ld64 fixes this, let's workaround
951+
# it by explicitly -l linking all libraries needed in tests.
956952
if "stdlib_lto" in config.available_features:
957953
for library in ["swiftCore", "swiftStdlibUnittest",
958954
"swiftSwiftPrivateLibcExtras", "swiftSwiftPrivate",

0 commit comments

Comments
 (0)