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

Fix compilation on Windows when using standalone clang #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deimonn
Copy link

@deimonn deimonn commented Aug 29, 2024

Trying to compile gc.c using Clang 18.1.8 on Windows (the standalone version from the installer found in LLVM's releases page, not the MSYS2 version; that works fine) generates an "undeclared library function _AddressOfReturnAddress" error when expanding the __builtin_frame_address macro.

Clang supports the __builtin_frame_address built-in on Windows even in the MSVC environment, so the macro doesn't even need to exist when compiling with it.

This PR fixes the issue with a little check to omit the macro when __clang__ is defined.

@deimonn
Copy link
Author

deimonn commented Aug 29, 2024

I just realized (that's what I get for not looking beforehand) that #62 kind of addresses this, although GrimMaple's approach is to bring in intrin.h instead of using the __builtin_frame_address already provided by Clang.

I prefer this approach for consistency, but it really is up to preference.

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.

1 participant