[PATCHv2,2/5] gdb/testsuite: Don't add gcc flags when compiling rust tests
Commit Message
We currently add the -fno-stack-protector option to the compiler flags
when compiling rust tests, as this is not a valid rustcc flag, this
means non of the test tests will compile.
gdb/testsuite/ChangeLog:
* lib/gdb.exp (gdb_compile): Don't add -fno-stack-protector option
if we're using rustcc.
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/lib/gdb.exp | 6 +++++-
2 files changed, 10 insertions(+), 1 deletion(-)
Comments
>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
Andrew> We currently add the -fno-stack-protector option to the compiler flags
Andrew> when compiling rust tests, as this is not a valid rustcc flag, this
Andrew> means non of the test tests will compile.
Andrew> gdb/testsuite/ChangeLog:
Andrew> * lib/gdb.exp (gdb_compile): Don't add -fno-stack-protector option
Andrew> if we're using rustcc.
Thanks for doing this. This is ok.
Tom
@@ -3566,7 +3566,11 @@ proc gdb_compile {source dest type options} {
&& !([test_compiler_info {gcc-[0-3]-*}]
|| [test_compiler_info {gcc-4-0-*}]) } {
# Put it at the front to not override any user-provided value.
- lappend new_options "early_flags=-fno-stack-protector"
+ if {[lsearch -exact $options rust] != -1} {
+ # -fno-stack-protector is not a rustcc option.
+ } else {
+ lappend new_options "early_flags=-fno-stack-protector"
+ }
}
# Because we link with libraries using their basename, we may need