ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
34.94k stars 2.55k forks source link

Building a static and shared library and linking them causes missing symbols and strange errors #19341

Open RossComputerGuy opened 8 months ago

RossComputerGuy commented 8 months ago

Zig Version

0.12.0-dev.1856+3f7e799

Steps to Reproduce and Observed Behavior

Try building https://github.com/MidstallSoftware/eudev.zig to target glibc, it will fail.

install
└─ install eudev
   └─ install udevadm
      └─ zig build-exe udevadm Debug native
         └─ zig build-lib udev Debug native failure
error: warning(link): unexpected LLD stderr:
ld.lld: warning: /home/ross/ExpidusOS/core/zig-cache/o/bbe2e62d480a610a249992f44442b6b2/libshared.a: archive member '/home/ross/ExpidusOS/core/zig-out/lib/libselinux.so' is neither ET_REL nor LLVM bitcode

install
└─ install eudev
   └─ install udevadm
      └─ zig build-exe udevadm Debug native 96 errors
error: ld.lld: undefined symbol: util_log_priority
    note: referenced by udevadm-control.c:87 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-control.c:87)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/264d540241e6f1c467ab818597ffb739/udevadm-control.o:(adm_control)
    note: referenced by udevadm-control.c:92 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-control.c:92)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/264d540241e6f1c467ab818597ffb739/udevadm-control.o:(adm_control)
error: ld.lld: undefined symbol: log_get_max_level
    note: referenced by udev-ctrl.c:89 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-ctrl.c:89)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ea5edb3a598e4060d349cd5dd03b7f86/udev-ctrl.o:(udev_ctrl_new_from_fd) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-ctrl.c:99 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-ctrl.c:99)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ea5edb3a598e4060d349cd5dd03b7f86/udev-ctrl.o:(udev_ctrl_new_from_fd) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-ctrl.c:123 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-ctrl.c:123)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ea5edb3a598e4060d349cd5dd03b7f86/udev-ctrl.o:(udev_ctrl_enable_receiving) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 264 more times
error: ld.lld: undefined symbol: strscpy
    note: referenced by udevadm-info.c:373 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-info.c:373)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/7e87386d0c41e82aebfa19e2ac8ff8a2/udevadm-info.o:(uinfo)
    note: referenced by udev-ctrl.c:102 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-ctrl.c:102)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ea5edb3a598e4060d349cd5dd03b7f86/udev-ctrl.o:(udev_ctrl_new_from_fd) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udevadm-monitor.c:125 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c:125)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(adm_monitor)
    note: referenced 23 more times
error: ld.lld: undefined symbol: log_internal
    note: referenced by udev-ctrl.c:89 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-ctrl.c:89)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ea5edb3a598e4060d349cd5dd03b7f86/udev-ctrl.o:(udev_ctrl_new_from_fd) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-ctrl.c:99 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-ctrl.c:99)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ea5edb3a598e4060d349cd5dd03b7f86/udev-ctrl.o:(udev_ctrl_new_from_fd) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-ctrl.c:123 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-ctrl.c:123)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ea5edb3a598e4060d349cd5dd03b7f86/udev-ctrl.o:(udev_ctrl_enable_receiving) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 262 more times
error: ld.lld: undefined symbol: log_assert_failed_unreachable
    note: referenced by udevadm-info.c:466 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-info.c:466)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/7e87386d0c41e82aebfa19e2ac8ff8a2/udevadm-info.o:(uinfo)
    note: referenced by udevadm-hwdb.c:645 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-hwdb.c:645)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/aa917928ffd2712528e24e2b40f319a3/udevadm-hwdb.o:(adm_hwdb)
    note: referenced by udevadm-settle.c:100 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-settle.c:100)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/e782ed90bc341cc88092df1f6de17902/udevadm-settle.o:(adm_settle)
    note: referenced 3 more times
error: ld.lld: undefined symbol: log_open
    note: referenced by udevadm.c:96 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm.c:96)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/8fca854243e8221b09b2c9e41b58b459/udevadm.o:(main)
error: ld.lld: undefined symbol: mac_selinux_init
    note: referenced by udevadm.c:97 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm.c:97)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/8fca854243e8221b09b2c9e41b58b459/udevadm.o:(main)
error: ld.lld: undefined symbol: log_set_max_level
    note: referenced by udevadm.c:103 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm.c:103)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/8fca854243e8221b09b2c9e41b58b459/udevadm.o:(main)
    note: referenced by udevadm.c:75 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm.c:75)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/8fca854243e8221b09b2c9e41b58b459/udevadm.o:(run_command)
error: ld.lld: undefined symbol: udev_device_get_devlink_priority
    note: referenced by udevadm-info.c:143 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-info.c:143)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/7e87386d0c41e82aebfa19e2ac8ff8a2/udevadm-info.o:(print_record)
    note: referenced by udev-node.c:136 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-node.c:136)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/34560bc5440a57b5c8f02a96e17ffaa0/udev-node.o:(link_find_prioritized) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-node.c:166 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-node.c:166)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/34560bc5440a57b5c8f02a96e17ffaa0/udev-node.o:(link_find_prioritized) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 2 more times
error: ld.lld: undefined symbol: getpeercred
    note: referenced by udev-ctrl.c:216 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-ctrl.c:216)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ea5edb3a598e4060d349cd5dd03b7f86/udev-ctrl.o:(udev_ctrl_get_connection) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
error: ld.lld: undefined symbol: mac_selinux_finish
    note: referenced by udevadm.c:134 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm.c:134)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/8fca854243e8221b09b2c9e41b58b459/udevadm.o:(main)
error: ld.lld: undefined symbol: udev_list_init
    note: referenced by udevadm-monitor.c:105 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c:105)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(adm_monitor)
    note: referenced by udevadm-monitor.c:106 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c:106)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(adm_monitor)
    note: referenced by udev-rules.c:1707 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-rules.c:1707)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/abcdd54096375c3a4c52d0fe259ef689/udev-rules.o:(udev_rules_new) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 3 more times
error: ld.lld: undefined symbol: log_close
    note: referenced by udevadm.c:136 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm.c:136)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/8fca854243e8221b09b2c9e41b58b459/udevadm.o:(main)
error: ld.lld: undefined symbol: safe_atou
    note: referenced by udevadm-settle.c:73 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-settle.c:73)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/e782ed90bc341cc88092df1f6de17902/udevadm-settle.o:(adm_settle)
error: ld.lld: undefined symbol: udev_list_entry_add
    note: referenced by udevadm-monitor.c:131 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c:131)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(adm_monitor)
    note: referenced by udevadm-monitor.c:135 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c:135)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(adm_monitor)
    note: referenced by udevadm-hwdb.c:514 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-hwdb.c:514)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/aa917928ffd2712528e24e2b40f319a3/udevadm-hwdb.o:(import_file)
    note: referenced 3 more times
error: ld.lld: undefined symbol: cmsg_close_all
    note: referenced by udev-ctrl.c:402 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-ctrl.c:402)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ea5edb3a598e4060d349cd5dd03b7f86/udev-ctrl.o:(udev_ctrl_receive_msg) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
error: ld.lld: undefined symbol: log_assert_failed
    note: referenced by udevadm-util.c:24 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-util.c:24)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/31b5349d3d4899af3f0648a2f0fa8e17/udevadm-util.o:(find_device)
    note: referenced by udevadm-util.c:25 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-util.c:25)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/31b5349d3d4899af3f0648a2f0fa8e17/udevadm-util.o:(find_device)
    note: referenced by udev-builtin-keyboard.c:171 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-keyboard.c:171)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/c4b36c38ea4c8e4d52562d83baa0a339/udev-builtin-keyboard.o:(set_trackpoint_sensitivity) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 1 more times
error: ld.lld: undefined symbol: now
    note: referenced by udevadm-settle.c:109 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-settle.c:109)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/e782ed90bc341cc88092df1f6de17902/udevadm-settle.o:(adm_settle)
    note: referenced by udevadm-settle.c:152 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-settle.c:152)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/e782ed90bc341cc88092df1f6de17902/udevadm-settle.o:(adm_settle)
    note: referenced by udev-event.c:52 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-event.c:52)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0d34a1543addad6fb8d227686f848588/udev-event.o:(udev_event_new) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 2 more times
error: ld.lld: undefined symbol: udev_list_get_entry
    note: referenced by udevadm-monitor.c:180 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c:180)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(adm_monitor)
    note: referenced by udevadm-monitor.c:188 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c:188)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(adm_monitor)
    note: referenced by udevadm-test.c:153 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-test.c:153)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ef734540a5462a5cf543de51d7e663e5/udevadm-test.o:(adm_test)
    note: referenced 5 more times
error: ld.lld: undefined symbol: strscpyl
    note: referenced by udevadm-test.c:118 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-test.c:118)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ef734540a5462a5cf543de51d7e663e5/udevadm-test.o:(adm_test)
    note: referenced by udevadm-test-builtin.c:93 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-test-builtin.c:93)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/16ca944c179de928b0884573bae61d6a/udevadm-test-builtin.o:(adm_builtin)
    note: referenced by udev-node.c:190 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-node.c:190)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/34560bc5440a57b5c8f02a96e17ffaa0/udev-node.o:(link_update) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 15 more times
error: ld.lld: undefined symbol: util_remove_trailing_chars
    note: referenced by udevadm-test.c:121 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-test.c:121)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ef734540a5462a5cf543de51d7e663e5/udevadm-test.o:(adm_test)
    note: referenced by udevadm-test-builtin.c:96 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-test-builtin.c:96)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/16ca944c179de928b0884573bae61d6a/udevadm-test-builtin.o:(adm_builtin)
    note: referenced by udev-rules.c:2157 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-rules.c:2157)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/abcdd54096375c3a4c52d0fe259ef689/udev-rules.o:(udev_rules_apply_to_event) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
error: ld.lld: undefined symbol: udev_device_new_from_synthetic_event
    note: referenced by udevadm-test.c:123 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-test.c:123)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ef734540a5462a5cf543de51d7e663e5/udevadm-test.o:(adm_test)
error: ld.lld: undefined symbol: udev_device_set_info_loaded
    note: referenced by udevadm-test.c:131 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-test.c:131)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/ef734540a5462a5cf543de51d7e663e5/udevadm-test.o:(adm_test)
error: ld.lld: undefined symbol: streq_ptr
    note: referenced by udev-builtin-net_id.c:380 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-net_id.c:380)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/005990418e317fcbf44b54f11024577e/udev-builtin-net_id.o:(names_ccw) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-builtin-net_id.c:283 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-net_id.c:283)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/005990418e317fcbf44b54f11024577e/udev-builtin-net_id.o:(names_pci) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-builtin-hwdb.c:112 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-hwdb.c:112)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/70dbc3b168490871f5a5363f35950dda/udev-builtin-hwdb.o:(udev_builtin_hwdb_search) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
error: ld.lld: undefined symbol: safe_close
    note: referenced by util.h:295 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/shared/util.h:295)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/c4b36c38ea4c8e4d52562d83baa0a339/udev-builtin-keyboard.o:(closep) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by util.h:295 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/shared/util.h:295)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(closep)
    note: referenced by util.h:295 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/shared/util.h:295)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/6fa84fc9a5a61cfc42db74049b69ac9f/udev-builtin-btrfs.o:(closep) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 6 more times
error: ld.lld: undefined symbol: strpcpyl
    note: referenced by udev-builtin-net_id.c:333 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-net_id.c:333)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/005990418e317fcbf44b54f11024577e/udev-builtin-net_id.o:(names_usb) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-builtin-net_id.c:337 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-net_id.c:337)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/005990418e317fcbf44b54f11024577e/udev-builtin-net_id.o:(names_usb) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-builtin-net_id.c:341 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-net_id.c:341)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/005990418e317fcbf44b54f11024577e/udev-builtin-net_id.o:(names_usb) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 4 more times
error: ld.lld: undefined symbol: udev_list_cleanup
    note: referenced by udevadm-monitor.c:280 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c:280)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(adm_monitor)
    note: referenced by udevadm-monitor.c:280 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c:280)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0bc94bde655ac4eafe235c5c89b008b0/udevadm-monitor.o:(adm_monitor)
    note: referenced by udev-event.c:59 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-event.c:59)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/0d34a1543addad6fb8d227686f848588/udev-event.o:(udev_event_unref) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 7 more times
error: ld.lld: undefined symbol: strjoin
    note: referenced by udevadm-hwdb.c:659 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-hwdb.c:659)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/aa917928ffd2712528e24e2b40f319a3/udevadm-hwdb.o:(adm_hwdb)
    note: referenced by udev-builtin-hwdb.c:46 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-hwdb.c:46)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/70dbc3b168490871f5a5363f35950dda/udev-builtin-hwdb.o:(udev_builtin_hwdb_lookup) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udevadm-hwdb.c:47 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-hwdb.c:47)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/aa917928ffd2712528e24e2b40f319a3/udevadm-hwdb.o:(list_conf_file_path)
error: ld.lld: undefined symbol: strpcpyf
    note: referenced by udev-builtin-net_id.c:157 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-net_id.c:157)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/005990418e317fcbf44b54f11024577e/udev-builtin-net_id.o:(dev_pci_onboard) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-builtin-net_id.c:159 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-net_id.c:159)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/005990418e317fcbf44b54f11024577e/udev-builtin-net_id.o:(dev_pci_onboard) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-builtin-net_id.c:212 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-net_id.c:212)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/005990418e317fcbf44b54f11024577e/udev-builtin-net_id.o:(dev_pci_slot) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 8 more times
error: ld.lld: undefined symbol: util_replace_whitespace
    note: referenced by udev-builtin-usb_id.c:330 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-usb_id.c:330)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/04ddf2d5bfac607a4d1d28a4d9610395/udev-builtin-usb_id.o:(builtin_usb_id) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-builtin-usb_id.c:340 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-usb_id.c:340)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/04ddf2d5bfac607a4d1d28a4d9610395/udev-builtin-usb_id.o:(builtin_usb_id) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced by udev-builtin-usb_id.c:357 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-usb_id.c:357)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/04ddf2d5bfac607a4d1d28a4d9610395/udev-builtin-usb_id.o:(builtin_usb_id) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
    note: referenced 5 more times
error: ld.lld: undefined symbol: safe_atoi
    note: referenced by udev-builtin-keyboard.c:165 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-builtin-keyboard.c:165)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/c4b36c38ea4c8e4d52562d83baa0a339/udev-builtin-keyboard.o:(set_trackpoint_sensitivity) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
error: ld.lld: undefined symbol: strbuf_new
    note: referenced by udevadm-hwdb.c:677 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-hwdb.c:677)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/aa917928ffd2712528e24e2b40f319a3/udevadm-hwdb.o:(adm_hwdb)
    note: referenced by udev-rules.c:1715 (/home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udev-rules.c:1715)
    note:               /home/ross/ExpidusOS/core/zig-cache/o/abcdd54096375c3a4c52d0fe259ef689/udev-rules.o:(udev_rules_new) in archive /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a
error: the following command failed with 96 compilation errors:
/nix/store/y39di0z5wk5a427kbyb9hq8c2fby0qb6-zig-0.12.0-dev.3f7e799/bin/zig build-exe /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm.c /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-info.c /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-control.c /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-monitor.c /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-hwdb.c /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-settle.c /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-trigger.c /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-test.c /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-test-builtin.c /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev/udevadm-util.c /home/ross/ExpidusOS/core/zig-out/lib/libudev.so /home/ross/ExpidusOS/core/zig-cache/o/78df4996e47607b08d11e336b4abef67/libudev-core.a -ODebug -I /home/ross/ExpidusOS/core/zig-cache/o/177a280e13b8e6a0ed1ccf04b0548707/ -I /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/shared -I /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/libudev -I /home/ross/.cache/zig/p/12207490f36e8d92099ce7dce1c7076b53c02bd1f06e09c59f2531e78fbf168d73ae/src/udev -I /home/ross/ExpidusOS/core/zig-out/include -DHAVE_DECL_GETRANDOM=0 -DHAVE_DECL_STRNDUPA=1 -DHAVE_DECL_NAME_TO_HANDLE_AT=1 -DHAVE_DECL_GETTID=1 -DSIZEOF_PID_T=4 -DSIZEOF_UID_T=4 -DSIZEOF_GID_T=4 -DSIZEOF_RLIM_T=8 -DUDEV_ROOT_RUN="/home/ross/ExpidusOS/core/zig-cache/i/f705b9944b43b8a6546481e5ce6407d6/run" -DUDEV_CONF_DIR="/home/ross/ExpidusOS/core/zig-cache/i/f705b9944b43b8a6546481e5ce6407d6/etc/udev" -DUDEV_CONF_FILE="/home/ross/ExpidusOS/core/zig-cache/i/f705b9944b43b8a6546481e5ce6407d6/etc/udev/udev.conf" -DUDEV_HWDB_DIR="/home/ross/ExpidusOS/core/zig-cache/i/f705b9944b43b8a6546481e5ce6407d6/etc/udev/hwdb.d" -DUDEV_RULES_DIR="/home/ross/ExpidusOS/core/zig-cache/i/f705b9944b43b8a6546481e5ce6407d6/etc/udev/rules.d" -DUDEV_LIBEXEC_DIR="/home/ross/ExpidusOS/core/zig-cache/i/f705b9944b43b8a6546481e5ce6407d6/libexec" -DVERSION="251" -DUDEV_VERSION="3.2.14" -D_GNU_SOURCE=1 -D__USE_GNU=1 -DHAVE_SELINUX=1 -Mroot -lc --cache-dir /home/ross/ExpidusOS/core/zig-cache --global-cache-dir /home/ross/.cache/zig --name udevadm -dynamic --sysroot /nix/store/7a2pfw8n1jp439ami59qvkyraw2vc1lr-expidus-toolchain-9c24481 --listen=-

Expected Behavior

This shouldn't fail this way

nektro commented 8 months ago

HEAD is 1ff513d5db65db8e212522874cc7312929cb4ee8 at time of writing

jcalabro commented 7 months ago

Hello! I'm also seeing the same linker message when I attempt to use zig-gamedev with latest zig to run one of the sample programs:

$ zig version
0.12.0-dev.3433+640acf862

$ uname -a # though I'm seeing this across multiple Linux machines
Linux hostname 6.3.4-201.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Sat May 27 15:08:36 UTC 2023 x86_64 GNU/Linux

$ zig build triangle_wgpu
triangle_wgpu
└─ install triangle_wgpu
   └─ zig build-exe triangle_wgpu Debug native failure
error: warning(link): unexpected LLD stderr:
ld.lld: warning: /home/jcalabro/go/src/github.com/zig-gamedev/zig-gamedev/zig-cache/o/052f7e0b172d4f0be421142633a86ab2/libzdawn.a: archive member '/home/jcalabro/.cache/zig/p/12204a3519efd49ea2d7cf63b544492a3a771d37eda320f86380813376801e4cfa73/libdawn.a' is neither ET_REL nor LLVM bitcode

Here's a fork that's already updated to latest zig at time of writing.