From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Subject: [OB PATCH] Fix file-not-found error with clang in gdb.arch/i386-{avx, sse}.c
Date: Fri, 29 May 2020 17:16:01 +0100 [thread overview]
Message-ID: <1590768961-23868-1-git-send-email-gbenson@redhat.com> (raw)
Clang fails to compile two testcases with the following error:
fatal error: 'nat/x86-cpuid.h' file not found
This prevents the following testcases from executing:
gdb.arch/i386-avx.exp
gdb.arch/i386-sse.exp
Both testcases set additional_flags when building with GCC.
This commit causes the additional_flags to also be used when
building with clang. Note that, while fixing the build, this
commit reveals several new failures when using clang to build
the testsuite.
gdb/testsuite/ChangeLog:
* gdb.arch/i386-avx.exp (additional_flags): Also set when
building with clang.
* gdb.arch/i386-sse.exp (additional_flags): Likewise.
---
gdb/testsuite/ChangeLog | 6 ++++++
gdb/testsuite/gdb.arch/i386-avx.exp | 2 +-
gdb/testsuite/gdb.arch/i386-sse.exp | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.arch/i386-avx.exp b/gdb/testsuite/gdb.arch/i386-avx.exp
index c52586d..ad7bf02 100644
--- a/gdb/testsuite/gdb.arch/i386-avx.exp
+++ b/gdb/testsuite/gdb.arch/i386-avx.exp
@@ -31,7 +31,7 @@ if [get_compiler_info] {
}
set additional_flags ""
-if [test_compiler_info gcc*] {
+if { [test_compiler_info gcc*] || [test_compiler_info clang*] } {
set additional_flags "additional_flags=-mavx -I${srcdir}/.."
}
diff --git a/gdb/testsuite/gdb.arch/i386-sse.exp b/gdb/testsuite/gdb.arch/i386-sse.exp
index 1fd7cab..75cbfa5 100644
--- a/gdb/testsuite/gdb.arch/i386-sse.exp
+++ b/gdb/testsuite/gdb.arch/i386-sse.exp
@@ -31,7 +31,7 @@ if [get_compiler_info] {
}
set additional_flags ""
-if [test_compiler_info gcc*] {
+if { [test_compiler_info gcc*] || [test_compiler_info clang*] } {
set additional_flags "additional_flags=-msse -I${srcdir}/.."
}
--
1.8.3.1
reply other threads:[~2020-05-29 16:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1590768961-23868-1-git-send-email-gbenson@redhat.com \
--to=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).