forked from crystal-lang/crystal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Windows codegen (LLVM globals) in non-singlemodule mode (crystal-…
…lang#8978) Windows compilation so far was always being done in --single-module mode because --cross-compile implies it. But if one adds enough workarounds to try out the compiler *on* Windows, they would run into these problems, unless --single-module is specified. * Problem 1: `__CxxFrameHandler3` is being added only in the main module but can be used in any other module, and the attempt would cause an error: Undefined llvm function: __CxxFrameHandler3 Instead, define this function once per module (still on-demand). * Problem 2: `void_ptr_type_descriptor` is being defined as an LLVM global once per module. But because it's the exact same symbol in all the modules, linking them together leads to this error (repeated per module): I-O-5858F-ileD-escriptor43.o : error LNK2005: "void *`RTTI Type Descriptor'" (??_R0PEAX@8) already defined in _main.o. Instead, define it only in the main module (still on-demand) and then let other modules refer to it as an external constant.
- Loading branch information
1 parent
d500cc0
commit 5e66716
Showing
3 changed files
with
37 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters