You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IRToASTVisitor: preserve external LLVM global declarations as C extern #352
Rellic emits @counter = external global i32 as unsigned int counter;.
That C declaration creates a tentative definition. Linking the emitted C
with the original data provider therefore fails with a duplicate symbol.
Expected output is extern unsigned int counter;. The narrow fix passes SC_Extern to CreateVarDecl when the LLVM global is a declaration with
ordinary external linkage. Initialized definitions keep their existing
storage class and initializer.
The independently synthetic fixture in tests/external-global-declarations/
contains five complete functions, three external globals and one owned global
initialized to 11. A separate provider defines the external data. With
Clang/LLVM 17.0.6, Windows i686 and -fno-common, the original LLVM module
links with the provider; baseline emitted C fails with three duplicate
definitions. Corrected emitted C links, retains three undefined consumer
symbols and preserves the owned initializer. Linking without the provider
fails. Reccmp compares all five function bodies; all are byte-identical.
No runtime execution or argument sampling is performed.
Activity