Skip to content

Add support to windows on ARM build#2807

Merged
trengginas merged 4 commits intomasterfrom
win32-arm64
Aug 30, 2021
Merged

Add support to windows on ARM build#2807
trengginas merged 4 commits intomasterfrom
win32-arm64

Conversation

@trengginas
Copy link
Copy Markdown
Member

@trengginas trengginas commented Aug 24, 2021

Windows on ARM machine allow x86 win32 app to run without modification through emulation (ref).
This ticket will add support building the library using ARM64 specific configuration.

Requirement:

  • VS2017 or newer (Visual Studio with Build toolset version v142)

Steps to build:

  • The current solution also supports VS2015, and uses v140 build toolset version. You can change the build toolset from pjproject-vs14-common-config.props to v142.
    <DefaultToolset>v142</DefaultToolset>
    ....
        <BuildToolset>v142</BuildToolset>
  • Choose ARM64 from the solution platform dropdown option.

Note:

  • On VS2015, when opening the solution this warning will be printed.
    warning : Platform '[ARM64, 0]' referenced in the project file cannot be found.
    This is safe to ignore.
  • When adding third party library (e.g: OpenSSL), they also has to be built using ARM64 configuration.

@trengginas trengginas added this to the release-2.12 milestone Aug 24, 2021
@trengginas trengginas self-assigned this Aug 24, 2021
@nanangizz
Copy link
Copy Markdown
Member

nanangizz commented Aug 24, 2021

Windows 10 on ARM64 machine allow running Win32 app through emulation.

Should not this is for ARM64 native (not emulated)?

When building for win32/x64 on VS2019, there are errors like:

third_party\webrtc_aec3\src\rtc_base/checks.h(248): error C3546: '...': there are no parameter packs available to expand

@trengginas
Copy link
Copy Markdown
Member Author

Windows 10 on ARM64 machine allow running Win32 app through emulation.

Should not this is for ARM64 native (not emulated)?

Yes, this is specific for ARM64 build. Perhaps we should change the wording above. The point is, that building the library using Win32 configuration should work on ARM64 machine.

When building for win32/x64 on VS2019, there are errors like:

third_party\webrtc_aec3\src\rtc_base/checks.h(248): error C3546: '...': there are no parameter packs available to expand

Building webrtc_aec3 require to use buildtoolset v142 (#2775). I tried here using win32 setup and it builds succesfully.

@nanangizz
Copy link
Copy Markdown
Member

Windows 10 on ARM64 machine allow running Win32 app through emulation.

Should not this is for ARM64 native (not emulated)?

Yes, this is specific for ARM64 build. Perhaps we should change the wording above. The point is, that building the library using Win32 configuration should work on ARM64 machine.

Actually not sure about "Win32" term either as it can be ambiguous with "Win32" platform in VS config manager. Perhaps let's just use "Windows on ARM" which seems to be commonly used?

Also, please update the Getting Started trac wiki too about this new platform support.

When building for win32/x64 on VS2019, there are errors like:

third_party\webrtc_aec3\src\rtc_base/checks.h(248): error C3546: '...': there are no parameter packs available to expand

Building webrtc_aec3 require to use buildtoolset v142 (#2775). I tried here using win32 setup and it builds succesfully.

Ah okay. Actually I didn't want to build libwebrtc_aec3 (no PJMEDIA_HAS_WEBRTC_AEC3 defined), but since there were about 9 linking errors with error message like below, I clicked build libwebrtc_aec3.
LINK : fatal error LNK1104: cannot open file 'pjproject\third_party\lib\libwebrtc_aec3-i386-Win32-vc14-Debug.lib'

So now there is this linking error issue. FYI, I just get the lib source, create an empty config_site.h, then build. Tried with both build toolsets v140 & v142.

@trengginas
Copy link
Copy Markdown
Member Author

Windows 10 on ARM64 machine allow running Win32 app through emulation.

Should not this is for ARM64 native (not emulated)?

Yes, this is specific for ARM64 build. Perhaps we should change the wording above. The point is, that building the library using Win32 configuration should work on ARM64 machine.

Actually not sure about "Win32" term either as it can be ambiguous with "Win32" platform in VS config manager. Perhaps let's just use "Windows on ARM" which seems to be commonly used?

Also, please update the Getting Started trac wiki too about this new platform support.
Okay

When building for win32/x64 on VS2019, there are errors like:

third_party\webrtc_aec3\src\rtc_base/checks.h(248): error C3546: '...': there are no parameter packs available to expand

Building webrtc_aec3 require to use buildtoolset v142 (#2775). I tried here using win32 setup and it builds succesfully.

Ah okay. Actually I didn't want to build libwebrtc_aec3 (no PJMEDIA_HAS_WEBRTC_AEC3 defined), but since there were about 9 linking errors with error message like below, I clicked build libwebrtc_aec3.
LINK : fatal error LNK1104: cannot open file 'pjproject\third_party\lib\libwebrtc_aec3-i386-Win32-vc14-Debug.lib'

So now there is this linking error issue. FYI, I just get the lib source, create an empty config_site.h, then build. Tried with both build toolsets v140 & v142.

Right, #2775 misses something here. By default libwebrtc_aec3 is not included to be build. However libpjproject still reference libwebrtc_aec3 project. Since it is not build, linker error is raised. To fix the error, by default libpjproject will also need to remove libwebrtc_aec3 reference. User require to add the reference to libwebrtc_aec3 manually when when needed.

@trengginas trengginas changed the title Add support to ARM64 configuration for windows desktop build Add support to windows on ARM build Aug 25, 2021
@trengginas
Copy link
Copy Markdown
Member Author

Windows 10 on ARM64 machine allow running Win32 app through emulation.

Should not this is for ARM64 native (not emulated)?

Yes, this is specific for ARM64 build. Perhaps we should change the wording above. The point is, that building the library using Win32 configuration should work on ARM64 machine.

Actually not sure about "Win32" term either as it can be ambiguous with "Win32" platform in VS config manager. Perhaps let's just use "Windows on ARM" which seems to be commonly used?
Also, please update the Getting Started trac wiki too about this new platform support.
Okay

When building for win32/x64 on VS2019, there are errors like:

third_party\webrtc_aec3\src\rtc_base/checks.h(248): error C3546: '...': there are no parameter packs available to expand

Building webrtc_aec3 require to use buildtoolset v142 (#2775). I tried here using win32 setup and it builds succesfully.

Ah okay. Actually I didn't want to build libwebrtc_aec3 (no PJMEDIA_HAS_WEBRTC_AEC3 defined), but since there were about 9 linking errors with error message like below, I clicked build libwebrtc_aec3.
LINK : fatal error LNK1104: cannot open file 'pjproject\third_party\lib\libwebrtc_aec3-i386-Win32-vc14-Debug.lib'
So now there is this linking error issue. FYI, I just get the lib source, create an empty config_site.h, then build. Tried with both build toolsets v140 & v142.

Right, #2775 misses something here. By default libwebrtc_aec3 is not included to be build. However libpjproject still reference libwebrtc_aec3 project. Since it is not build, linker error is raised. To fix the error, by default libpjproject will also need to remove libwebrtc_aec3 reference. User require to add the reference to libwebrtc_aec3 manually when when needed.

The alternative would be to include an empty dummy file (e.g: used by libpjproject) when toolset is set to v140. And include the actual source when toolset is set to v142. This means by default, the libwebrtc_aec3 will be included to be built.

@trengginas
Copy link
Copy Markdown
Member Author

Notes: libpjproject library without libwebrtc_aec3 will be built ~13Mbyte. With libwebrtc_aec3, it is ~42Mbyte.

Copy link
Copy Markdown
Member

@nanangizz nanangizz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried building for win32, x64, and ARM64 (all debug config though), looks okay.

@trengginas trengginas merged commit 661a8ce into master Aug 30, 2021
@trengginas trengginas deleted the win32-arm64 branch May 12, 2022 01:19
BarryYin pushed a commit to BarryYin/pjproject that referenced this pull request Feb 3, 2026
* Add support to ARM64 configuration for win32 build

* Add changes notes to webrtc and webrtc_aec3 third party sources

* Remove reference to libwebrtc_aec3 from libpjproject. Add reference it manually if libwebrtc_aec3 is needed.

* Fix build error on Release configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants