Skip to content

Conversation

@tstndeemkssz
Copy link

What's this all about?

Fixes: #0000 ⬅️ Be sure to refer to an existing issue here!

I do cross-compiling for Windows binaries on Linux through clang 20
https://github.com/trcrsired/windows-msvc-sysroot

Here are some the issues I have found for clang x86_64/aarch64-windows-msvc for clang.

I am also adding dllimport to the imports too

@sylveon
Copy link
Contributor

sylveon commented Nov 25, 2024

From a cursory read these changes most likely break clang-cl on Windows.

@tstndeemkssz
Copy link
Author

tstndeemkssz commented Nov 25, 2024

From a cursory read these changes most likely break clang-cl on Windows.

Hello. Thank you. clang-cl also supports asm renaming things. clang and GCC they both support them even clang is targeting msvc.

I am using this one:
https://github.com/[trcrsired/windows-msvc-sysroot](https://github.com/trcrsired/windows-msvc-sysroot/tree/main)/tree/main
https://github.com/trcrsired/llvm-releases/releases/tag/llvm20-20241124

We have done for years for directly renaming even for clang-cl
https://github.com/cppfastio/fast_io/blob/next/include/fast_io_hosted/platforms/win32/apis.h

There are some questions for me on how the dllimport naming works on arm64ec, which is why I haven't changed that part yet.

@dmachaj
Copy link
Contributor

dmachaj commented Nov 25, 2024

From a cursory read these changes most likely break clang-cl on Windows.

I triggered the CI to run. Your guess was a good one. Clang-Cl seems to be broken in cpp17 mode (cpp20 seems to be passing).

@tstndeemkssz
Copy link
Author

tstndeemkssz commented Nov 25, 2024

From a cursory read these changes most likely break clang-cl on Windows.

I triggered the CI to run. Your guess was a good one. Clang-Cl seems to be broken in cpp17 mode (cpp20 seems to be passing).

Hi. I have checked that, and I think it is not the reason for C++20. I got the symbol wrong for i686.

#if !defined(__clang__)
#define WINRT_IMPL_LINK(function, count) __asm__(#function "@" #count)
#define WINRT_IMPL_LINK2(function1, function2, count) __asm__(#function2 "@" #count)
#else
#define WINRT_IMPL_LINK(function, count) __asm__("_" #function "@" #count)
#define WINRT_IMPL_LINK2(function1, function2, count) __asm__("_" #function2 "@" #count)
#endif

This should be correct now. Can you start CI again? Thank you

cqwrteur added 2 commits December 5, 2024 01:36
Fix i686 compilations

Use SIZE_MAX <= UINT_LEAST32_MAX to ensure it is 32 bit target
instead of 64 bit

fix link2 for msvc since it needs link2

use link2 for WINRT_GetActivationFactory

it is WINRT_IMPL_LINK2 for gcc and clang

avoid dllimport for arm64ec since i do not know how the symbol works

import runtimeobject.lib by default

i messed up with gcc and clang for i686 fixed

WINRT_IMPL_EXTERN_C_END

extern "C"
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this new block need the WINRT_IMPL_EXTERN_C_BEGIN / WINRT_IMPL_EXTERN_C_END treatment too?

@github-actions
Copy link

This pull request is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions
Copy link

This pull request is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants