How to avoid assembler warnings in testsuite in 'gcc -c' / 'gcc -s' mismatch
H.J. Lu
hjl.tools@gmail.com
Sat Nov 14 22:09:37 GMT 2020
On Sat, Nov 14, 2020 at 2:00 PM Sergei Trofimovich <slyfox@inbox.ru> wrote:
>
> I'm passing through ia64 test failure hoping to probably un-obsolete
> it's support at least for linux target.
>
> One of simple set of failures is caused by the gcc's driver difference.
>
> An example:
>
> ok:
> $ echo 'int main() {}' | ia64-unknown-linux-gnu-gcc -x c -c - -o a.o
> bad:
> $ echo 'int main() {}' | ia64-unknown-linux-gnu-gcc -x c -S - -o - | ia64-unknown-linux-gnu-as - -o a.o
> {standard input}: Assembler messages:
> {standard input}:14: Warning: Explicit stops are ignored in auto mode
>
>
> Warning happens because normally gcc passes '-x' argument to 'gas'.
> '-x' explicitly sets the style of instruction assignments to instruction
> bundles. Otherwise binutils does a bit of guessing and complains about it.
>
> As a result about 5-10 tests fail to extra warnings for
> --target=ia64-unknown-linux-gnu:
>
> $ ../binutils-gdb/configure --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=ia64-unknown-linux-gnu --enable-obsolete
> $ make check -k RUNTESTFLAGS='elf.exp'
> Running binutils-gdb/ld/testsuite/ld-elf/elf.exp ...
> FAIL: Build pr26391-5.o
> FAIL: Build pr26391-6.o
>
> What would be the best way to handle test failures?
>
> 1. Should 'gcc' explicitly emit '.explicit' directive to avoid guessing?
> 2. Or maybe individual failed tests should explicitly pass '-x' to gas? How?
A target can pass additional options to assembler:
elf.exp:set old_asflags $ASFLAGS
elf.exp: set ASFLAGS "$ASFLAGS --defsym HPUX=1"
elf.exp: set ASFLAGS "$ASFLAGS --defsym NO_SET=1"
elf.exp: set ASFLAGS "$ASFLAGS --defsym ALIGN=3"
elf.exp: set ASFLAGS "$ASFLAGS --defsym ALIGN=2"
elf.exp: set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1"
elf.exp:set saved_ASFLAGS "$ASFLAGS"
elf.exp: set ASFLAGS "$ASFLAGS -mx86-used-note=no"
elf.exp:set ASFLAGS "$saved_ASFLAGS"
elf.exp:set ASFLAGS $old_asflags
> 3. Or maybe add warning regex suppression for ia64?
> 4. Or maybe somehow use 'gcc -c' directly for link tests?
>
> The problem does not seem to be very specific to ia64. I wonder if
> there already a bit of infrastructure around it.
>
> Thanks!
>
> --
>
> Sergei
--
H.J.
More information about the Binutils
mailing list