linux-stable/scripts
Miguel Ojeda 801d026d61 kbuild: rust: avoid creating temporary files
commit df01b7cfce upstream.

`rustc` outputs by default the temporary files (i.e. the ones saved
by `-Csave-temps`, such as `*.rcgu*` files) in the current working
directory when `-o` and `--out-dir` are not given (even if
`--emit=x=path` is given, i.e. it does not use those for temporaries).

Since out-of-tree modules are compiled from the `linux` tree,
`rustc` then tries to create them there, which may not be accessible.

Thus pass `--out-dir` explicitly, even if it is just for the temporary
files.

Similarly, do so for Rust host programs too.

Reported-by: Raphael Nestler <raphael.nestler@gmail.com>
Closes: https://github.com/Rust-for-Linux/linux/issues/1015
Reported-by: Andrea Righi <andrea.righi@canonical.com>
Tested-by: Raphael Nestler <raphael.nestler@gmail.com> # non-hostprogs
Tested-by: Andrea Righi <andrea.righi@canonical.com> # non-hostprogs
Fixes: 295d8398c6 ("kbuild: specify output names separately for each emission type from rustc")
Cc: stable@vger.kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Tested-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:57:06 +02:00
..
atomic locking/atomic: Correct (cmp)xchg() instrumentation 2023-04-29 09:09:31 +02:00
basic
clang-tools
coccinelle
dtc
dummy-tools
gcc-plugins
gdb scripts/gdb: fix SB_* constants parsing 2023-06-19 13:19:32 -07:00
genksyms
kconfig
ksymoops
mod modpost: fix off by one in is_executable_section() 2023-07-19 16:36:19 +02:00
package kbuild: deb-pkg: remove the CONFIG_MODULES check in buildeb 2023-07-19 16:36:24 +02:00
selinux
tracing
.gitignore
Kbuild.include
Kconfig.include
Lindent
Makefile
Makefile.asm-generic
Makefile.build kbuild: rust: avoid creating temporary files 2023-07-27 08:57:06 +02:00
Makefile.clang kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS 2023-07-19 16:37:00 +02:00
Makefile.clean
Makefile.compiler kbuild: Add KBUILD_CPPFLAGS to as-option invocation 2023-07-19 16:37:00 +02:00
Makefile.debug
Makefile.defconf
Makefile.dtbinst
Makefile.extrawarn
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host kbuild: rust: avoid creating temporary files 2023-07-27 08:57:06 +02:00
Makefile.kasan
Makefile.kcov
Makefile.kcsan
Makefile.kmsan
Makefile.lib
Makefile.modfinal kbuild: Disable GCOV for *.mod.o 2023-07-19 16:36:23 +02:00
Makefile.modinst
Makefile.modpost
Makefile.package Kbuild updates for v6.4 2023-04-30 11:32:53 -07:00
Makefile.randstruct
Makefile.ubsan
Makefile.userprogs
Makefile.vmlinux kbuild: Fix CFI failures with GCOV 2023-07-19 16:36:23 +02:00
Makefile.vmlinux_o
adjust_autoksyms.sh
as-version.sh
asn1_compiler.c
bloat-o-meter
bootgraph.pl
bpf_doc.py
cc-can-link.sh
cc-version.sh
check-git
check-local-export
check-sysctl-docs sysctl: remove register_sysctl_paths() 2023-05-02 19:24:16 -07:00
check_extable.sh
checkdeclares.pl
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl Mainly singleton patches all over the place. Series of note are: 2023-04-27 19:57:00 -07:00
checkstack.pl
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch
decode_stacktrace.sh
decodecode
depmod.sh
dev-needs.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
file-size.sh
find-unused-docs.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen-randstruct-seed.sh
gen_autoksyms.sh
gen_ksymdeps.sh
generate_initcall_order.pl
generate_rust_analyzer.py
generate_rust_target.rs
get_abi.pl
get_dvb_firmware
get_feat.pl
get_maintainer.pl
gfp-translate scripts: fix the gfp flags header path in gfp-translate 2023-06-19 13:19:32 -07:00
head-object-list.txt
headerdep.pl
headers_install.sh
insert-sys-cert.c
install.sh
is_rust_module.sh
jobserver-exec
kallsyms.c kallsyms: strip LTO-only suffixes from promoted global functions 2023-07-27 08:56:54 +02:00
kernel-doc
ld-version.sh
leaking_addresses.pl
link-vmlinux.sh Kbuild updates for v6.4 2023-04-30 11:32:53 -07:00
makelst
markup_oops.pl
min-tool-version.sh
misc-check
mkcompile_h
mksysmap scripts/mksysmap: Fix badly escaped '$' 2023-07-19 16:36:19 +02:00
mkuboot.sh
module.lds.S
modules-check.sh
nsdeps
objdiff
objdump-func
orc_hash.sh x86/unwind/orc: Add ELF section with ORC version identifier 2023-06-16 17:17:42 +02:00
pahole-flags.sh
pahole-version.sh
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c recordmcount: Fix memory leaks in the uwrite function 2023-04-25 21:10:20 -04:00
recordmcount.h
recordmcount.pl
relocs_check.sh
remove-stale-files
rust_is_available.sh
rust_is_available_bindgen_libclang.h
setlocalversion
show_delta
sign-file.c
sorttable.c
sorttable.h
spdxcheck-test.sh
spdxcheck.py
spdxexclude
spelling.txt
sphinx-pre-install
split-man.pl
stackdelta
stackusage
subarch.include
syscallhdr.sh
syscallnr.sh
syscalltbl.sh
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-07-05 18:30:30 +01:00
test_fortify.sh
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh