binutils-gdb/gdb/compile
Luis Machado 9b8ffbf410 Don't pass empty options to GCC
On aarch64-linux, I noticed the compile command didn't work at all.  It
always gave the following error:

aarch64-linux-gnu-g++: error: : No such file or directory

Turns out we're passing an empty argv entry to GCC (because aarch64 doesn't
have a -m64 option), and GCC's behavior is to think that is a file it needs
to open.  One can reproduce it like so:

gcc "" "" "" ""
gcc: error: : No such file or directory
gcc: error: : No such file or directory
gcc: error: : No such file or directory
gcc: error: : No such file or directory
gcc: fatal error: no input files
compilation terminated.

The solution is to check for an empty string and skip adding that to argv.

Regression tested on aarch64-linux/Ubuntu 18.04/20.04.

gdb/ChangeLog:

2021-03-29  Luis Machado  <luis.machado@linaro.org>

	* compile/compile.c (get_args): Don't add empty argv entries.
2021-03-29 11:59:50 -03:00
..
compile-c-support.c Return unique_ptr from language_defn::get_compile_context 2021-02-05 07:17:12 -07:00
compile-c-symbols.c Use std::vector for "registers_used" in compile feature 2021-01-23 20:33:25 -07:00
compile-c-types.c gdb: rename type::{arch,objfile} -> type::{arch_owner,objfile_owner} 2021-01-28 10:09:02 -05:00
compile-c.h Use std::vector for "registers_used" in compile feature 2021-01-23 20:33:25 -07:00
compile-cplus-symbols.c
compile-cplus-types.c Fix TYPE_DECLARED_CLASS thinko 2021-03-24 13:44:17 -07:00
compile-cplus.h
compile-internal.h Remove call to reset from compile_to_object 2021-01-23 17:48:48 -07:00
compile-loc2c.c Avoid crash when "compile" expression uses cooked register 2021-01-23 20:33:25 -07:00
compile-object-load.c
compile-object-load.h
compile-object-run.c
compile-object-run.h
compile.c Don't pass empty options to GCC 2021-03-29 11:59:50 -03:00
compile.h Use std::vector for "registers_used" in compile feature 2021-01-23 20:33:25 -07:00
gcc-c-plugin.h
gcc-cp-plugin.h