Skip to content

Commit e3cacb2

Browse files
committed
Turn off safeseh for foundation on X86
Because lld has safeseh enabled by default and fails with a special icu data object file icudt69l_dat.obj. This fixes the X86 build.
1 parent c9b96d9 commit e3cacb2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

build.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,15 @@ function Build-Foundation($Arch, [switch]$Test = $false)
823823
$Targets = @("default", "install")
824824
}
825825

826+
$SwiftFlags = ""
827+
if ($Arch -eq $ArchX86)
828+
{
829+
# Turn off safeseh for lld as it has safeseh enabled by default
830+
# and fails with an ICU data object file icudt69l_dat.obj. This
831+
# matters to X86 only.
832+
$SwiftFlags = "-Xlinker /SAFESEH:NO"
833+
}
834+
826835
$env:CTEST_OUTPUT_ON_FAILURE = 1
827836
Build-CMakeProject `
828837
-Src $SourceCache\swift-corelibs-foundation `
@@ -834,6 +843,7 @@ function Build-Foundation($Arch, [switch]$Test = $false)
834843
CMAKE_INSTALL_PREFIX = "$($Arch.SDKInstallRoot)\usr";
835844
CMAKE_SYSTEM_NAME = "Windows";
836845
CMAKE_SYSTEM_PROCESSOR = $Arch.CMakeName;
846+
CMAKE_Swift_FLAGS = $SwiftFlags;
837847
CURL_DIR = "$LibraryRoot\curl-7.77.0\usr\lib\$ShortArch\cmake\CURL";
838848
ICU_DATA_LIBRARY_RELEASE = "$LibraryRoot\icu-69.1\usr\lib\$ShortArch\sicudt69.lib";
839849
ICU_I18N_LIBRARY_RELEASE = "$LibraryRoot\icu-69.1\usr\lib\$ShortArch\sicuin69.lib";

0 commit comments

Comments
 (0)