Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] binutils: backport a patch to fix file matching problem
@ 2018-08-16  6:14 Robert Yang
  2018-08-16  6:14 ` [PATCH 1/1] binutils: Improve check for input file matching output file Robert Yang
  2018-08-16  6:37 ` ✗ patchtest: failure for binutils: backport a patch to fix file matching problem Patchwork
  0 siblings, 2 replies; 5+ messages in thread
From: Robert Yang @ 2018-08-16  6:14 UTC (permalink / raw)
  To: openembedded-core

Fixed accidental build failures when /tmp/ and build dir are on different
filesystems:

Assembler messages:
Fatal error: The input and output files must be distinct

// Robert

The following changes since commit 125789b6ee6d47ab84192230f63971c4e22418ba:

  cve-check.bbclass: do not download the CVE DB in package-specific tasks (2018-08-15 21:45:10 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/binutils
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/binutils

Robert Yang (1):
  binutils: Improve check for input file matching output file

 meta/recipes-devtools/binutils/binutils-2.31.inc   |  1 +
 ...check-for-input-file-matching-output-file.patch | 59 ++++++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch

-- 
2.7.4



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] binutils: Improve check for input file matching output file
  2018-08-16  6:14 [PATCH 0/1] binutils: backport a patch to fix file matching problem Robert Yang
@ 2018-08-16  6:14 ` Robert Yang
  2018-08-16  6:25   ` Robert Yang
  2018-08-16  6:37 ` ✗ patchtest: failure for binutils: backport a patch to fix file matching problem Patchwork
  1 sibling, 1 reply; 5+ messages in thread
From: Robert Yang @ 2018-08-16  6:14 UTC (permalink / raw)
  To: openembedded-core

When the assembler reports that the input and output are the same, report the
file names involved, in order to help debugging.  Also do not equate two files
are the same if the have the same inode value but reside on different file
systems.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-devtools/binutils/binutils-2.31.inc   |  1 +
 ...check-for-input-file-matching-output-file.patch | 59 ++++++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.31.inc b/meta/recipes-devtools/binutils/binutils-2.31.inc
index 02d5bca..6603873 100644
--- a/meta/recipes-devtools/binutils/binutils-2.31.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.31.inc
@@ -36,6 +36,7 @@ SRC_URI = "\
      file://0014-Detect-64-bit-MIPS-targets.patch \
      file://0015-sync-with-OE-libtool-changes.patch \
      file://0016-add-i386pep-emulation-for-x86_64.patch \
+     file://0017-improve-check-for-input-file-matching-output-file.patch \
 "
 S  = "${WORKDIR}/git"
 
diff --git a/meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch b/meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch
new file mode 100644
index 0000000..6d8d8a3
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch
@@ -0,0 +1,59 @@
+From 2a50366ded329bfb39d387253450c9d5302c3503 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 14 Aug 2018 12:22:35 +0100
+Subject: [PATCH] as.c: Improve check for input file matching output file.
+
+When the assembler reports that the input and output are the same, report the
+file names involved, in order to help debugging.  Also do not equate two files
+are the same if the have the same inode value but reside on different file
+systems.
+
+Upstream-Status: Backport
+
+Robert Yang <liezhi.yang@windriver.com>
+---
+ gas/as.c      | 27 ++++++++++++++++++++-------
+ 2 files changed, 20 insertions(+), 7 deletions(-)
+
+diff --git a/gas/as.c b/gas/as.c
+index b2a908a..3105d06 100644
+--- a/gas/as.c
++++ b/gas/as.c
+@@ -1259,14 +1259,27 @@ main (int argc, char ** argv)
+ 	{
+ 	  struct stat sib;
+ 
+-	  if (stat (argv[i], &sib) == 0)
++	  /* Check that the input file and output file are different.  */
++	  if (stat (argv[i], &sib) == 0
++	      && sib.st_ino == sob.st_ino
++	      /* POSIX emulating systems may support stat() but if the
++		 underlying file system does not support a file serial number
++		 of some kind then they will return 0 for the inode.  So
++		 two files with an inode of 0 may not actually be the same.
++		 On real POSIX systems no ordinary file will ever have an
++		 inode of 0.  */
++	      && sib.st_ino != 0
++	      /* Different files may have the same inode number if they
++		 reside on different devices, so check the st_dev field as
++		 well.  */
++	      && sib.st_dev == sob.st_dev)
+ 	    {
+-	      if (sib.st_ino == sob.st_ino && sib.st_ino != 0)
+-		{
+-		  /* Don't let as_fatal remove the output file!  */
+-		  out_file_name = NULL;
+-		  as_fatal (_("The input and output files must be distinct"));
+-		}
++	      const char *saved_out_file_name = out_file_name;
++
++	      /* Don't let as_fatal remove the output file!  */
++	      out_file_name = NULL;
++	      as_fatal (_("The input '%s' and output '%s' files are the same"),
++			argv[i], saved_out_file_name);
+ 	    }
+ 	}
+     }
+-- 
+2.7.4
+
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] binutils: Improve check for input file matching output file
  2018-08-16  6:14 ` [PATCH 1/1] binutils: Improve check for input file matching output file Robert Yang
@ 2018-08-16  6:25   ` Robert Yang
  2018-08-17  0:30     ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Yang @ 2018-08-16  6:25 UTC (permalink / raw)
  To: openembedded-core



On 08/16/2018 02:14 PM, Robert Yang wrote:
> When the assembler reports that the input and output are the same, report the
> file names involved, in order to help debugging.  Also do not equate two files
> are the same if the have the same inode value but reside on different file
> systems.
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>   meta/recipes-devtools/binutils/binutils-2.31.inc   |  1 +
>   ...check-for-input-file-matching-output-file.patch | 59 ++++++++++++++++++++++
>   2 files changed, 60 insertions(+)
>   create mode 100644 meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch
> 
> diff --git a/meta/recipes-devtools/binutils/binutils-2.31.inc b/meta/recipes-devtools/binutils/binutils-2.31.inc
> index 02d5bca..6603873 100644
> --- a/meta/recipes-devtools/binutils/binutils-2.31.inc
> +++ b/meta/recipes-devtools/binutils/binutils-2.31.inc
> @@ -36,6 +36,7 @@ SRC_URI = "\
>        file://0014-Detect-64-bit-MIPS-targets.patch \
>        file://0015-sync-with-OE-libtool-changes.patch \
>        file://0016-add-i386pep-emulation-for-x86_64.patch \
> +     file://0017-improve-check-for-input-file-matching-output-file.patch \
>   "
>   S  = "${WORKDIR}/git"
>   
> diff --git a/meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch b/meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch
> new file mode 100644
> index 0000000..6d8d8a3
> --- /dev/null
> +++ b/meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch
> @@ -0,0 +1,59 @@
> +From 2a50366ded329bfb39d387253450c9d5302c3503 Mon Sep 17 00:00:00 2001
> +From: Robert Yang <liezhi.yang@windriver.com>
> +Date: Tue, 14 Aug 2018 12:22:35 +0100
> +Subject: [PATCH] as.c: Improve check for input file matching output file.
> +
> +When the assembler reports that the input and output are the same, report the
> +file names involved, in order to help debugging.  Also do not equate two files
> +are the same if the have the same inode value but reside on different file
> +systems.
> +
> +Upstream-Status: Backport
> +
> +Robert Yang <liezhi.yang@windriver.com>

Sorry, here missed a SOB, I fixed it in the repo:

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>

// Robert

> +---
> + gas/as.c      | 27 ++++++++++++++++++++-------
> + 2 files changed, 20 insertions(+), 7 deletions(-)
> +
> +diff --git a/gas/as.c b/gas/as.c
> +index b2a908a..3105d06 100644
> +--- a/gas/as.c
> ++++ b/gas/as.c
> +@@ -1259,14 +1259,27 @@ main (int argc, char ** argv)
> + 	{
> + 	  struct stat sib;
> +
> +-	  if (stat (argv[i], &sib) == 0)
> ++	  /* Check that the input file and output file are different.  */
> ++	  if (stat (argv[i], &sib) == 0
> ++	      && sib.st_ino == sob.st_ino
> ++	      /* POSIX emulating systems may support stat() but if the
> ++		 underlying file system does not support a file serial number
> ++		 of some kind then they will return 0 for the inode.  So
> ++		 two files with an inode of 0 may not actually be the same.
> ++		 On real POSIX systems no ordinary file will ever have an
> ++		 inode of 0.  */
> ++	      && sib.st_ino != 0
> ++	      /* Different files may have the same inode number if they
> ++		 reside on different devices, so check the st_dev field as
> ++		 well.  */
> ++	      && sib.st_dev == sob.st_dev)
> + 	    {
> +-	      if (sib.st_ino == sob.st_ino && sib.st_ino != 0)
> +-		{
> +-		  /* Don't let as_fatal remove the output file!  */
> +-		  out_file_name = NULL;
> +-		  as_fatal (_("The input and output files must be distinct"));
> +-		}
> ++	      const char *saved_out_file_name = out_file_name;
> ++
> ++	      /* Don't let as_fatal remove the output file!  */
> ++	      out_file_name = NULL;
> ++	      as_fatal (_("The input '%s' and output '%s' files are the same"),
> ++			argv[i], saved_out_file_name);
> + 	    }
> + 	}
> +     }
> +--
> +2.7.4
> +
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* ✗ patchtest: failure for binutils: backport a patch to fix file matching problem
  2018-08-16  6:14 [PATCH 0/1] binutils: backport a patch to fix file matching problem Robert Yang
  2018-08-16  6:14 ` [PATCH 1/1] binutils: Improve check for input file matching output file Robert Yang
