bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/25572] New: /dev/null should be excluded from 'files are t


From: masahiroy at kernel dot org
Subject: [Bug binutils/25572] New: /dev/null should be excluded from 'files are the same' check
Date: Tue, 18 Feb 2020 05:36:35 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25572

            Bug ID: 25572
           Summary: /dev/null should be excluded from 'files are the same'
                    check
           Product: binutils
           Version: 2.35 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: masahiroy at kernel dot org
  Target Milestone: ---

Hi.

I think using /dev/null for both input and output
is useful, but the assembler emits this warning:

$ gcc -c -x assembler /dev/null -o /dev/null
Assembler messages:
Fatal error: The input '/dev/null' and output '/dev/null' files are the same


This is especially useful to check whether
a particular flag is supported or not.

$ gcc -Wa,<some-assembler-flag> -c -x assembler /dev/null -o /dev/null

   or

$ as <some-assembler-flag> /dev/null -o /dev/null

Then, check the exit code.

This technique is widely used in the Linux kernel build system.


However, with the current binutils,
this always exits with 1 with the 'files are the same' warning.

We could work around it by using /dev/zero
as a data sink, but this looks a bit strange.

$ gcc -Wa,<some-assembler-flag> -c -x assembler /dev/null -o /dev/zero


This was reported here
https://patchwork.kernel.org/patch/11347227/

I think device files should be excluded from the
same-file check.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]