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

Draft: windows on arm lib support #5928

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ AC_SUBST(REV)
AC_SUBST(RDATE)

dnl Are we compiling for windows
if echo $host_os | egrep '^mingw|^winnt' > /dev/null ; then
if echo $host_os | egrep '^mingw|^winnt|^windows' > /dev/null ; then
isWIN32=yes
else
isWIN32=no
Expand Down Expand Up @@ -1120,7 +1120,7 @@ fi
AM_CONDITIONAL(OS_LINUX, [echo $host_os | grep '^linux' > /dev/null])
AM_CONDITIONAL(OS_FREEBSD, [echo $host_os | grep '^freebsd' > /dev/null])
dnl In case anyone wants to try building the windows code using mingw!
AM_CONDITIONAL(OS_WIN32, [echo $host_os | egrep '^mingw|^winnt' > /dev/null])
AM_CONDITIONAL(OS_WIN32, [echo $host_os | egrep '^mingw|^winnt|^windows' > /dev/null])
AM_CONDITIONAL(OS_WIN32_MINGW, [echo $host_os | grep '^mingw' > /dev/null])
dnl or OS2
AM_CONDITIONAL(OS_OS2, [echo $host_os | grep '^os2' > /dev/null])
Expand Down
2 changes: 2 additions & 0 deletions lib/boinc_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@
#define SECURITY_WIN32
#endif

#include <cstddef>
Copy link
Member

Choose a reason for hiding this comment

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

is this really required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


#if !defined(__CYGWIN32__) || defined(USE_WINSOCK)

/* If we're not running under CYGWIN use windows networking */
Expand Down
6 changes: 6 additions & 0 deletions lib/hostinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ void HOST_INFO::clear_host_info() {
safe_strcpy(os_version, "");

#ifdef _WIN64
#if !defined(__aarch64__)
Copy link
Member

Choose a reason for hiding this comment

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

All these are not required since WSL is supported on ARM64 devices as well: https://learn.microsoft.com/en-us/windows/wsl/install-manual

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I'm encountering a relocation error during linking... let's see if I can find a better solution

wsl_distros.clear();
#endif
#else
safe_strcpy(docker_version, "");
safe_strcpy(docker_compose_version, "");
Expand Down Expand Up @@ -138,10 +140,12 @@ int HOST_INFO::parse(XML_PARSER& xp, bool static_items_only) {
if (xp.parse_str("os_name", os_name, sizeof(os_name))) continue;
if (xp.parse_str("os_version", os_version, sizeof(os_version))) continue;
#ifdef _WIN64
#if !defined(__aarch64__)
if (xp.match_tag("wsl")) {
this->wsl_distros.parse(xp);
continue;
}
#endif
#else
if (xp.parse_str("docker_version", docker_version, sizeof(docker_version))) continue;
if (xp.parse_str("docker_compose_version", docker_compose_version, sizeof(docker_compose_version))) continue;
Expand Down Expand Up @@ -235,7 +239,9 @@ int HOST_INFO::write(
coprocs.ndevs()
);
#ifdef _WIN64
#if !defined(__aarch64__)
wsl_distros.write_xml(out);
#endif
#else
if (strlen(docker_version)) {
out.printf(
Expand Down
6 changes: 4 additions & 2 deletions lib/hostinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "coproc.h"
#include "common_defs.h"

#ifdef _WIN64
#if defined(_WIN64) && !defined(__aarch64__)
#include "wslinfo.h"
#endif

Expand Down Expand Up @@ -86,7 +86,7 @@ class HOST_INFO {
char os_name[256];
char os_version[256];

#ifdef _WIN64
#if defined(_WIN64) && !defined(__aarch64__)
// on Windows, Docker info is per WSL_DISTRO, not global
WSL_DISTROS wsl_distros;
#else
Expand Down Expand Up @@ -173,7 +173,9 @@ class HOST_INFO {
extern void make_secure_random_string(char*);

#ifdef _WIN64
#if !defined(__aarch64__)
extern int get_wsl_information(WSL_DISTROS &distros);
#endif
extern int get_processor_group(HANDLE);
#endif

Expand Down
4 changes: 4 additions & 0 deletions lib/stackwalker_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,8 @@ static void ShowStackRM(HANDLE hThread, CONTEXT& Context)
"cs=%.4x ss=%.4x ds=%.4x es=%.4x fs=%.4x gs=%.4x efl=%.8lx\n\n",
Context.SegCs, Context.SegSs, Context.SegDs, Context.SegEs, Context.SegFs, Context.SegGs, Context.EFlags
);
#elif defined(__aarch64__)
// not implemented
#else
fprintf(stderr,
"eax=%.8lx ebx=%.8lx ecx=%.8lx edx=%.8lx esi=%.8lx edi=%.8lx\n",
Expand Down Expand Up @@ -780,6 +782,8 @@ static void ShowStackRM(HANDLE hThread, CONTEXT& Context)
StackFrame.AddrPC.Mode = AddrModeFlat;
StackFrame.AddrFrame.Offset = Context.Rbp;
StackFrame.AddrFrame.Mode = AddrModeFlat;
#elif defined(__aarch64__)
// not implemented
#else
StackFrame.AddrPC.Offset = Context.Eip;
StackFrame.AddrPC.Mode = AddrModeFlat;
Expand Down
2 changes: 1 addition & 1 deletion lib/win_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ char* windows_format_error_string(
DWORD dwRet = 0;
LPSTR lpszTemp = NULL;

va_list args = NULL;
va_list args;
va_start(args, iSize);
try {
dwRet = FormatMessage(
Expand Down
4 changes: 4 additions & 0 deletions lib/wslinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// write and parse WSL_DISTRO structs,
// which describe WSL distros and their possible Docker contents

#if !defined(__aarch64__)

#include <regex>

#include "common_defs.h"
Expand Down Expand Up @@ -183,3 +185,5 @@ WSL_DISTRO* WSL_DISTROS::find_docker() {
}
return NULL;
}

#endif
4 changes: 4 additions & 0 deletions lib/wslinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#ifndef BOINC_WSLINFO_H
#define BOINC_WSLINFO_H

#if !defined(__aarch64__)

#include <string>

#include "miofile.h"
Expand Down Expand Up @@ -80,3 +82,5 @@ struct WSL_DISTROS {
};

#endif

#endif