ziglang / zig

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

error: unsupported linker arg: --exclude-libs #15113

Open recht opened 1 year ago

recht commented 1 year ago

Zig Version

0.11.0-dev.1796+c9e02d3e6

Steps to Reproduce and Observed Behavior

Trying to build python libs using zig c++:

/tmp/zig/zig-linux-x86_64-0.11.0-dev.1796+c9e02d3e6/zig` c++ -shared -L/tools/deps/lib -Wl,--exclude-libs,ALL -L/tools/deps/libedit/lib -g0 -isystem /home/joakim/.cache/bazel/_bazel_joakim/1eaa5bd43262acc0a542befd7785511c/external/python39_x86_64-unknown-linux-gnu/include/python3.9 build/temp.linux-x86_64-cpython-39/./python_bindings/bindings.o -L/install/lib -o build/lib.linux-x86_64-cpython-39/hnswlib.cpython-39-x86_64-linux-gnu.so -fopenmp -pthread
error: unsupported linker arg: --exclude-libs
error: command '/tmp/zig/zig-linux-x86_64-0.11.0-dev.1796+c9e02d3e6/zig' failed with exit code 1

Expected Behavior

No error

Jengamon commented 1 year ago

From the ld(1) man page:

--exclude-libs lib,lib,...

Specifies a list of archive libraries from which symbols 
should not be automatically exported. The library names 
may be delimited by commas or colons. Specifying "--
exclude-libs ALL" excludes symbols in all archive libraries 
from automatic export. This option is available only for the 
i386 PE targeted port of the linker and for ELF targeted ports.
For i386 PE , symbols explicitly listed in a .def file are still 
exported, regardless of this option. For ELF targeted ports, 
symbols affected by this option will be treated as hidden.