| |
@@ -4,7 +4,7 @@
|
| |
# it never writes to ~/.cargo during rpmbuild.
|
| |
# We also need RUSTC_BOOTSTRAP since we use -Z avoid-dev-deps
|
| |
# until it gets stabilized: https://github.com/rust-lang/cargo/issues/5133
|
| |
- %__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 %{_bindir}/cargo
|
| |
+ %__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 RUSTFLAGS='%{build_rustflags}' %{_bindir}/cargo
|
| |
%__cargo_common_opts %{?_smp_mflags} -Z avoid-dev-deps
|
| |
%__cargo_inspector %{_bindir}/cargo-inspector
|
| |
|
| |
@@ -20,7 +20,6 @@
|
| |
[build]\
|
| |
rustc = "%{__rustc}"\
|
| |
rustdoc = "%{__rustdoc}"\
|
| |
- rustflags = %{__global_rustflags_toml}\
|
| |
\
|
| |
[env]\
|
| |
CFLAGS = "%{build_cflags}"\
|
| |
%build_rustflags is used in %cargo_prep, which is executed in %prep,
when %buildsubdir is not set yet. When the linker script is actually created
in %build, %buildsubdir is defined, and we get a different path. To work
around this, in %build_rustflags we check if %_package_note_file is defined,
and add the linker arg if yes. But we summarilly ignore the actual value
and hardcode the path with the presumed value of %buildsubdir. Rust creates
have a standarized layout, so this should work OK in practice.
The linker flag gets passed to rustc, and resulting binaries seem to have
note as expected.