From patchwork Thu Oct 11 13:49:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Khryukin X-Patchwork-Id: 190911 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 4CED72C0084 for ; Fri, 12 Oct 2012 00:49:35 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 19E0DA05C0; Thu, 11 Oct 2012 13:49:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2n6eCqxh5Htr; Thu, 11 Oct 2012 13:49:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 8783DA05AD; Thu, 11 Oct 2012 13:49:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8D2DC8F74A for ; Thu, 11 Oct 2012 13:49:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D595D84474 for ; Thu, 11 Oct 2012 13:49:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8zcWii-dOOFJ for ; Thu, 11 Oct 2012 13:49:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.mezon.ru (mail.mezon.ru [188.127.253.33]) by whitealder.osuosl.org (Postfix) with ESMTP id 21C6382030 for ; Thu, 11 Oct 2012 13:49:25 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.mezon.ru (Postfix) with ESMTP id 340CB1CD758 for ; Thu, 11 Oct 2012 17:49:24 +0400 (MSK) X-Virus-Scanned: amavisd-new at mezon.ru Received: from mail.mezon.ru ([127.0.0.1]) by localhost (stream2.mezon.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CSoiBA-0rbFX for ; Thu, 11 Oct 2012 17:49:22 +0400 (MSK) Received: from gate-obit.mezon.ru (gate-obit.mezon.ru [37.77.135.198]) by mail.mezon.ru (Postfix) with ESMTP id A01B21CD757 for ; Thu, 11 Oct 2012 17:49:22 +0400 (MSK) Received: from [192.168.0.206] (fdkit.mezon.lan [192.168.0.206]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by gate-obit.mezon.ru (Postfix) with ESMTP id 8EE08D70027 for ; Thu, 11 Oct 2012 17:49:22 +0400 (MSK) Message-ID: <1349963348.28555.3.camel@localhost> From: Alexander Khryukin To: buildroot@busybox.net Date: Thu, 11 Oct 2012 17:49:08 +0400 Organization: mezon.ru X-Mailer: Evolution 3.2.3 Mime-Version: 1.0 Subject: [Buildroot] make 3.82 version update + few patches X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list Reply-To: alexander@mezon.ru List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Alexander Khryukin From 3f735ae3f058c12cdeea77ee82c49b9664de69b2 Mon Sep 17 00:00:00 2001 From: Alexander Khryukin Date: Thu, 11 Oct 2012 13:52:46 +0000 Subject: [PATCH 2/2] patchset that includes various fixes like fix_whitespace_tokenization savannah-bugs-30612-30723 and lib64 fix --- .../make-3.8.2-fix_whitespace_tokenization.patch | 264 +++++++++++++++++++++ 1 file changed, 264 insertions(+) create mode 100644 package/make/make-3.8.2-fix_whitespace_tokenization.patch ++ int l = strlen (dp->name); + if (l > libdir_maxlen) + libdir_maxlen = l; + std_dirs++; +@@ -1635,9 +1679,12 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr) + was it will always be greater than the VPATH index. */ + unsigned int vpath_index = ~((unsigned int)0) - std_dirs; + +- for (dp = dirs; *dp != 0; ++dp) ++ for (dp = dirs; dp->name != 0; ++dp) + { +- sprintf (buf, "%s/%s", *dp, libbuf); ++ /* skip dirs which don't fit in the running mode. */ ++ if ((dp->mode & mode) == 0) ++ continue; ++ sprintf (buf, "%s/%s", dp->name, libbuf); + mtime = name_mtime (buf); + if (mtime != NONEXISTENT_MTIME) + { diff --git a/package/make/make-3.8.2-fix_whitespace_tokenization.patch b/package/make/make-3.8.2-fix_whitespace_tokenization.patch new file mode 100644 index 0000000..f34706b --- /dev/null +++ b/package/make/make-3.8.2-fix_whitespace_tokenization.patch @@ -0,0 +1,264 @@ +diff --git a/configure b/configure +index 130f4f8..d9d40de 100755 +--- a/configure ++++ b/configure +@@ -9379,6 +9379,9 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + + DEFS=-DHAVE_CONFIG_H + ++# have lib64 dirs? ++[[ -d /lib64 ]] && DEFS="$DEFS -DHAVE_LIB64DIRS" ++ + ac_libobjs= + ac_ltlibobjs= + for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue +diff --git a/default.c b/default.c +index 4d6d984..13ec30a 100644 +--- a/default.c ++++ b/default.c +@@ -432,7 +432,7 @@ static const char *default_variables[] = + #ifdef __convex__ + "FC", "fc", + #else +- "FC", "f77", ++ "FC", "gfortran", + #endif /* __convex__ */ + #endif /* _IBMR2 */ + /* System V uses these, so explicit rules using them should work. +diff --git a/doc/make.texi b/doc/make.texi +index fc7e8a3..27b0f72 100644 +--- a/doc/make.texi ++++ b/doc/make.texi +@@ -8706,7 +8706,7 @@ with the recipe @samp{$(PC) $(PFLAGS) -c}.@refill + @item Compiling Fortran and Ratfor programs + @cindex Fortran, rule to compile + @cindex Ratfor, rule to compile +-@pindex f77 ++@pindex gfortran + @pindex .f + @pindex .r + @pindex .F +diff --git a/function.c b/function.c +index e2f6c8c..680e954 100644 +--- a/function.c ++++ b/function.c +@@ -1133,19 +1133,14 @@ func_sort (char *o, char **argv, const char *funcname UNUSED) + + /* Find the maximum number of words we'll have. */ + t = argv[0]; +- wordi = 1; +- while (*t != '\0') ++ wordi = 0; ++ while ((p = find_next_token (&t, &len)) != 0) + { +- char c = *(t++); +- +- if (! isspace ((unsigned char)c)) +- continue; +- +- ++wordi; +- +- while (isspace ((unsigned char)*t)) +- ++t; ++ ++t; ++ wordi++; + } ++ if (! wordi) ++ wordi = 1; + + words = xmalloc (wordi * sizeof (char *)); + +diff --git a/main.c b/main.c +index c6989e3..8a5cabf 100644 +--- a/main.c ++++ b/main.c +@@ -1,3 +1,4 @@ ++ + /* Argument parsing and main program of GNU Make. + Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +@@ -1138,7 +1139,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 +@@ -2093,7 +2094,7 @@ main (int argc, char **argv, char **envp) + const char *pv = define_makeflags (1, 1); + char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1); + sprintf (p, "MAKEFLAGS=%s", pv); +- putenv (p); ++ putenv (allocated_variable_expand (p)); + } + + if (ISDB (DB_BASIC)) +diff --git a/read.c b/read.c +index a3ad88e..493cea9 100644 +--- 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,11 @@ 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) +diff --git a/remake.c b/remake.c +index 27d2550..7c5ee26 100644 +--- a/remake.c ++++ b/remake.c +@@ -39,6 +39,24 @@ this program. If not, see . */ + #include + #endif + ++/* Define biarch platforms. */ ++#if defined(__biarch__) ++#define BIARCH_PLATFORM ++#elif defined(__linux__) && \ ++ (defined(__x86_64__) || defined(__powerpc64__) || \ ++ defined(__s390x__) || defined(__sparc_v9__)) ++#define BIARCH_PLATFORM ++#endif ++ ++/* Define IS_MODE_32_BIT if we are running under a 32-bit personality. */ ++#ifdef BIARCH_PLATFORM ++#if defined(__linux__) ++#include ++#include ++#define IS_MODE_32_BIT ((syscall(SYS_personality, 0xffffffff) & PER_MASK) == PER_LINUX32) ++#endif ++#endif ++ + extern int try_implicit_rule (struct file *file, unsigned int depth); + + +@@ -1506,11 +1524,30 @@ name_mtime (const char *name) + static const char * + library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr) + { +- static char *dirs[] = ++ enum ++ { ++ MODE_32_BIT = 1, ++ MODE_64_BIT = 2, ++#ifdef BIARCH_PLATFORM ++ MODE_NATIVE = MODE_64_BIT ++#else ++ MODE_NATIVE = MODE_32_BIT ++#endif ++ }; ++ struct dir ++ { ++ const char *name; ++ int mode; ++ }; ++ static const struct dir dirs[] = + { + #ifndef _AMIGA +- "/lib", +- "/usr/lib", ++#if HAVE_LIB64DIRS ++ { "/lib64", MODE_64_BIT }, ++ { "/usr/lib64", MODE_64_BIT }, ++#endif ++ { "/lib", MODE_32_BIT | MODE_NATIVE }, ++ { "/usr/lib", MODE_32_BIT | MODE_NATIVE }, + #endif + #if defined(WINDOWS32) && !defined(LIBDIR) + /* +@@ -1519,8 +1556,8 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr) + */ + #define LIBDIR "." + #endif +- LIBDIR, /* Defined by configuration. */ +- 0 ++ { LIBDIR, MODE_NATIVE }, /* Defined by configuration. */ ++ { 0, 0 } + }; + + const char *file = 0; +@@ -1537,7 +1574,14 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr) + unsigned int best_vpath, best_path; + unsigned int std_dirs = 0; + +- char **dp; ++ const struct dir *dp; ++ ++ /* Check for running mode (personality). */ ++ int mode = MODE_NATIVE; ++#ifdef BIARCH_PLATFORM ++ if (IS_MODE_32_BIT) ++ mode = MODE_32_BIT; ++#endif + + libpatterns = xstrdup (variable_expand ("$(.LIBPATTERNS)")); + +@@ -1614,9 +1658,9 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr) + + if (!buflen) + { +- for (dp = dirs; *dp != 0; ++dp) ++ for (dp = dirs; dp->name != 0; ++dp) + { +- int l = strlen (*dp);