Skip to content

Commit

Permalink
fix: compile x86 and forwarding dlls properly
Browse files Browse the repository at this point in the history
That platform name is called Win32 in ICU
also fix a path

Used more flags that MS upstream did

Remove entrypoint from forwarding dlls
  • Loading branch information
ctrlaltf24 committed Oct 26, 2024
1 parent da8a093 commit 42fc9dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
- name: Build entire Solution x86
run: |
$env:ICU_DATA_FILTER_FILE = '${{ github.workspace }}/build/filters/filter.json'
msbuild icu4c/source/allinone/allinone.sln /p:Configuration=Release /p:Platform=x86 /p:SkipUWP=true
msbuild icu/icu4c/source/common-and-i18n/combined.vcxproj /p:Configuration=Release /p:Platform=x86
msbuild icu/icu4c/source/allinone/allinone.sln /p:Configuration=Release /p:Platform=Win32 /p:SkipUWP=true
msbuild icu/icu4c/source/common-and-i18n/combined.vcxproj /p:Configuration=Release /p:Platform=Win32
# The following tests fail with this error, the x64 passes.
# testing ICU in "D:\a\microsoft-icu\microsoft-icu\icu\icu4c\source\allinone\"\..\.. arch=x86 type=Release
# ==== icuinfo =========================================================================
Expand Down
4 changes: 2 additions & 2 deletions build/scripts/build_forwarding_dlls.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ echo. Got Library: %~1
del cmemory.obj %~1.dll %~1.lib %~1.exp ucln_cmn.lib ucln_cmn.exp ucln_cmn.obj umutex.obj utrace.obj
:: Generate a .lib with the required forwarding rules
lib /MACHINE:%arch% /nologo /def:..\common-and-i18n\%~1.def
:: Generate a .dll with all of the implementations for dll export (implemented in ucln_cmn.cpp + deps) as well as the lib above
cl /nologo /LD /DU_COMMON_IMPLEMENTATION /DU_EXPORT_2= /DU_EXPORT= /DU_PLATFORM_HAS_WIN32_API ucln_cmn.cpp cmemory.cpp umutex.cpp utrace.cpp %~1.lib /link /def:..\common-and-i18n\%~1.def /out:%~1.dll /MACHINE:%arch% /DLL
:: Generate a .dll with just the .exp generated above, no code - just forward
link %1.exp /NOENTRY /nologo /out:%~1.dll /MACHINE:%arch% /DLL /release /SUBSYSTEM:CONSOLE /guard:cf
move %~1.dll %out_dir%\%~1.dll
:goto :eof
6 changes: 4 additions & 2 deletions icu/icu4c/source/common-and-i18n/combined.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
<ImportLibrary>..\..\$(IcuLibOutputDir)\icu.lib</ImportLibrary>
<!-- MSFT-Change: This forces dynamic linking of the UCRT. -->
<IgnoreSpecificDefaultLibraries>libucrtd.lib;libucrt.lib</IgnoreSpecificDefaultLibraries>
<AdditionalOptions>/DEFAULTLIB:ucrtd.lib /def:icu.def %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/DEFAULTLIB:ucrtd.lib /def:icu.def /release /guard:cf %(AdditionalOptions)</AdditionalOptions>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<!-- Options that are common to all 'Release' project configurations -->
Expand All @@ -86,7 +87,8 @@
<ImportLibrary>..\..\$(IcuLibOutputDir)\icu.lib</ImportLibrary>
<!-- MSFT-Change: This forces dynamic linking of the UCRT. -->
<IgnoreSpecificDefaultLibraries>libucrtd.lib;libucrt.lib</IgnoreSpecificDefaultLibraries>
<AdditionalOptions>/DEFAULTLIB:ucrt.lib /def:icu.def %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/DEFAULTLIB:ucrt.lib /def:icu.def /release /guard:cf %(AdditionalOptions)</AdditionalOptions>
<SubSystem>Console</SubSystem>
<!-- FIXME: Also filter out IGNORE_WINDOWS_HEADERS? -->
</Link>
</ItemDefinitionGroup>
Expand Down

0 comments on commit 42fc9dd

Please sign in to comment.