Skip to content

Add a mechanism for forcing codegen for an import/module.#16443

Closed
just-harry wants to merge 2 commits intodlang:masterfrom
just-harry:force-codegen-mechanism
Closed

Add a mechanism for forcing codegen for an import/module.#16443
just-harry wants to merge 2 commits intodlang:masterfrom
just-harry:force-codegen-mechanism

Conversation

@just-harry
Copy link
Contributor

@just-harry just-harry commented May 5, 2024

This PR adds a mechanism which lets the frontend indicate that codegen should always take place for an import/module, even if that module wasn't supplied on the command-line when the compiler was invoked, and regardless of whether the -i switch was supplied or not.

My main motivation for this is for #16372; so that codegen can be forced for the __builtins_msvc module, so that #include <importc_msvc_builtins.h> just works regardless of how the compiler was invoked. (Additional context: #16372 (comment); #16372 (comment); #16372 (comment))

@rikkimax
Copy link
Contributor

rikkimax commented May 5, 2024

This could very easily lead to duplicate symbols.

All the symbols would need to have the appropriate linker flag(s) set to allow for duplicates.

As-is this will result in our builds being more fragile than necessary. Some thinking about how to handle duplicates needs to take place before merging a solution to this.

@kinke and @ibuclaw will also need to sign off on this.

@just-harry
Copy link
Contributor Author

Closing this as I've realised a way to obviate the need for forcing module-wide codegen for #16372

@just-harry just-harry closed this May 7, 2024
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.

2 participants