Avatar
Avatar
omochimetaru
-lto=llvm-full -experimental-hermetic-seal-at-link つけたらビルドできなかった・・・ wasm-ld: error: /Users/omochi/github/omochi/swift-string-counter-web/.build/wasm32-unknown-wasi/release/Algorithms.build/Chunked.swift.o: undefined symbol: swift_deallocObject wasm-ld: error: /Users/omochi/github/omochi/swift-string-counter-web/.build/wasm32-unknown-wasi/release/Algorithms.build/AdjacentPairs.swift.o: undefined symbol: swift_release wasm-ld: error: /Users/omochi/github/omochi/swift-string-counter-web/.build/wasm32-unknown-wasi/release/Algorithms.build/Keyed.swift.o: undefined symbol: swift_bridgeObjectRelease wasm-ld: error: /Users/omochi/github/omochi/swift-string-counter-web/.build/wasm32-unknown-wasi/release/Algorithms.build/Keyed.swift.o: undefined symbol: swift_bridgeObjectRelease wasm-ld: error: /Users/omochi/github/omochi/swift-string-counter-web/.build/wasm32-unknown-wasi/release/Algorithms.build/AdjacentPairs.swift.o: undefined symbol: swift_release wasm-ld: error: /Users/omochi/github/omochi/swift-string-counter-web/.build/wasm32-unknown-wasi/release/Algorithms.build/Chunked.swift.o: undefined symbol: swift_deallocObject wasm-ld: error: /Users/omochi/github/omochi/swift-string-counter-web/.build/wasm32-unknown-wasi/release/React.build/ChildrenBuilder.swift.o: undefined symbol: $sytWV clang: error: linker command failed with exit code 1 (use -v to see invocation) [10/11] Linking StringCounter.wasm
そのエラー,.build ディレクトリを一旦消したら別のエラーになりませんか?ビルドディレクトリに *.swift.o ファイルが見つからないというようなエラーに. そして SwiftPM だと最近 LTO を有効にするための --experimental-lto-mode=full みたいなのが追加されたみたいなので,-Xswiftc -lto=llvm-full じゃなくてこっちのフラグで指定したらどうなりますか? https://github.com/apple/swift-package-manager/pull/6891/files