Skip to content

CDRIVER-5839 Unofficial ARM64 Windows support #1810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 30, 2024

Conversation

adriandole
Copy link
Contributor

Test system: ARM64 Windows VM running on an M1 Mac using UTM.

Build in the ARM64 Native tools command prompt.

Configure for clang:

cmake -D ENABLE_EXTRA_ALIGNMENT=OFF -D ENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -D CMAKE_BUILD_TYPE=Debug -D ENABLE_MONGOC=ON -G "Visual Studio 17 2022" -A ARM64 -T ClangCL -D CMAKE_C_FLAGS="-w" -S srcDir -B buildDir

Configure for MSVC:

cmake -G"NMake Makefiles" -DCMAKE_SYSTEM_PROCESSOR=arm64 -DENABLE_TRACING=ON -DENABLE_SSL=WINDOWS 

@adriandole adriandole requested a review from kevinAlbs December 17, 2024 23:23
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

Changes LGTM, but I expect may not resolve #1797. I expect Advapi32 is a required dependency on Windows. For example: RegCloseKey is used in mongoc-socket.c and is documented in Advapi32.

Building on x86_64 shows Advapi32 is linked. Here is a screenshot of dependency walker:
Screenshot 2024-12-18 at 12 44 47 PM

I think the difference on ARM64 is CMake does not include Advapi32 in the standard libraries. I suggest making the dependency explicit:

target_link_libraries(_mongoc-dependencies INTERFACE mongo::detail::c_platform $<$<PLATFORM_ID:Windows>:advapi32.lib>)

@adriandole adriandole requested a review from kevinAlbs December 27, 2024 21:35
@kevinAlbs kevinAlbs changed the title Unofficial ARM64 Windows support CDRIVER-5839 Unofficial ARM64 Windows support Dec 30, 2024
@kevinAlbs
Copy link
Collaborator

LGTM, thank you for investigating. Filed CDRIVER-5839 to track. Added Create tickets to track PRs to the process document.

@adriandole adriandole merged commit e71642a into mongodb:master Dec 30, 2024
45 checks passed
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.

2 participants