-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zig cc -l example sets the DSO paths incorrectly #19699
Labels
Milestone
Comments
This issue affects uber/hermetic_cc_toolchain as mentioned here. Linking @motiejus to provide visibility on progress. |
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Apr 30, 2024
This commit makes the way `zig cc` passes `-l/-L` flags for ELF linking consistent with Clang and GCC. Closes ziglang#19699
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
May 20, 2024
This commit makes the way `zig cc` passes `-l/-L` flags for ELF linking consistent with Clang and GCC. Closes ziglang#19699
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
May 20, 2024
This commit makes the way `zig cc` passes `-l/-L` flags for ELF linking consistent with Clang and GCC. Closes ziglang#19699
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Jun 4, 2024
This commit makes the way `zig cc` passes `-l/-L` flags for ELF linking consistent with Clang and GCC. Closes ziglang#19699
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Jun 17, 2024
This commit makes the way `zig cc` passes `-l/-L` flags for ELF linking consistent with Clang and GCC. Closes ziglang#19699
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Jul 5, 2024
This commit makes the way `zig cc` passes `-l/-L` flags for ELF linking consistent with Clang and GCC. Closes ziglang#19699
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Jul 26, 2024
This commit makes the way `zig cc` passes `-l/-L` flags for ELF linking consistent with Clang and GCC. Closes ziglang#19699
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Feb 21, 2025
This commit makes the way `zig cc` passes `-l`/`-L` flags for ELF linking consistent with Clang and GCC. The fix itself is in `src/link/Elf.zig`. The new test is in `test/link/elf.zig`. It follows the example from ziglang#19699. The rest of the changes are new functionality needed for the test: * `omit_soname` option for `Build.Module`, `OverlayOptions`. This passes `-fno-soname` to the linker when enabled. * `addLibraryPathSpecial` for `Build.Module`, `Build.Step.Compile`. Like `addLibraryPath` but for `[]const u8`. `addRPathSpecial` is also added for completeness. * `setCwd` for `Build.Step.Compile`. Allows setting current directory for compile steps. * `opt_cwd` for `evalZigProcess` in `Build.Step`. Allows running `evalZigProcess` in a specific directory. Needed for setting current directory for compile steps. * `--zig-lib-dir` is now appended differently in `Build.Step.Compile`. This is needed for compatibility with `setCwd`.
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Feb 21, 2025
This commit makes the way `zig cc` passes `-l`/`-L` flags for ELF linking consistent with Clang and GCC. The fix itself is in `src/link/Elf.zig`. The new test is in `test/link/elf.zig`. It follows the example from ziglang#19699. The rest of the changes are new functionality needed for the test: * `omit_soname` option for `Build.Module`, `OverlayOptions`. This passes `-fno-soname` to the linker when enabled. * `addLibraryPathSpecial` for `Build.Module`, `Build.Step.Compile`. Like `addLibraryPath` but for `[]const u8`. `addRPathSpecial` is also added for completeness. * `setCwd` for `Build.Step.Compile`. Allows setting current directory for compile steps. * `opt_cwd` for `evalZigProcess` in `Build.Step`. Allows running `evalZigProcess` in a specific directory. Needed for setting current directory for compile steps. * `--zig-lib-dir` is now appended differently in `Build.Step.Compile`. This is needed for compatibility with `setCwd`.
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Feb 24, 2025
This commit makes the way `zig cc` passes `-l`/`-L` flags for ELF linking consistent with Clang and GCC. The fix itself is in `src/link.zig` and `src/link/Elf.zig`. The new test is in `test/link/elf.zig`. It follows the example from ziglang#19699. The rest of the changes are new functionality needed for the test: * `omit_soname` option for `Build.Module`, `OverlayOptions`. This passes `-fno-soname` to the linker when enabled. * `addLibraryPathSpecial` for `Build.Module`, `Build.Step.Compile`. Like `addLibraryPath` but for `[]const u8`. `addRPathSpecial` is also added for completeness. * `setCwd` for `Build.Step.Compile`. Allows setting current directory for compile steps. * `opt_cwd` for `evalZigProcess` in `Build.Step`. Allows running `evalZigProcess` in a specific directory. Needed for setting current directory for compile steps. * `--zig-lib-dir` is now appended differently in `Build.Step.Compile`. This is needed for compatibility with `setCwd`.
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Feb 25, 2025
This test follows the example from ziglang#19699.
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Feb 25, 2025
This test follows the example from ziglang#19699.
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Feb 25, 2025
This test follows the example from ziglang#19699.
a-khabarov
added a commit
to a-khabarov/zig
that referenced
this issue
Feb 25, 2025
This test follows the example from ziglang#19699.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Zig Version
0.12.0-dev.3677+22a97cd23
Steps to Reproduce and Observed Behavior
Expected Behavior
zig cc
with-lmylib
(lookup without explicit basename) shouldn't pass the whole resolved path told.lld
.Here is what
clang
(17.0.6) does for cases like this:Note the absence of
mylib/
.gcc
(13.2.1 20230801) has the same behavior asclang
here:This is essentialy the behavior of
zig cc
when linking with explicit basename (-l:libmylib.so
):Related comment: #15743 (comment)
Related issue: #15743
The text was updated successfully, but these errors were encountered: