* [PATCH] Disable Clang's integrated assembler for two testcases
@ 2020-08-19 14:55 Gary Benson
2020-08-20 12:17 ` Pedro Alves
0 siblings, 1 reply; 5+ messages in thread
From: Gary Benson @ 2020-08-19 14:55 UTC (permalink / raw)
To: gdb-patches
Hi all,
gdb.dwarf2/dw2-dir-file-name.exp fails to build using Clang because
the generated assembly language contains .ascii directives with more
than one string literal. gdb.dwarf2/dw2-restore.exp fails to build
using Clang because it contains .func and .endfunc directives.
This patch causes Clang to invoke the system assembler to assemble
the relevant files.
Checked on Fedora 32 x86_64, GCC and clang. Ok to commit?
Cheers,
Gary
--
gdb/testsuite/ChangeLog:
* gdb.dwarf2/dw2-dir-file-name.exp: Use system assembler
when compiling with clang.
* gdb.dwarf2/dw2-restore.exp: Likewise
---
gdb/testsuite/ChangeLog | 6 ++++++
gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp | 6 ++++++
gdb/testsuite/gdb.dwarf2/dw2-restore.exp | 9 ++++++++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
index 0de71f2..973325f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
@@ -333,6 +333,12 @@ lappend opts "additional_flags=-DFDIR=\"fdir\""
# CU's DW_AT_name and .debug_line's filename.
lappend opts "additional_flags=-DFILE=\"${srctmpfile}\""
+# Clang's integrated assembler doesn't support .ascii directives
+# with multiple string literals.
+if { [test_compiler_info clang*] } {
+ lappend opts "additional_flags=-fno-integrated-as"
+}
+
if { [gdb_compile "${asmsrcfile} ${srcdir}/${subdir}/$srcfile" "${binfile}" executable $opts] != "" } {
untested "failed to compile"
return -1
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-restore.exp b/gdb/testsuite/gdb.dwarf2/dw2-restore.exp
index 993f79f..04887db 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-restore.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-restore.exp
@@ -21,8 +21,15 @@ if {![istarget x86_64-*] || ![is_lp64_target]} {
}
standard_testfile .S
+set opts [list {additional_flags=-nostdlib}]
+
+# Clang's integrated assembler doesn't support .func or .endfunc.
+if { [test_compiler_info clang*] } {
+ lappend opts [list {additional_flags=-fno-integrated-as}]
+}
+
if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile] \
- [list {additional_flags=-nostdlib}]]} {
+ $opts]} {
return -1
}
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Disable Clang's integrated assembler for two testcases
2020-08-19 14:55 [PATCH] Disable Clang's integrated assembler for two testcases Gary Benson
@ 2020-08-20 12:17 ` Pedro Alves
2020-08-25 14:35 ` Gary Benson
0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2020-08-20 12:17 UTC (permalink / raw)
To: Gary Benson, gdb-patches
On 8/19/20 3:55 PM, Gary Benson via Gdb-patches wrote:
> Hi all,
>
> gdb.dwarf2/dw2-dir-file-name.exp fails to build using Clang because
> the generated assembly language contains .ascii directives with more
> than one string literal. gdb.dwarf2/dw2-restore.exp fails to build
> using Clang because it contains .func and .endfunc directives.
> This patch causes Clang to invoke the system assembler to assemble
> the relevant files.
>
> Checked on Fedora 32 x86_64, GCC and clang. Ok to commit?
Given we have this in most gdb.dwarf2 tests:
# This test can only be run on targets which support DWARF-2 and use gas.
^^^^^^^^^^^
this seems fine to me.
>
> Cheers,
> Gary
>
> --
> gdb/testsuite/ChangeLog:
>
> * gdb.dwarf2/dw2-dir-file-name.exp: Use system assembler
> when compiling with clang.
> * gdb.dwarf2/dw2-restore.exp: Likewise
Missing period after "Likewise".
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Disable Clang's integrated assembler for two testcases
2020-08-20 12:17 ` Pedro Alves
@ 2020-08-25 14:35 ` Gary Benson
2020-08-25 14:40 ` Pedro Alves
0 siblings, 1 reply; 5+ messages in thread
From: Gary Benson @ 2020-08-25 14:35 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
Pedro Alves wrote:
> On 8/19/20 3:55 PM, Gary Benson via Gdb-patches wrote:
> > Hi all,
> >
> > gdb.dwarf2/dw2-dir-file-name.exp fails to build using Clang because
> > the generated assembly language contains .ascii directives with more
> > than one string literal. gdb.dwarf2/dw2-restore.exp fails to build
> > using Clang because it contains .func and .endfunc directives.
> > This patch causes Clang to invoke the system assembler to assemble
> > the relevant files.
> >
> > Checked on Fedora 32 x86_64, GCC and clang. Ok to commit?
>
> Given we have this in most gdb.dwarf2 tests:
>
> # This test can only be run on targets which support DWARF-2 and use gas.
> ^^^^^^^^^^^
> this seems fine to me.
Interesting, I hadn't noticed that.
> > --
> > gdb/testsuite/ChangeLog:
> >
> > * gdb.dwarf2/dw2-dir-file-name.exp: Use system assembler
> > when compiling with clang.
> > * gdb.dwarf2/dw2-restore.exp: Likewise
>
> Missing period after "Likewise".
I pushed the wrong commit, without the period added. Should I push
a correction?
Cheers,
Gary
--
Gary Benson - he / him / his
Principal Software Engineer, Red Hat
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Disable Clang's integrated assembler for two testcases
2020-08-25 14:35 ` Gary Benson
@ 2020-08-25 14:40 ` Pedro Alves
2020-08-25 14:54 ` Gary Benson
0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2020-08-25 14:40 UTC (permalink / raw)
To: Gary Benson; +Cc: gdb-patches
On 8/25/20 3:35 PM, Gary Benson wrote:
>>> * gdb.dwarf2/dw2-dir-file-name.exp: Use system assembler
>>> when compiling with clang.
>>> * gdb.dwarf2/dw2-restore.exp: Likewise
>> Missing period after "Likewise".
> I pushed the wrong commit, without the period added. Should I push
> a correction?
Sure, why not?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Disable Clang's integrated assembler for two testcases
2020-08-25 14:40 ` Pedro Alves
@ 2020-08-25 14:54 ` Gary Benson
0 siblings, 0 replies; 5+ messages in thread
From: Gary Benson @ 2020-08-25 14:54 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
Pedro Alves wrote:
> On 8/25/20 3:35 PM, Gary Benson wrote:
> >>> * gdb.dwarf2/dw2-dir-file-name.exp: Use system assembler
> >>> when compiling with clang.
> >>> * gdb.dwarf2/dw2-restore.exp: Likewise
> >>
> >> Missing period after "Likewise".
> >
> > I pushed the wrong commit, without the period added. Should I push
> > a correction?
>
> Sure, why not?
Cool, I've done this now. Thanks for you review!
Cheers,
Gary
--
Gary Benson - he / him / his
Principal Software Engineer, Red Hat
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-08-25 14:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19 14:55 [PATCH] Disable Clang's integrated assembler for two testcases Gary Benson
2020-08-20 12:17 ` Pedro Alves
2020-08-25 14:35 ` Gary Benson
2020-08-25 14:40 ` Pedro Alves
2020-08-25 14:54 ` Gary Benson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox