-
-
Notifications
You must be signed in to change notification settings - Fork 297
Open
Labels
BugSomething isn't workingSomething isn't workingDiscussion neededThis feature needs discussion to iron out detailsThis feature needs discussion to iron out details
Description
Repro:
module component::weak_module;
import std::io;
fn void do_thing() @weak @extern("do_thing") @nostrip => io::printn("weak");
module component::strong_module;
import std::io;
fn void do_thing() @export("do_thing") @nostrip => io::printn("strong");
module main;
extern fn void do_thing();
fn void main() => do_thing();
Build command:
c3c compile-only main4.c3 --obj --link-libc=no --no-entry --target windows-x64
Inspecting the resulting COFF object file does not show a weak symbol as it should. And attempting to link creates a duplicate symbol error.
~$ nm ./obj/windows-x64/component.weak_module.obj | grep do_thing
0000000000000000 T do_thing
~$
~$ # now try linking it
~$ c3c compile-run main4.c3 --link-libc=no --target windows-x64
lld-link: error: duplicate symbol: do_thing
>>> defined at /path/main4.c3:7
>>> /tmp/c3cXIZoBZU/obj/windows-x64/component.strong_module.obj
>>> defined at /tmp/c3cXIZoBZU/obj/windows-x64/component.weak_module.obj
Failed to create an executable: (null)
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't workingDiscussion neededThis feature needs discussion to iron out detailsThis feature needs discussion to iron out details