rust/compiler/rustc_codegen_ssa/src
Matthias Krüger e2ea7d82b1
Rollup merge of #125861 - name1e5s:fix/rpath_null_panic, r=michaelwoerister
rustc_codegen_ssa: fix `get_rpath_relative_to_output` panic when lib only contains file name

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->

When compiles program with `-C rpath=yes` but with no output filename specified, or with filename ONLY, we will get an ICE for now. Fix it by treat empty `output` path in `get_rpath_relative_to_output`  as current dir.

Before this patch:

```bash
rustc -C prefer_dynamic=yes -C rpath=yes -O h.rs  # ICE, no output filename specified
rustc -o hello -C prefer_dynamic=yes -C rpath=yes -O h.rs # ICE, output filename has no path
rustc -o ./hello -C prefer_dynamic=yes -C rpath=yes -O h.rs # Works
```

All those examples work after the patch.

Close #119571.
Close #125785.
2024-06-05 18:21:10 +02:00
..
back Rollup merge of #125861 - name1e5s:fix/rpath_null_panic, r=michaelwoerister 2024-06-05 18:21:10 +02:00
debuginfo Align Term methods with GenericArg methods 2024-06-03 20:36:27 -04:00
mir Rollup merge of #124251 - scottmcm:unop-ptr-metadata, r=oli-obk 2024-05-29 03:25:07 +01:00
traits Rollup merge of #125148 - RalfJung:codegen-sh, r=scottmcm 2024-05-27 13:10:34 +02:00
assert_module_sources.rs Remove #[macro_use] extern crate tracing from rustc_codegen_ssa. 2024-05-23 18:02:40 +10:00
base.rs Rollup merge of #125148 - RalfJung:codegen-sh, r=scottmcm 2024-05-27 13:10:34 +02:00
codegen_attrs.rs Allow static mut definitions with #[linkage] 2024-06-03 10:45:16 +00:00
common.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
errors.rs emit an error if we can't find a path to the self-contained linker 2024-05-23 15:47:35 +00:00
lib.rs Auto merge of #122597 - pacak:master, r=bjorn3 2024-06-04 00:05:56 +00:00
meth.rs Omit non-needs_drop drop_in_place in vtables 2024-05-27 16:26:56 -04:00
mono_item.rs Remove #[macro_use] extern crate tracing from rustc_codegen_ssa. 2024-05-23 18:02:40 +10:00
size_of_val.rs Remove #[macro_use] extern crate tracing from rustc_codegen_ssa. 2024-05-23 18:02:40 +10:00
target_features.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00