[gcc-7] 273/354: * Apply proposed patch for PR driver/81829. Closes: #853537.

Ximin Luo infinity0 at debian.org
Thu Nov 23 15:51:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository gcc-7.

commit b8c260a5d861fef01bf5405f7da50db118dd9c89
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date:   Fri Aug 18 16:11:02 2017 +0000

      * Apply proposed patch for PR driver/81829. Closes: #853537.
    
    
    git-svn-id: svn+ssh://svn.debian.org/svn/gcccvs/branches/sid/gcc-7@9628 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
 debian/patches/pr81829.diff | 61 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/debian/patches/pr81829.diff b/debian/patches/pr81829.diff
index 9460a2d..472e3d0 100644
--- a/debian/patches/pr81829.diff
+++ b/debian/patches/pr81829.diff
@@ -1,3 +1,32 @@
+From f8029ed6d3dd444ee2608146118f2189cf9ef0d8 Mon Sep 17 00:00:00 2001
+From: marxin <mliska at suse.cz>
+Date: Mon, 14 Aug 2017 13:56:32 +0200
+Subject: [PATCH] Fix file find utils and add unit tests (PR driver/81829).
+
+gcc/ChangeLog:
+
+2017-08-14  Martin Liska  <mliska at suse.cz>
+
+	PR driver/81829
+	* file-find.c (do_add_prefix): Always append DIR_SEPARATOR
+	at the end of a prefix.
+	(remove_prefix): Properly remove elements and accept also
+	path without a trailing DIR_SEPARATOR.
+	(purge): New function.
+	(file_find_verify_prefix_creation): Likewise.
+	(file_find_verify_prefix_add): Likewise.
+	(file_find_verify_prefix_removal): Likewise.
+	(file_find_c_tests): Likewise.
+	* selftest-run-tests.c (selftest::run_tests): Add new
+	file_find_c_tests.
+	* selftest.h (file_find_c_tests): Likewise.
+---
+ gcc/file-find.c          | 182 ++++++++++++++++++++++++++++++++++++++++++-----
+ gcc/gcc-ar.c             |  19 +++--
+ gcc/selftest-run-tests.c |   1 +
+ gcc/selftest.h           |   1 +
+ 4 files changed, 179 insertions(+), 24 deletions(-)
+
 Index: b/src/gcc/file-find.c
 ===================================================================
 --- a/src/gcc/file-find.c
@@ -221,6 +250,38 @@ Index: b/src/gcc/file-find.c
 +
 +} // namespace selftest
 +#endif /* CHECKING_P */
+Index: b/src/gcc/gcc-ar.c
+===================================================================
+--- a/src/gcc/gcc-ar.c
++++ b/src/gcc/gcc-ar.c
+@@ -194,15 +194,20 @@ main (int ac, char **av)
+ #ifdef CROSS_DIRECTORY_STRUCTURE
+       real_exe_name = concat (target_machine, "-", PERSONALITY, NULL);
+ #endif
+-      /* Do not search original location in the same folder.  */
+-      char *exe_folder = lrealpath (av[0]);
+-      exe_folder[strlen (exe_folder) - strlen (lbasename (exe_folder))] = '\0';
+-      char *location = concat (exe_folder, PERSONALITY, NULL);
++      char *wrapper_file = lrealpath (av[0]);
++      exe_name = lrealpath (find_a_file (&path, real_exe_name, X_OK));
+ 
+-      if (access (location, X_OK) == 0)
+-	remove_prefix (exe_folder, &path);
++      /* If the exe_name points to the wrapper, remove folder of the wrapper
++	 from prefix and try search again.  */
++      if (strcmp (exe_name, wrapper_file) == 0)
++	{
++	  char *exe_folder = wrapper_file;
++	  exe_folder[strlen (exe_folder) - strlen (lbasename (exe_folder))] = '\0';
++	  remove_prefix (exe_folder, &path);
++
++	  exe_name = find_a_file (&path, real_exe_name, X_OK);
++	}
+ 
+-      exe_name = find_a_file (&path, real_exe_name, X_OK);
+       if (!exe_name)
+ 	{
+ 	  fprintf (stderr, "%s: Cannot find binary '%s'\n", av[0],
 Index: b/src/gcc/selftest-run-tests.c
 ===================================================================
 --- a/src/gcc/selftest-run-tests.c

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-7.git



More information about the Reproducible-commits mailing list