Skip to content

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