savannah bug30612: handling of archives
authorAnas Nashif <anas.nashif@intel.com>
Mon, 5 Nov 2012 19:20:37 +0000 (11:20 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Mon, 5 Nov 2012 19:20:37 +0000 (11:20 -0800)
ChangeLog
NEWS
main.c
read.c
tests/ChangeLog
tests/run_make_tests.pl

index bfccc03d87113f93709538e040f80346b7f3cd97..91878fbef01e1b25ef3bfd962c8d1d83f25173e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-13  Paul Smith  <psmith@gnu.org>
+
+       * NEWS: Accidentally forgot to back out the sorted wildcard
+       enhancement in 3.82, so update NEWS.
+       Also add NEWS about the error check for explicit and pattern
+       targets in the same rule, added to 3.82.
+
+       * main.c (main): Add "oneshell" to $(.FEATURES) (forgot to add
+       this in 3.82!)
+
+       * read.c (parse_file_seq): Fix various errors parsing archives
+       with multiple objects in the parenthesis, as well as wildcards.
+       Fixes Savannah bug #30612.
+
 2010-08-10  Paul Smith  <psmith@gnu.org>
 
        * main.c (main): Expand MAKEFLAGS before adding it to the
diff --git a/NEWS b/NEWS
index 523c9a7f4b049116dff820eabf595378bb41be98..24698dcbe5130873ce35f2818d610db9bb77a37c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,14 +18,6 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
 * Compiling GNU make now requires a conforming ISO C 1989 compiler and
   standard runtime library.
 
-* WARNING: Future backward-incompatibility!
-  Wildcards are not documented as returning sorted values, but up to and
-  including this release the results have been sorted and some makefiles are
-  apparently depending on that.  In the next release of GNU make, for
-  performance reasons, we may remove that sorting.  If your makefiles
-  require sorted results from wildcard expansions, use the $(sort ...)
-  function to request it explicitly.
-
 * WARNING: Backward-incompatibility!
   The POSIX standard for make was changed in the 2008 version in a
   fundamentally incompatible way: make is required to invoke the shell as if
@@ -41,6 +33,21 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
   be considered out of date, even if they do not exist (previously only
   existing targets were provided in $?).
 
+* WARNING: Backward-incompatibility!
+  Wildcards were not documented as returning sorted values, but the results
+  have been sorted up until this release..  If your makefiles require sorted
+  results from wildcard expansions, use the $(sort ...)  function to request
+  it explicitly.
+
+* WARNING: Backward-incompatibility!
+  In previous versions of make it was acceptable to list one or more explicit
+  targets followed by one or more pattern targets in the same rule and it
+  worked "as expected".  However, this was not documented as acceptable and if
+  you listed any explicit targets AFTER the pattern targets, the entire rule
+  would be mis-parsed.  This release removes this ability completely: make
+  will generate an error message if you mix explicit and pattern targets in
+  the same rule.
+
 * WARNING: Backward-incompatibility!
   As a result of parser enhancements, three backward-compatibility issues
   exist: first, a prerequisite containing an "=" cannot be escaped with a
diff --git a/main.c b/main.c
index 9fe80909493f42f8602211cd2e166f00bd2c2db2..782b0de072bea9706551a34e987d55170bc330c4 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1138,7 +1138,7 @@ main (int argc, char **argv, char **envp)
      a macro and some compilers (MSVC) don't like conditionals in macros.  */
   {
     const char *features = "target-specific order-only second-expansion"
-                           " else-if shortest-stem undefine"
+                           " else-if shortest-stem undefine oneshell"
 #ifndef NO_ARCHIVES
                            " archives"
 #endif
diff --git a/read.c b/read.c
index a3ad88e4730fea0a6090398ac7bdbe6e2a9f44e5..9dfd4ea04c4805067c34b95feb41b51f9ebd03ff 100644 (file)
--- a/read.c
+++ b/read.c
@@ -3028,7 +3028,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopchar,
             {
               /* This looks like the first element in an open archive group.
                  A valid group MUST have ')' as the last character.  */
-              const char *e = p + nlen;
+              const char *e = p;
               do
                 {
                   e = next_token (e);
@@ -3084,19 +3084,19 @@ parse_file_seq (char **stringp, unsigned int size, int stopchar,
          Go to the next item in the string.  */
       if (flags & PARSEFS_NOGLOB)
         {
-          NEWELT (concat (2, prefix, tp));
+          NEWELT (concat (2, prefix, tmpbuf));
           continue;
         }
 
       /* If we get here we know we're doing glob expansion.
          TP is a string in tmpbuf.  NLEN is no longer used.
          We may need to do more work: after this NAME will be set.  */
-      name = tp;
+      name = tmpbuf;
 
       /* Expand tilde if applicable.  */
-      if (tp[0] == '~')
+      if (tmpbuf[0] == '~')
        {
-         tildep = tilde_expand (tp);
+         tildep = tilde_expand (tmpbuf);
          if (tildep != 0)
             name = tildep;
        }
@@ -3152,7 +3152,10 @@ parse_file_seq (char **stringp, unsigned int size, int stopchar,
             else
               {
                 /* We got a chain of items.  Attach them.  */
-                (*newp)->next = found;
+                if (*newp)
+                  (*newp)->next = found;
+                else
+                  *newp = found;
 
                 /* Find and set the new end.  Massage names if necessary.  */
                 while (1)
index 650d8d448958fa899ac391e7ab131452d768470c..5d6293099bd67ba29b09ff0d1ec0fb2a9e2f4da1 100644 (file)
@@ -1,3 +1,11 @@
+2010-08-13  Paul Smith  <psmith@gnu.org>
+
+       * scripts/features/archives: New regression tests for archive
+       support.  Test for fix to Savannah bug #30612.
+
+       * run_make_tests.pl (set_more_defaults): Set a %FEATURES hash to
+       the features available in $(.FEATURES).
+
 2010-08-10  Paul Smith  <psmith@gnu.org>
 
        * scripts/features/reinvoke: Ensure command line variable settings
index 2c8c08b924a145c1242b05c0e9a9a4b5f04e1f52..7291c55728e8390b55ec7d6945b5925aa512201f 100755 (executable)
@@ -29,6 +29,7 @@
 # You should have received a copy of the GNU General Public License along with
 # this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%FEATURES = ();
 
 $valgrind = 0;              # invoke make with valgrind
 $valgrind_args = '';
@@ -367,6 +368,8 @@ sub set_more_defaults
      $parallel_jobs = 1;
    }
 
+   %FEATURES = map { $_ => 1 } split /\s+/, `sh -c "echo '\\\$(info \\\$(.FEATURES))' | $make_path -f- 2>/dev/null"`;
+
    # Set up for valgrind, if requested.
 
    if ($valgrind) {