Skip to content
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

Add Windows ARM64 support #81

Merged
merged 5 commits into from
Sep 19, 2022
Merged

Add Windows ARM64 support #81

merged 5 commits into from
Sep 19, 2022

Conversation

dennisameling
Copy link
Contributor

@dennisameling dennisameling commented Sep 17, 2022

This adds ARM64 support to the cv2pdb.vcxproj build. Needed for Git for Windows ARM64 support.

@rainers
Copy link
Owner

rainers commented Sep 18, 2022

The original purpose of cv2pdb is to translate old style CodeView debug information of the reference D compiler to pdb files. Later support for DWARF as emitted by the gcc based D compiler was added. The code in demangle.cpp is used to convert the mangled symbols of D functions or variables back to human readable form. It is unlikely to be useful for translating C++ debug information.

The code failing to compile is inline assembly that converts 80-bit floating point real values to something the C++ compiler understands, namely 64-bit floating point. I doubt that you will need that on ARM, so if you replace the usage of #ifdef _M_X64 with #ifndef _M_X86, you will just have to implement cvt80to64() which could error out if it is called for ARM builds.

@dennisameling
Copy link
Contributor Author

Thanks for the hint! Have implemented the changes as you suggested. Here's a successful CI run: https://github.com/dennisameling/cv2pdb/actions/runs/3077972033

Curious to hear what you think!

src/demangle.cpp Outdated

#include "symutil.h"

#ifdef _M_X64
extern "C" void cvt80to64(void * in, long double * out);
#elif _M_ARM64
void cvt80to64(void * in, long double * out) {
throw std::runtime_error("cvt80to64 is only supported on x64 processors.");
Copy link
Owner

Choose a reason for hiding this comment

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

This produces a silent termination with msvc, so I'd prefer a printf + exit.

Otherwise looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Have just implemented that. CI succeeded again.

The resulting binary also starts correctly:

C:\repos\cv2pdb\bin\Release_ARM64>.\cv2pdb --help
Convert DMD CodeView/DWARF debug information to PDB files, Version 0.52
Copyright (c) 2009-2012 by Rainer Schuetze, All Rights Reserved

License for redistribution is given by the Artistic License 2.0
see file LICENSE for further details

usage: --help [-D<version>|-C|-n|-e|-s<C>|-p<embedded-pdb>] <exe-file> [new-exe-file] [pdb-file]

@rainers rainers merged commit 9286b93 into rainers:master Sep 19, 2022
@rainers
Copy link
Owner

rainers commented Sep 19, 2022

Thank you for your contribution.

@dennisameling dennisameling deleted the windows-arm64 branch September 19, 2022 10:01
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