diff options
author | Luis Machado <luis.machado@linaro.org> | 2021-03-24 11:12:46 -0300 |
---|---|---|
committer | Luis Machado <luis.machado@linaro.org> | 2021-03-29 11:59:50 -0300 |
commit | 9b8ffbf410f4482a51a443872758aa51ae20426f (patch) | |
tree | 54122f29d46d8d7dbc38f0f67ebf8f8e3f6c136b /gdb/top.c | |
parent | fa167b002fd7c02adf63bf7b5dbf60ca625ec9b5 (diff) | |
download | gdb-9b8ffbf410f4482a51a443872758aa51ae20426f.zip gdb-9b8ffbf410f4482a51a443872758aa51ae20426f.tar.gz gdb-9b8ffbf410f4482a51a443872758aa51ae20426f.tar.bz2 |
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.
Diffstat (limited to 'gdb/top.c')
0 files changed, 0 insertions, 0 deletions