@ 2018-08-16  6:37 ` Patchwork
  1 sibling, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-08-16  6:37 UTC (permalink / raw)
  To: Robert Yang; +Cc: openembedded-core

== Series Details ==

Series: binutils: backport a patch to fix file matching problem
Revision: 1
URL   : https://patchwork.openembedded.org/series/13548/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             A patch file has been added, but does not have a Signed-off-by tag [test_signed_off_by_presence] 
  Suggested fix    Sign off the added patch file (meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] binutils: Improve check for input file matching output file
  2018-08-16  6:25   ` Robert Yang
@ 2018-08-17  0:30     ` Khem Raj
  0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2018-08-17  0:30 UTC (permalink / raw)
  To: Robert Yang, openembedded-core


[-- Attachment #1.1: Type: text/plain, Size: 4770 bytes --]



On 8/15/18 11:25 PM, Robert Yang wrote:
> 
> 
> On 08/16/2018 02:14 PM, Robert Yang wrote:
>> When the assembler reports that the input and output are the same,
>> report the
>> file names involved, in order to help debugging.  Also do not equate
>> two files
>> are the same if the have the same inode value but reside on different
>> file
>> systems.
>>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>>   meta/recipes-devtools/binutils/binutils-2.31.inc   |  1 +
>>   ...check-for-input-file-matching-output-file.patch | 59
>> ++++++++++++++++++++++
>>   2 files changed, 60 insertions(+)
>>   create mode 100644
>> meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch
>>
>>
>> diff --git a/meta/recipes-devtools/binutils/binutils-2.31.inc
>> b/meta/recipes-devtools/binutils/binutils-2.31.inc
>> index 02d5bca..6603873 100644
>> --- a/meta/recipes-devtools/binutils/binutils-2.31.inc
>> +++ b/meta/recipes-devtools/binutils/binutils-2.31.inc
>> @@ -36,6 +36,7 @@ SRC_URI = "\
>>        file://0014-Detect-64-bit-MIPS-targets.patch \
>>        file://0015-sync-with-OE-libtool-changes.patch \
>>        file://0016-add-i386pep-emulation-for-x86_64.patch \
>> +    
>> file://0017-improve-check-for-input-file-matching-output-file.patch \
>>   "
>>   S  = "${WORKDIR}/git"
>>   diff --git
>> a/meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch
>> b/meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch
>>
>> new file mode 100644
>> index 0000000..6d8d8a3
>> --- /dev/null
>> +++
>> b/meta/recipes-devtools/binutils/binutils/0017-improve-check-for-input-file-matching-output-file.patch
>>
>> @@ -0,0 +1,59 @@
>> +From 2a50366ded329bfb39d387253450c9d5302c3503 Mon Sep 17 00:00:00 2001
>> +From: Robert Yang <liezhi.yang@windriver.com>
>> +Date: Tue, 14 Aug 2018 12:22:35 +0100
>> +Subject: [PATCH] as.c: Improve check for input file matching output
>> file.
>> +
>> +When the assembler reports that the input and output are the same,
>> report the
>> +file names involved, in order to help debugging.  Also do not equate
>> two files
>> +are the same if the have the same inode value but reside on different
>> file
>> +systems.
>> +
>> +Upstream-Status: Backport
>> +
>> +Robert Yang <liezhi.yang@windriver.com>
> 
> Sorry, here missed a SOB, I fixed it in the repo:
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>


patch is ok

> 
> // Robert
> 
>> +---
>> + gas/as.c      | 27 ++++++++++++++++++++-------
>> + 2 files changed, 20 insertions(+), 7 deletions(-)
>> +
>> +diff --git a/gas/as.c b/gas/as.c
>> +index b2a908a..3105d06 100644
>> +--- a/gas/as.c
>> ++++ b/gas/as.c
>> +@@ -1259,14 +1259,27 @@ main (int argc, char ** argv)
>> +     {
>> +       struct stat sib;
>> +
>> +-      if (stat (argv[i], &sib) == 0)
>> ++      /* Check that the input file and output file are different.  */
>> ++      if (stat (argv[i], &sib) == 0
>> ++          && sib.st_ino == sob.st_ino
>> ++          /* POSIX emulating systems may support stat() but if the
>> ++         underlying file system does not support a file serial number
>> ++         of some kind then they will return 0 for the inode.  So
>> ++         two files with an inode of 0 may not actually be the same.
>> ++         On real POSIX systems no ordinary file will ever have an
>> ++         inode of 0.  */
>> ++          && sib.st_ino != 0
>> ++          /* Different files may have the same inode number if they
>> ++         reside on different devices, so check the st_dev field as
>> ++         well.  */
>> ++          && sib.st_dev == sob.st_dev)
>> +         {
>> +-          if (sib.st_ino == sob.st_ino && sib.st_ino != 0)
>> +-        {
>> +-          /* Don't let as_fatal remove the output file!  */
>> +-          out_file_name = NULL;
>> +-          as_fatal (_("The input and output files must be distinct"));
>> +-        }
>> ++          const char *saved_out_file_name = out_file_name;
>> ++
>> ++          /* Don't let as_fatal remove the output file!  */
>> ++          out_file_name = NULL;
>> ++          as_fatal (_("The input '%s' and output '%s' files are the
>> same"),
>> ++            argv[i], saved_out_file_name);
>> +         }
>> +     }
>> +     }
>> +--
>> +2.7.4
>> +
>>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-17  0:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-16  6:14 [PATCH 0/1] binutils: backport a patch to fix file matching problem Robert Yang
2018-08-16  6:14 ` [PATCH 1/1] binutils: Improve check for input file matching output file Robert Yang
2018-08-16  6:25   ` Robert Yang
2018-08-17  0:30     ` Khem Raj
2018-08-16  6:37 ` ✗ patchtest: failure for binutils: backport a patch to fix file matching problem Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox