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

When building on Windows w/swiftc, can accidently include both msvc and gcc math.inls. #1155

Open
jeffdav opened this issue Oct 11, 2024 · 2 comments
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue

Comments

@jeffdav
Copy link

jeffdav commented Oct 11, 2024

Describe the bug

On Windows, I'm building aws-sdk-swift using CMake. I build aws-c-* using ExternalProject_Add().
(Thank you for providing CMakeLists.txt for your projects!)

The issue is when building aws-sdk-swift, we end up using clang, which causes math.h include both math.msvc.inl and math.gcc_builtin.inl during module import, leading to duplicate symbols.

Expected Behavior

We should only include one or the other.

Current Behavior

We include both.

Reproduction Steps

Build aws-sdk-swift using CMake on Windows. I'm happy to share my CMakeLists.txt for doing this if it is helpful.

Possible Solution

Currently I'm patching:

#if defined(__clang__) || defined(__GNUC__)

To:

#if (defined(__clang__) || defined(__GNUC__)) && !defined(AWS_HAVE_MSVC_INTRINSICS_X64)
#    include <aws/common/math.gcc_builtin.inl>
#endif

I'm not 100% certain this is the most correct, but it works.

Additional Information/Context

No response

aws-c-common version used

commit 6978946 (origin/main, origin/HEAD, main)

Compiler and version used

swiftc: compnerd.org Swift version 6.0-dev (LLVM a527f49f462b0d7, Swift eef85a7be270421), clang: compnerd.org clang version 17.0.6, cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34120 for x64

Operating System and version

Windows 11 23H2

@jeffdav jeffdav added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 11, 2024
@TingDaoK
Copy link
Contributor

Yeah, please share the CMakeLists, which will help us to reproduce the issue.

@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 2 days. p2 This is a standard priority issue feature-request A feature should be added or improved. and removed needs-triage This issue or PR still needs to be triaged. bug This issue is a bug. labels Oct 14, 2024
@jmklix
Copy link
Member

jmklix commented Oct 14, 2024

Please note that it is still a feature request to get swiftc working on windows. As mentioned here by @waahm7

Currently, both Aws-crt-swift and Aws-sdk-swift don't support Windows. This is a feature request, and I think we will probably hit more issues than just awslabs/aws-crt-swift#290 to properly support Windows and also add CI for it. Swift SDK might have to do some work as well on their side. We have added this to our backlog and will update here as soon as we have any updates.

Please 👍 the original issue and that will help us prioritize this.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 2 days. label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants