Skip to content

Commit 1af6423

Browse files
committed
ninja: don't exclude rustc native-static-link args
`rustc --crate-type staticlib --print native-static-libs` doesn't print the default libraries being linked with rustc by default, at least not with rustc 1.89.0 (29483883e 2025-08-04). Stripping those by default, such as ws2_32 on win32, prevents from linking programs using sockets (ex qemu). Signed-off-by: Marc-André Lureau <[email protected]>
1 parent 2f6e64b commit 1af6423

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

mesonbuild/backend/ninjabackend.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,10 +2104,7 @@ def _link_library(libname: str, static: bool, bundle: bool = False) -> None:
21042104

21052105
for e in external_deps:
21062106
for a in e.get_link_args():
2107-
if a in rustc.native_static_libs:
2108-
# Exclude link args that rustc already add by default
2109-
continue
2110-
elif a.startswith('-L'):
2107+
if a.startswith('-L'):
21112108
args.append(a)
21122109
continue
21132110
elif a.endswith(('.dll', '.so', '.dylib', '.a', '.lib')):

0 commit comments

Comments
 (0)